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, retryTemplatePHASE_NAMEPHASE_NAMEPHASE_NAMEPHASE_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, validateConnectionclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitcreateMuleMessage, createMuleMessageconnect, disconnect, isConnected, validateConnectiondisposeprotected FlowConstruct flowConstruct
protected MessageProcessor listener
MessageProcessor chain used to process messages once the transport
specific MessageReceiver has received transport message and created
the MuleEventprotected 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.CreateExceptionFlowConstruct,
InboundEndpointprotected ConnectableLifecycleManager createLifecycleManager()
createLifecycleManager in class AbstractTransportMessageHandlerpublic 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 Initialisableinitialise in class AbstractTransportMessageHandlerInitialisationException - 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 MessageReceiverpublic final MuleEvent routeMessage(MuleMessage message) throws MuleException
routeMessage in interface MessageReceiverMuleExceptionpublic final MuleEvent routeMessage(MuleMessage message, Transaction trans) throws MuleException
routeMessage in interface MessageReceiverMuleExceptionpublic final MuleEvent routeMessage(MuleMessage message, Transaction trans, OutputStream outputStream) throws MuleException
routeMessage in interface MessageReceiverMuleExceptionpublic final MuleEvent routeMessage(MuleMessage message, MuleSession session, Transaction trans, OutputStream outputStream) throws MuleException
MuleExceptionpublic final MuleEvent routeMessage(MuleMessage message, MuleSession session, OutputStream outputStream) throws MuleException
MuleExceptionprotected void propagateRootMessageIdProperty(MuleMessage message)
protected void warnIfMuleClientSendUsed(MuleMessage message)
protected void applyInboundTransformers(MuleEvent event) throws MuleException
MuleExceptionprotected void applyResponseTransformers(MuleEvent event) throws MuleException
MuleExceptionprotected MuleMessage handleUnacceptedFilter(MuleMessage message)
protected MuleEvent createMuleEvent(MuleMessage message, OutputStream outputStream) throws MuleException
MuleExceptionpublic EndpointURI getEndpointURI()
MessageReceivergetEndpointURI in interface MessageReceiverpublic String getConnectionDescription()
AbstractTransportMessageHandlergetConnectionDescription in interface ConnectablegetConnectionDescription in class AbstractTransportMessageHandlerprotected String getConnectEventId()
public void setReceiverKey(String receiverKey)
setReceiverKey in interface MessageReceiverpublic String getReceiverKey()
getReceiverKey in interface MessageReceiverpublic InboundEndpoint getEndpoint()
getEndpoint in interface MessageReceivergetEndpoint in class AbstractTransportMessageHandlerpublic void setEndpoint(InboundEndpoint endpoint)
setEndpoint in interface MessageReceiverendpoint - the endpoint to listen onImmutableEndpointprotected WorkManager getWorkManager()
getWorkManager in class AbstractTransportMessageHandlerpublic String toString()
toString in class AbstractTransportMessageHandlerpublic void setListener(MessageProcessor processor)
MessageSourcesetListener in interface MessageSourceprotected void doDispose()
doDispose in class AbstractTransportMessageHandlerprotected ReplyToHandler getReplyToHandler()
protected ExecutionTemplate<MuleEvent> createExecutionTemplate()
public boolean shouldConsumeInEveryNode()
protected final void connectHandler()
throws Exception
connectHandler in class AbstractTransportMessageHandlerExceptionprotected final void doStartHandler()
throws MuleException
doStartHandler in class AbstractTransportMessageHandlerMuleExceptionprotected void doStop()
throws MuleException
doStop in class AbstractTransportMessageHandlerMuleExceptionpublic MuleEvent routeEvent(MuleEvent muleEvent) throws MuleException
MuleExceptionprotected void processMessage(MessageProcessTemplate messageProcessTemplate, MessageProcessContext messageProcessContext)
Copyright © 2003–2015 MuleSoft, Inc.. All rights reserved.