public abstract class AbstractMessageReceiver extends AbstractTransportMessageHandler implements MessageReceiver
AbstractMessageReceiver
provides common methods for all Message
Receivers provided with Mule. A message receiver enables an endpoint to receive a
message from an external system.Modifier and Type | Field and Description |
---|---|
protected List<Transformer> |
defaultInboundTransformers |
protected List<Transformer> |
defaultResponseTransformers |
protected FlowConstruct |
flowConstruct
The Service with which this receiver is associated with
|
protected MessageProcessor |
listener
MessageProcessor chain used to process messages once the transport
specific MessageReceiver has received transport message and created
the MuleEvent |
protected String |
receiverKey
Stores the key to this receiver, as used by the Connector to store the
receiver.
|
protected ReplyToHandler |
replyToHandler |
connected, connector, endpoint, lifecycleManager, logger, muleMessageFactory, retryTemplate
PHASE_NAME
PHASE_NAME
PHASE_NAME
PHASE_NAME
Constructor and Description |
---|
AbstractMessageReceiver(Connector connector,
FlowConstruct flowConstruct,
InboundEndpoint endpoint)
Creates the Message Receiver
|
activate, connect, createMuleMessage, createMuleMessage, createMuleMessage, createMuleMessageFactory, createNullMuleMessage, disconnect, dispose, disposeAndLogException, doConnect, doDisconnect, doInitialise, doStart, getConnectEventId, getConnector, getLifecycleState, initializeMessageFactory, initializeRetryPolicy, isConnected, isDoThreading, isStarted, isStarting, isStopped, isStopping, passivate, setEndpoint, start, stop, validate, validateConnection
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
createMuleMessage, createMuleMessage
connect, disconnect, isConnected, validateConnection
dispose
protected FlowConstruct flowConstruct
protected MessageProcessor listener
MessageProcessor
chain used to process messages once the transport
specific MessageReceiver
has received transport message and created
the MuleEvent
protected String receiverKey
protected List<Transformer> defaultInboundTransformers
protected List<Transformer> defaultResponseTransformers
protected ReplyToHandler replyToHandler
public AbstractMessageReceiver(Connector connector, FlowConstruct flowConstruct, InboundEndpoint endpoint) throws CreateException
connector
- the endpoint that created this listenerflowConstruct
- the flow construct to associate with the receiver.endpoint
- the provider contains the endpointUri on which the receiver
will listen on. The endpointUri can be anything and is specific to
the receiver implementation i.e. an email address, a directory, a
jms destination or port address.CreateException
FlowConstruct
,
InboundEndpoint
protected ConnectableLifecycleManager createLifecycleManager()
createLifecycleManager
in class AbstractTransportMessageHandler
public final void initialise() throws InitialisationException
InitialisationException
should be thrown,
causing the Mule instance to shutdown. If the error is recoverable, say by
retrying to connect, a RecoverableException
should be thrown.
There is no guarantee that by throwing a Recoverable exception that the Mule
instance will not shut down.initialise
in interface Initialisable
initialise
in class AbstractTransportMessageHandler
InitialisationException
- if a fatal error occurs
causing the Mule instance to shutdownRecoverableException
- if an error occurs that
can be recovered frompublic FlowConstruct getFlowConstruct()
getFlowConstruct
in interface MessageReceiver
public final MuleEvent routeMessage(MuleMessage message) throws MuleException
routeMessage
in interface MessageReceiver
MuleException
public final MuleEvent routeMessage(MuleMessage message, Transaction trans) throws MuleException
routeMessage
in interface MessageReceiver
MuleException
public final MuleEvent routeMessage(MuleMessage message, Transaction trans, OutputStream outputStream) throws MuleException
routeMessage
in interface MessageReceiver
MuleException
public final MuleEvent routeMessage(MuleMessage message, MuleSession session, Transaction trans, OutputStream outputStream) throws MuleException
MuleException
public final MuleEvent routeMessage(MuleMessage message, MuleSession session, OutputStream outputStream) throws MuleException
MuleException
protected void propagateRootMessageIdProperty(MuleMessage message)
protected void warnIfMuleClientSendUsed(MuleMessage message)
protected void applyInboundTransformers(MuleEvent event) throws MuleException
MuleException
protected void applyResponseTransformers(MuleEvent event) throws MuleException
MuleException
protected MuleMessage handleUnacceptedFilter(MuleMessage message)
protected MuleEvent createMuleEvent(MuleMessage message, OutputStream outputStream) throws MuleException
MuleException
public EndpointURI getEndpointURI()
MessageReceiver
getEndpointURI
in interface MessageReceiver
public String getConnectionDescription()
AbstractTransportMessageHandler
getConnectionDescription
in interface Connectable
getConnectionDescription
in class AbstractTransportMessageHandler
protected String getConnectEventId()
public void setReceiverKey(String receiverKey)
setReceiverKey
in interface MessageReceiver
public String getReceiverKey()
getReceiverKey
in interface MessageReceiver
public InboundEndpoint getEndpoint()
getEndpoint
in interface MessageReceiver
getEndpoint
in class AbstractTransportMessageHandler
public void setEndpoint(InboundEndpoint endpoint)
setEndpoint
in interface MessageReceiver
endpoint
- the endpoint to listen onImmutableEndpoint
protected WorkManager getWorkManager()
getWorkManager
in class AbstractTransportMessageHandler
public String toString()
toString
in class AbstractTransportMessageHandler
public void setListener(MessageProcessor processor)
MessageSource
setListener
in interface MessageSource
protected void doDispose()
doDispose
in class AbstractTransportMessageHandler
protected ReplyToHandler getReplyToHandler()
protected ExecutionTemplate<MuleEvent> createExecutionTemplate()
public boolean shouldConsumeInEveryNode()
protected final void connectHandler() throws Exception
connectHandler
in class AbstractTransportMessageHandler
Exception
protected final void doStartHandler() throws MuleException
doStartHandler
in class AbstractTransportMessageHandler
MuleException
protected void doStop() throws MuleException
doStop
in class AbstractTransportMessageHandler
MuleException
public MuleEvent routeEvent(MuleEvent muleEvent) throws MuleException
MuleException
protected void processMessage(MessageProcessTemplate messageProcessTemplate, MessageProcessContext messageProcessContext)
Copyright © 2003–2015 MuleSoft, Inc.. All rights reserved.