public EndpointURI getEndpointURI() { if (dynamicEndpointURI != null) { return dynamicEndpointURI; } else { return endpoint.getEndpointURI(); } }
public MuleContext getMuleContext() { return endpoint.getMuleContext(); }
public FileMessageRequester(InboundEndpoint endpoint) throws MuleException { super(endpoint); this.fileConnector = (FileConnector) endpoint.getConnector(); this.workDir = fileConnector.getWorkDirectory(); this.workFileNamePattern = fileConnector.getWorkFileNamePattern(); Filter filter = endpoint.getFilter(); if (filter instanceof FilenameFilter) { filenameFilter = (FilenameFilter) filter; } else if (filter instanceof FileFilter) { fileFilter = (FileFilter) filter; } else if (filter != null) { throw new CreateException(FileMessages.invalidFileFilter(endpoint.getEndpointURI()), this); } }
private String getReplyTo() { InboundEndpoint endpoint = ((InboundEndpoint) replyMessageSource); return endpoint.getConnector().getCanonicalURI(endpoint.getEndpointURI()); }
private static String getEndpointDescription(InboundEndpoint endpoint) { String endpointString = endpoint.getName(); if (endpointString == null) { endpointString = endpoint.getEndpointURI().getUri().toString(); } return endpointString; }
@Override protected Object getReceiverKey(FlowConstruct flowConstruct, InboundEndpoint endpoint) { if (endpoint.getFilter() != null && endpoint.getFilter() instanceof FilenameWildcardFilter) { return endpoint.getEndpointURI().getAddress() + "/" + ((FilenameWildcardFilter) endpoint.getFilter()).getPattern(); } return endpoint.getEndpointURI().getAddress(); }
@Override public MessageReceiver createReceiver(FlowConstruct flowConstruct, InboundEndpoint endpoint) throws Exception { if (!endpoint.getExchangePattern().hasResponse()) { queueProfile.configureQueue(endpoint.getMuleContext(), endpoint.getEndpointURI().getAddress(), getQueueManager()); } return serviceDescriptor.createMessageReceiver(this, flowConstruct, endpoint); }
public DefaultMuleEvent(MuleMessage message, InboundEndpoint endpoint, FlowConstruct flowConstruct, MuleSession session, ReplyToHandler replyToHandler, Object replyToDestination, OutputStream outputStream) { this.id = generateEventId(message.getMuleContext()); this.flowConstruct = flowConstruct; this.session = session; setMessage(message); this.outputStream = outputStream; this.processingTime = ProcessingTime.newInstance(this); this.replyToHandler = replyToHandler; this.replyToDestination = replyToDestination; this.credentials = extractCredentials(endpoint); this.encoding = endpoint.getEncoding(); this.exchangePattern = endpoint.getExchangePattern(); this.messageSourceName = endpoint.getName(); this.messageSourceURI = endpoint.getEndpointURI().getUri(); this.timeout = endpoint.getResponseTimeout(); this.transacted = endpoint.getTransactionConfig().isTransacted(); fillProperties(endpoint); this.synchronous = resolveEventSynchronicity(); this.nonBlocking = isFlowConstructNonBlockingProcessingStrategy(); }
public StdioMessageReceiver(Connector connector, FlowConstruct flowConstruct, InboundEndpoint endpoint, long checkFrequency) throws CreateException { super(connector, flowConstruct, endpoint); this.setFrequency(checkFrequency); this.connector = (StdioConnector) connector; String streamName = endpoint.getEndpointURI().getAddress(); if (StdioConnector.STREAM_SYSTEM_IN.equalsIgnoreCase(streamName)) { inputStream = System.in; } else { inputStream = this.connector.getInputStream(); } // apply connector-specific properties if (connector instanceof PromptStdioConnector) { PromptStdioConnector ssc = (PromptStdioConnector) connector; String promptMessage = (String) endpoint.getProperties().get("promptMessage"); if (promptMessage != null) { ssc.setPromptMessage(promptMessage); } } this.sendStream = BooleanUtils.toBoolean((String) endpoint.getProperties().get("sendStream")); }
public HttpClientMessageRequester(InboundEndpoint endpoint) { super(endpoint); this.connector = (HttpConnector) endpoint.getConnector(); this.receiveTransformer = new HttpClientMethodResponseToObject(); this.receiveTransformer.setMuleContext(getEndpoint().getMuleContext()); }
public UdpMessageRequester(InboundEndpoint endpoint) { super(endpoint); this.connector = (UdpConnector)endpoint.getConnector(); }
requestChainBuilder.setName("InboundEndpoint '" + endpoint.getEndpointURI().getUri() + "' request chain"); AbstractRedeliveryPolicy redeliveryPolicy = endpoint.getRedeliveryPolicy(); if (redeliveryPolicy != null) requestChainBuilder.chain(endpoint.getMessageProcessors()); if (!endpoint.getExchangePattern().hasResponse()) responseChainBuilder.setName("InboundEndpoint '" + endpoint.getEndpointURI().getUri() + "' response chain"); responseChainBuilder.chain(endpoint.getResponseMessageProcessors()); compositeChainBuilder.setName("InboundEndpoint '"+ endpoint.getEndpointURI().getUri() +"' composite request/response chain"); compositeChainBuilder.chain(requestChainBuilder.build(), responseChainBuilder.build()); return compositeChainBuilder.build();
protected void warnIfMuleClientSendUsed(MuleMessage message) { final Object remoteSyncProperty = message.removeProperty(MuleProperties.MULE_REMOTE_SYNC_PROPERTY, PropertyScope.INBOUND); if (ObjectUtils.getBoolean(remoteSyncProperty, false) && !messageReceiver.getEndpoint().getExchangePattern().hasResponse()) { logger.warn("MuleClient.send() was used but inbound endpoint " + messageReceiver.getEndpoint().getEndpointURI().getUri().toString() + " is not 'request-response'. No response will be returned."); } message.removeProperty(MuleProperties.MULE_REMOTE_SYNC_PROPERTY, PropertyScope.INBOUND); }
private MuleMessage requestMessage(InboundEndpoint endpoint, long timeout) throws Exception { MuleMessage result = endpoint.request(timeout); // In scenarios where a message is requested to a shared connector, the original context is overrode by the domain context. // A quick fix is to copy the obtained message with the original context. if (messageWasSentToSharedConnector(endpoint, result)) { if (result.getClass().equals(DefaultMuleMessage.class)) { return new DefaultMuleMessage(result.getPayload(), result, endpoint.getMuleContext()); } else if (result.getClass().equals(DefaultMessageCollection.class)) { return new DefaultMessageCollection((DefaultMessageCollection) result, endpoint.getMuleContext(), true); } } return result; }
public MessageExchangePattern getExchangePattern() { return endpoint.getExchangePattern(); }
returnMessage = !getEndpoint().getExchangePattern().hasResponse() || event == null ? null : event.getMessage(); getEndpoint().getMuleContext().getExceptionListener().handleException(e);
@Override protected void doInitialise() throws InitialisationException { this.lockFactory = getEndpoint().getMuleContext().getLockFactory(); boolean synchronousProcessing = false; if (getFlowConstruct() instanceof Flow) { synchronousProcessing = ((Flow)getFlowConstruct()).getProcessingStrategy() instanceof SynchronousProcessingStrategy; } this.poolOnPrimaryInstanceOnly = Boolean.valueOf(System.getProperty(MULE_TRANSPORT_FILE_SINGLEPOLLINSTANCE,"false")) || !synchronousProcessing; ObjectStoreManager objectStoreManager = getEndpoint().getMuleContext().getRegistry().get(MuleProperties.OBJECT_STORE_MANAGER); filesBeingProcessingObjectStore = objectStoreManager.getObjectStore(getEndpoint().getName(),false,1000,60000,20000); }
public Map getProperties() { return endpoint.getProperties(); }
MuleMessage returnMessage = endpoint.request(to); writeResponse(httpServletResponse, returnMessage); MuleMessage returnMessage = !receiver.getEndpoint().getExchangePattern().hasResponse() || event == null ? null : event.getMessage(); writeResponse(httpServletResponse, returnMessage);
private void validateInboundEndpoint(InboundEndpoint inboundEndpoint) throws FlowConstructInvalidException { if (inboundEndpoint.getExchangePattern() != exchangePattern) { throw new FlowConstructInvalidException( MessageFactory.createStaticMessage("Inconsistent bridge inbound endpoint exchange pattern, expected " + exchangePattern + " but was " + inboundEndpoint.getExchangePattern()), this); } if (transacted && ((inboundEndpoint.getTransactionConfig() == null) || (!inboundEndpoint.getTransactionConfig() .isConfigured()))) { throw new FlowConstructInvalidException( MessageFactory.createStaticMessage("A transacted bridge requires a transacted inbound endpoint"), this); } if ((!transacted) && (inboundEndpoint.getTransactionConfig() != null) && (inboundEndpoint.getTransactionConfig().isConfigured())) { throw new FlowConstructInvalidException( MessageFactory.createStaticMessage("A non-transacted bridge requires a non-transacted inbound endpoint"), this); } }