org.mule.transport
Class AbstractMessageDispatcher
java.lang.Object
org.mule.transport.AbstractTransportMessageHandler
org.mule.transport.AbstractMessageDispatcher
- All Implemented Interfaces:
- Disposable, Initialisable, Lifecycle, LifecycleStateEnabled, Startable, Stoppable, MessageProcessor, Connectable, MessageDispatcher
- Direct Known Subclasses:
- AjaxMessageDispatcher, AxisMessageDispatcher, FileMessageDispatcher, FtpMessageDispatcher, HttpClientMessageDispatcher, JdbcMessageDispatcher, JmsMessageDispatcher, QuartzMessageDispatcher, RmiMessageDispatcher, SftpMessageDispatcher, SmtpMessageDispatcher, StdioMessageDispatcher, TcpMessageDispatcher, UdpMessageDispatcher, UnsupportedMessageDispatcher, VMMessageDispatcher, XmppMessageDispatcher
public abstract class AbstractMessageDispatcher
- extends AbstractTransportMessageHandler
- implements MessageDispatcher
Abstract implementation of an outbound channel adaptors. Outbound channel adaptors send messages over over
a specific transport. Different implementations may support different Message Exchange Patterns.
Methods inherited from class org.mule.transport.AbstractTransportMessageHandler |
activate, connect, createMuleMessage, createMuleMessage, createMuleMessage, createMuleMessageFactory, createNullMuleMessage, disconnect, dispose, disposeAndLogException, doConnect, doDisconnect, doDispose, doInitialise, doStart, doStop, getConnectEventId, getConnectionDescription, getConnector, getLifecycleState, initialise, initializeMessageFactory, initializeRetryPolicy, isConnected, isDoThreading, isStarted, isStarting, isStopping, passivate, setEndpoint, start, stop, toString, validate, validateConnection |
Methods inherited from interface org.mule.api.lifecycle.Startable |
start |
Methods inherited from interface org.mule.api.lifecycle.Stoppable |
stop |
defaultOutboundTransformers
protected List<Transformer> defaultOutboundTransformers
defaultResponseTransformers
protected List<Transformer> defaultResponseTransformers
AbstractMessageDispatcher
public AbstractMessageDispatcher(OutboundEndpoint endpoint)
createLifecycleManager
protected ConnectableLifecycleManager createLifecycleManager()
- Specified by:
createLifecycleManager
in class AbstractTransportMessageHandler
getDispatcherName
protected String getDispatcherName()
process
public MuleEvent process(MuleEvent event)
throws MuleException
- Description copied from interface:
MessageProcessor
- Invokes the MessageProcessor.
- Specified by:
process
in interface MessageProcessor
- Parameters:
event
- MuleEvent to be processed
- Returns:
- optional response MuleEvent
- Throws:
MuleException
returnResponse
@Deprecated
protected boolean returnResponse(MuleEvent event)
- Deprecated.
returnResponse
protected boolean returnResponse(MuleEvent event,
boolean doSend)
- Used to determine if the dispatcher implementation should wait for a response to an event on a response
channel after it sends the event. The following rules apply:
- The connector has to support "back-channel" response. Some transports do not have the notion of a
response channel.
- Check if the endpoint is synchronous (outbound synchronicity is not explicit since 2.2 and does not
use the remoteSync message property).
- Or, if the send() method on the dispatcher was used. (This is required because the ChainingRouter
uses send() with async endpoints. See MULE-4631).
- Finally, if the current service has a response router configured, that the router will handle the
response channel event and we should not try and receive a response in the Message dispatcher If
remotesync should not be used we must remove the REMOTE_SYNC header Note the MuleClient will
automatically set the REMOTE_SYNC header when client.send(..) is called so that results are returned
from remote invocations too.
- Parameters:
event
- the current event
- Returns:
- true if a response channel should be used to get a response from the event dispatch.
getWorkManager
protected WorkManager getWorkManager()
- Specified by:
getWorkManager
in class AbstractTransportMessageHandler
getEndpoint
public OutboundEndpoint getEndpoint()
- Specified by:
getEndpoint
in interface MessageDispatcher
- Overrides:
getEndpoint
in class AbstractTransportMessageHandler
- Returns:
- the endpoint which we are dispatching events to
applyOutboundTransformers
protected void applyOutboundTransformers(MuleEvent event)
throws MuleException
- Throws:
MuleException
applyResponseTransformers
protected void applyResponseTransformers(MuleEvent event)
throws MuleException
- Throws:
MuleException
doDispatch
protected abstract void doDispatch(MuleEvent event)
throws Exception
- Throws:
Exception
doSend
protected abstract MuleMessage doSend(MuleEvent event)
throws Exception
- Throws:
Exception
Copyright © 2003-2012 MuleSoft, Inc.. All Rights Reserved.