public MuleEvent process(MuleEvent event) throws MuleException { return endpoint.process(event); }
public MuleEvent process(MuleEvent event) throws MuleException { return endpoint.process(event); }
@Override public MuleEvent process(MuleEvent event) throws MuleException { return getStaticEndpoint(event).process(event); }
public MuleMessage process(OutboundEndpoint endpoint, MuleMessage message) throws MuleException { return returnMessage(endpoint.process(createMuleEvent(message, endpoint))); }
/** * Dispatches an event asynchronously to a endpointUri via a Mule server. The URL * determines where to dispatch the event to. * * @param url the Mule URL used to determine the destination and transport of the * message * @param message the message to send * @throws org.mule.api.MuleException */ public void dispatch(String url, MuleMessage message) throws MuleException { OutboundEndpoint endpoint = getOutboundEndpoint(url, MessageExchangePattern.ONE_WAY, null); MuleEvent event = getEvent(message, MessageExchangePattern.ONE_WAY); endpoint.process(event); }
public MuleMessage process(String uri, MessageExchangePattern mep, MuleMessage message) throws MuleException { OutboundEndpoint endpoint = endpointCache.getOutboundEndpoint(uri, mep, null); return returnMessage(endpoint.process(createMuleEvent(message, endpoint))); }
/** * Sends an event synchronously to a endpointUri via a Mule server without * waiting for the result. * * @param url the Mule URL used to determine the destination and transport of the * message * @param payload the object that is the payload of the event * @param messageProperties any properties to be associated with the payload. In * the case of Jms you could set the JMSReplyTo property in these * properties. * @throws org.mule.api.MuleException */ public void sendNoReceive(String url, Object payload, Map<String, Object> messageProperties) throws MuleException { if (messageProperties == null) { messageProperties = new HashMap<String, Object>(); } messageProperties.put(MuleProperties.MULE_REMOTE_SYNC_PROPERTY, "false"); MuleMessage message = new DefaultMuleMessage(payload, messageProperties, muleContext); OutboundEndpoint endpoint = getOutboundEndpoint(url, MessageExchangePattern.REQUEST_RESPONSE, null); MuleEvent event = getEvent(message, MessageExchangePattern.REQUEST_RESPONSE); endpoint.process(event); }
private MuleMessage internalSend(String url, MuleMessage message, Long timeout) throws MuleException { OutboundEndpoint endpoint = endpointCache.getOutboundEndpoint(url, MessageExchangePattern.REQUEST_RESPONSE, timeout); return returnMessage(endpoint.process(createMuleEvent(message, endpoint))); }
protected MuleEvent processNext(MuleEvent event, Exchange exchange, OutboundEndpoint endpoint) throws MuleException { CxfOutboundMessageProcessor processor = (CxfOutboundMessageProcessor) exchange.get(CxfConstants.CXF_OUTBOUND_MESSAGE_PROCESSOR); MuleEvent response; if (processor == null) { response = endpoint.process(event); } else { response = processor.processNext(event); Holder<MuleEvent> holder = (Holder<MuleEvent>) exchange.get("holder"); holder.value = response; } return response; }
protected void dispatch(String endpointRef, Object payload, JobDataMap jobDataMap) throws MuleException { @SuppressWarnings("unchecked") Map<String, Object> properties = jobDataMap; MuleMessage message = new DefaultMuleMessage(payload, properties, muleContext); FlowConstruct flowConstruct = new DefaultLocalMuleClient.MuleClientFlowConstruct(muleContext); MuleEvent event = new DefaultMuleEvent(message, MessageExchangePattern.ONE_WAY, flowConstruct); OutboundEndpoint endpoint = getOutboundEndpoint(endpointRef); endpoint.process(event); }
/** * Sends an event synchronously to a endpointUri via a mule server and a * resulting message is returned. * * @param url the Mule URL used to determine the destination and transport of the * message * @param message The message to send * @param timeout The time in milliseconds the the call should block waiting for * a response * @return A return message, this could be <code>null</code> if the the components invoked * explicitly sets a return as <code>null</code>. * @throws org.mule.api.MuleException */ public MuleMessage send(String url, MuleMessage message, int timeout) throws MuleException { OutboundEndpoint endpoint = getOutboundEndpoint(url, MessageExchangePattern.REQUEST_RESPONSE, timeout); MuleEvent event = getEvent(message, MessageExchangePattern.REQUEST_RESPONSE); MuleEvent response = endpoint.process(event); if (response != null && !VoidMuleEvent.getInstance().equals(response)) { return response.getMessage(); } else { return new DefaultMuleMessage(NullPayload.getInstance(), muleContext); } }
protected MuleMessage handleRedirect(HttpMethod method, MuleEvent event) throws HttpResponseException, MuleException, IOException { String followRedirects = (String)endpoint.getProperty("followRedirects"); if (followRedirects==null || "false".equalsIgnoreCase(followRedirects)) { if (logger.isInfoEnabled()) { logger.info("Received a redirect, but followRedirects=false. Response code: " + method.getStatusCode() + " " + method.getStatusText()); } return getResponseFromMethod(method, null); } Header locationHeader = method.getResponseHeader(HttpConstants.HEADER_LOCATION); if (locationHeader == null) { throw new HttpResponseException(method.getStatusText(), method.getStatusCode()); } OutboundEndpoint out = new EndpointURIEndpointBuilder(locationHeader.getValue(), getEndpoint().getMuleContext()).buildOutboundEndpoint(); MuleEvent result = out.process(event); if (result != null && !VoidMuleEvent.getInstance().equals(result)) { return result.getMessage(); } else { return null; } }
public MuleEvent process(MuleEvent event) throws MessagingException { try { return endpoint.process(new DefaultMuleEvent(event.getMessage(), endpoint.getExchangePattern(), flow, event.getSession())); } catch (MessagingException e) { throw e; } catch (MuleException e) { throw new MessagingException(e.getI18nMessage(), event, e, endpoint); } }
public void dispatch(String url, MuleMessage message) throws MuleException { final MessageProcessor connectorMessageProcessor = getConnectorMessageProcessLocator().locateConnectorOperation(url, newOptions().build(), MessageExchangePattern.ONE_WAY); if (connectorMessageProcessor != null) { connectorMessageProcessor.process(createRequestResponseMuleEvent(message)); } else { OutboundEndpoint endpoint = endpointCache.getOutboundEndpoint(url, MessageExchangePattern.ONE_WAY, null); if (RequestContext.getEvent() != null) { endpoint.process(createMuleEvent(message, endpoint, RequestContext.getEvent().getSession())); } else { endpoint.process(createMuleEvent(message, endpoint)); } } }
public MuleMessage send(String url, MuleMessage message) throws MuleException { final MessageProcessor connectorMessageProcessor = getConnectorMessageProcessLocator().locateConnectorOperation(url, newOptions().build(), MessageExchangePattern.REQUEST_RESPONSE); if (connectorMessageProcessor != null) { return returnMessage(connectorMessageProcessor.process(createRequestResponseMuleEvent(message))); } else { OutboundEndpoint endpoint = endpointCache.getOutboundEndpoint(url, MessageExchangePattern.REQUEST_RESPONSE, null); if (RequestContext.getEvent() != null) { return returnMessage(endpoint.process(createMuleEvent(message, endpoint, RequestContext.getEvent().getSession()))); } else { return returnMessage(endpoint.process(createMuleEvent(message, endpoint))); } } }
MuleMessage result = null; MuleEvent resultEvent = syncServerEndpoint.process(new DefaultMuleEvent(msg, MessageExchangePattern.REQUEST_RESPONSE, new MuleClientFlowConstruct(muleContext))); if (resultEvent != null && !VoidMuleEvent.getInstance().equals(resultEvent))
MuleEvent resultEvent = ep.process(event);
MuleEvent resultEvent = ep.process(event);
@Override public MuleEvent doCatchMessage(MuleEvent event) throws RoutingException { if (getEndpoint() == null) { throw new RoutingException(CoreMessages.noCatchAllEndpointSet(), event, getEndpoint()); } try { OutboundEndpoint endpoint = getEndpoint(); if (sendTransformed && endpoint.getTransformers() != null) { event.getMessage().applyTransformers(event, endpoint.getTransformers()); } MuleEvent result = endpoint.process(event); if (statistics != null && statistics.isEnabled()) { statistics.incrementRoutedMessage(getEndpoint()); } return result; } catch (Exception e) { throw new RoutingException(event, getEndpoint(), e); } }
@Override public MuleEvent process(MuleEvent event) throws MuleException { MockEndpointManager manager = (MockEndpointManager) getEndpointManager(event); String address = realAddressAsExpression(); ExpressionManager expressionManager = event.getMuleContext().getExpressionManager(); if (expressionManager.isValidExpression(address)) { String realAddress = (String) expressionManager.evaluate(address, event); OutboundBehavior behavior = manager.getBehaviorFor(realAddress); if (behavior == null) { return realEndpoint.process(event); } if (behavior.getException() != null) { throw behavior.getException(); } MunitUtils.verifyAssertions(event, behavior.getAssertions()); if (behavior.getMuleMessageTransformer() != null) { event.setMessage(behavior.getMuleMessageTransformer().transform(event.getMessage())); } } return event; }