org.mule.transport
Class AbstractMessageRequester
java.lang.Object
org.mule.transport.AbstractTransportMessageHandler
org.mule.transport.AbstractMessageRequester
- All Implemented Interfaces:
- Disposable, Initialisable, Lifecycle, LifecycleStateEnabled, Startable, Stoppable, Connectable, MessageRequester, MessageRequesting
- Direct Known Subclasses:
- AxisMessageRequester, FileMessageRequester, FtpMessageRequester, HttpClientMessageRequester, JdbcMessageRequester, JmsMessageRequester, RetrieveMessageRequester, SftpMessageRequester, TcpMessageRequester, UdpMessageRequester, UnsupportedMessageRequester, VMMessageRequester, XmppMessageRequester
public abstract class AbstractMessageRequester
- extends AbstractTransportMessageHandler
- implements MessageRequester
The Message Requester is used to explicitly request messages from a message channel or
resource rather than subscribing to inbound events or polling for messages.
This is often used programatically but will not be used for inbound endpoints
configured on services.
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, 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 |
AbstractMessageRequester
public AbstractMessageRequester(InboundEndpoint endpoint)
createLifecycleManager
protected ConnectableLifecycleManager createLifecycleManager()
- Specified by:
createLifecycleManager
in class AbstractTransportMessageHandler
initialise
public final void initialise()
throws InitialisationException
- Method used to perform any initialisation work. If a fatal error occurs during
initialisation an
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.
- Specified by:
initialise
in interface Initialisable
- Overrides:
initialise
in class AbstractTransportMessageHandler
- Throws:
InitialisationException
- if a fatal error occurs
causing the Mule instance to shutdown
RecoverableException
- if an error occurs that
can be recovered from
getRequesterName
protected String getRequesterName()
request
public final MuleMessage request(long timeout)
throws Exception
- Make a specific request to the underlying transport
- Specified by:
request
in interface MessageRequesting
- Parameters:
timeout
- the maximum time the operation should block before returning.
The call should return immediately if there is data available. If
no data becomes available before the timeout elapses, null will be
returned
- Returns:
- the result of the request wrapped in a MuleMessage object. Null will be
returned if no data was available
- Throws:
Exception
- if the call to the underlying protocol causes an exception
applyInboundTransformers
protected void applyInboundTransformers(MuleMessage message)
throws MuleException
- Throws:
MuleException
getWorkManager
protected WorkManager getWorkManager()
throws MuleException
- Specified by:
getWorkManager
in class AbstractTransportMessageHandler
- Throws:
MuleException
getEndpoint
public InboundEndpoint getEndpoint()
- Specified by:
getEndpoint
in interface MessageRequester
- Overrides:
getEndpoint
in class AbstractTransportMessageHandler
- Returns:
- the endpoint used for requesting events
doRequest
protected abstract MuleMessage doRequest(long timeout)
throws Exception
- Make a specific request to the underlying transport
- Parameters:
timeout
- the maximum time the operation should block before returning.
The call should return immediately if there is data available. If
no data becomes available before the timeout elapses, null will be
returned
- Returns:
- the result of the request wrapped in a MuleMessage object. Null will be
returned if no data was avaialable
- Throws:
Exception
- if the call to the underlying protocal cuases an exception
Copyright © 2003-2012 MuleSoft, Inc.. All Rights Reserved.