|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.mule.transport.AbstractMessageReceiver
public abstract class AbstractMessageReceiver
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.
Field Summary | |
---|---|
protected WaitableBoolean |
connected
|
protected edu.emory.mathcs.backport.java.util.concurrent.atomic.AtomicBoolean |
connecting
|
protected ConnectionStrategy |
connectionStrategy
|
protected AbstractConnector |
connector
the connector associated with this receiver |
protected edu.emory.mathcs.backport.java.util.concurrent.atomic.AtomicBoolean |
disposing
|
protected InboundEndpoint |
endpoint
The endpoint descriptor which is associated with this receiver |
protected Log |
logger
logger used by this class |
protected String |
receiverKey
Stores the key to this receiver, as used by the Connector to store the receiver. |
protected boolean |
responseEndpoint
|
protected Service |
service
The Service with which this receiver is associated with |
protected WaitableBoolean |
stopped
|
Fields inherited from interface org.mule.api.lifecycle.Initialisable |
---|
PHASE_NAME |
Fields inherited from interface org.mule.api.lifecycle.Startable |
---|
PHASE_NAME |
Fields inherited from interface org.mule.api.lifecycle.Stoppable |
---|
PHASE_NAME |
Fields inherited from interface org.mule.api.lifecycle.Disposable |
---|
PHASE_NAME |
Constructor Summary | |
---|---|
AbstractMessageReceiver(Connector connector,
Service service,
InboundEndpoint endpoint)
Creates the Message Receiver |
Method Summary | |
---|---|
void |
connect()
Make the connection to the underlying transport. |
void |
disconnect()
Disconnect the from the underlying transport |
void |
dispose()
A lifecycle method where implementor should free up any resources. |
protected abstract void |
doConnect()
|
protected abstract void |
doDisconnect()
|
protected abstract void |
doDispose()
|
protected void |
doInitialise()
|
protected abstract void |
doStart()
|
protected abstract void |
doStop()
|
protected String |
getConnectEventId()
|
String |
getConnectionDescription()
Returns a string identifying the underlying resource |
Connector |
getConnector()
|
InboundEndpoint |
getEndpoint()
|
EndpointURI |
getEndpointURI()
The endpointUri that this receiver listens on |
InternalMessageListener |
getListener()
|
String |
getReceiverKey()
|
Service |
getService()
|
protected WorkManager |
getWorkManager()
|
void |
handleException(Exception exception)
|
protected MuleMessage |
handleUnacceptedFilter(MuleMessage message)
|
void |
initialise()
Method used to perform any initialisation work. |
boolean |
isConnected()
Determines if this object is connected or not |
MuleMessage |
routeMessage(MuleMessage message)
|
MuleMessage |
routeMessage(MuleMessage message,
boolean synchronous)
|
MuleMessage |
routeMessage(MuleMessage message,
boolean synchronous,
OutputStream outputStream)
|
MuleMessage |
routeMessage(MuleMessage message,
OutputStream outputStream)
|
MuleMessage |
routeMessage(MuleMessage message,
Transaction trans,
boolean synchronous)
|
MuleMessage |
routeMessage(MuleMessage message,
Transaction trans,
boolean synchronous,
OutputStream outputStream)
|
void |
setConnector(Connector connector)
|
void |
setEndpoint(InboundEndpoint endpoint)
|
protected void |
setExceptionDetails(MuleMessage message,
Throwable exception)
This method is used to set any additional aand possibly transport specific information on the return message where it has an exception payload. |
void |
setListener(InternalMessageListener listener)
|
void |
setReceiverKey(String receiverKey)
|
void |
setService(Service service)
|
protected void |
setWorkManager(WorkManager workManager)
|
void |
start()
|
void |
stop()
|
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected final Log logger
protected Service service
protected InboundEndpoint endpoint
protected AbstractConnector connector
protected final edu.emory.mathcs.backport.java.util.concurrent.atomic.AtomicBoolean disposing
protected final WaitableBoolean connected
protected final WaitableBoolean stopped
protected final edu.emory.mathcs.backport.java.util.concurrent.atomic.AtomicBoolean connecting
protected String receiverKey
protected ConnectionStrategy connectionStrategy
protected boolean responseEndpoint
Constructor Detail |
---|
public AbstractMessageReceiver(Connector connector, Service service, InboundEndpoint endpoint) throws CreateException
connector
- the endpoint that created this listenerservice
- the service to associate with the receiver. When data is
received the service dispatchEvent
or
sendEvent
is used to dispatch the data to the
relivant UMO.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
Service
,
InboundEndpoint
Method Detail |
---|
public 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
InitialisationException
- if a fatal error occurs causing the Mule
instance to shutdown
RecoverableException
- if an error occurs that can be recovered frompublic InboundEndpoint getEndpoint()
getEndpoint
in interface MessageReceiver
public void handleException(Exception exception)
protected void setExceptionDetails(MuleMessage message, Throwable exception)
message
- exception
- public Connector getConnector()
getConnector
in interface MessageReceiver
public void setConnector(Connector connector)
setConnector
in interface MessageReceiver
public Service getService()
getService
in interface MessageReceiver
public final MuleMessage routeMessage(MuleMessage message) throws MuleException
routeMessage
in interface MessageReceiver
MuleException
public final MuleMessage routeMessage(MuleMessage message, boolean synchronous) throws MuleException
routeMessage
in interface MessageReceiver
MuleException
public final MuleMessage routeMessage(MuleMessage message, Transaction trans, boolean synchronous) throws MuleException
routeMessage
in interface MessageReceiver
MuleException
public final MuleMessage routeMessage(MuleMessage message, OutputStream outputStream) throws MuleException
routeMessage
in interface MessageReceiver
MuleException
public final MuleMessage routeMessage(MuleMessage message, boolean synchronous, OutputStream outputStream) throws MuleException
routeMessage
in interface MessageReceiver
MuleException
public final MuleMessage routeMessage(MuleMessage message, Transaction trans, boolean synchronous, OutputStream outputStream) throws MuleException
routeMessage
in interface MessageReceiver
MuleException
protected MuleMessage handleUnacceptedFilter(MuleMessage message)
public void setEndpoint(InboundEndpoint endpoint)
setEndpoint
in interface MessageReceiver
endpoint
- the endpoint to listen onImmutableEndpoint
public void setService(Service service)
setService
in interface MessageReceiver
service
- the service to associate with the receiver. When data is
received the service dispatchEvent
or
sendEvent
is used to dispatch the data to the
relivant UMO.public final void dispose()
Disposable
dispose
in interface Disposable
public EndpointURI getEndpointURI()
MessageReceiver
getEndpointURI
in interface MessageReceiver
protected WorkManager getWorkManager()
protected void setWorkManager(WorkManager workManager)
public void connect() throws Exception
Connectable
connect
in interface Connectable
Exception
public void disconnect() throws Exception
Connectable
disconnect
in interface Connectable
Exception
public String getConnectionDescription()
Connectable
getConnectionDescription
in interface Connectable
public final void start() throws MuleException
start
in interface Startable
MuleException
public final void stop()
stop
in interface Stoppable
public final boolean isConnected()
Connectable
isConnected
in interface Connectable
public InternalMessageListener getListener()
public void setListener(InternalMessageListener listener)
protected String getConnectEventId()
public void setReceiverKey(String receiverKey)
setReceiverKey
in interface MessageReceiver
public String getReceiverKey()
getReceiverKey
in interface MessageReceiver
public String toString()
toString
in class Object
protected void doInitialise() throws InitialisationException
InitialisationException
protected abstract void doStart() throws MuleException
MuleException
protected abstract void doStop() throws MuleException
MuleException
protected abstract void doConnect() throws Exception
Exception
protected abstract void doDisconnect() throws Exception
Exception
protected abstract void doDispose()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |