|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.mule.providers.AbstractMessageDispatcher
AbstractMessageDispatcher provides a default dispatch (client)
support for handling threads lifecycle and validation.
| Field Summary | |
protected WaitableBoolean |
connected
|
protected ConnectionStrategy |
connectionStrategy
|
protected AbstractConnector |
connector
|
protected boolean |
disposed
|
protected boolean |
doThreading
|
protected UMOImmutableEndpoint |
endpoint
|
protected Log |
logger
logger used by this class |
protected UMOWorkManager |
workManager
Thread pool of Connector sessions |
| Fields inherited from interface org.mule.umo.provider.UMOMessageDispatcher |
RECEIVE_NO_WAIT, RECEIVE_WAIT_INDEFINITELY |
| Constructor Summary | |
AbstractMessageDispatcher(UMOImmutableEndpoint endpoint)
|
|
| Method Summary | |
void |
connect()
Make the connection to the underlying transport. |
void |
disconnect()
Disconnect the from the underlying transport |
void |
dispatch(UMOEvent event)
Dispatches an event from the endpoint to the external system |
void |
dispose()
Template method to destroy any resources held by the Message Dispatcher |
protected abstract void |
doConnect(UMOImmutableEndpoint endpoint)
|
protected abstract void |
doDisconnect()
|
protected abstract void |
doDispatch(UMOEvent event)
|
protected abstract void |
doDispose()
|
protected abstract UMOMessage |
doReceive(UMOImmutableEndpoint endpoint,
long timeout)
Make a specific request to the underlying transport |
protected abstract UMOMessage |
doSend(UMOEvent event)
|
void |
exceptionThrown(Exception e)
|
protected String |
getConnectEventId(UMOImmutableEndpoint endpoint)
|
String |
getConnectionDescription()
Returns a string identifying the underlying resource |
UMOConnector |
getConnector()
Gets the connector for this dispatcher |
OutputStream |
getOutputStream(UMOImmutableEndpoint endpoint,
UMOMessage message)
Well get the output stream (if any) for this type of transport. |
boolean |
isConnected()
Determines if this object is connected or not |
boolean |
isDisposed()
Determines if this dispatcher has been disposed. |
protected boolean |
isTransactionRollback()
Checks to see if the current transaction has been rolled back |
UMOMessage |
receive(UMOEndpointURI endpointUri,
long timeout)
Make a specific request to the underlying transport |
UMOMessage |
receive(UMOImmutableEndpoint endpoint,
long timeout)
Make a specific request to the underlying transport |
void |
reconnect()
|
UMOMessage |
send(UMOEvent event)
Sends an event from the endpoint to the external system |
protected boolean |
useRemoteSync(UMOEvent event)
RemoteSync causes the message dispatch to wait for a response to an event on a response channel after it sends the event. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.mule.umo.provider.UMOMessageDispatcher |
getDelegateSession |
| Field Detail |
protected transient Log logger
protected UMOWorkManager workManager
protected final UMOImmutableEndpoint endpoint
protected final AbstractConnector connector
protected boolean disposed
protected boolean doThreading
protected ConnectionStrategy connectionStrategy
protected final WaitableBoolean connected
| Constructor Detail |
public AbstractMessageDispatcher(UMOImmutableEndpoint endpoint)
| Method Detail |
public final void dispatch(UMOEvent event)
throws DispatchException
UMOMessageDispatcher
dispatch in interface UMOMessageDispatcherevent - The event to dispatch
DispatchException - if the event fails to be dispatched
public final UMOMessage send(UMOEvent event)
throws DispatchException
UMOMessageDispatcher
send in interface UMOMessageDispatcherevent - The event to send
DispatchException - if the event fails to be dispatched
public final UMOMessage receive(UMOEndpointURI endpointUri,
long timeout)
throws Exception
receive in interface UMOMessageDispatcherendpointUri - the endpoint URI to use when connecting to the resourcetimeout - 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
Exception - if the call to the underlying protocal cuases an exception
//@deprecated Use receive(UMOImmutableEndpoint endpoint, long
timeout)
public final UMOMessage receive(UMOImmutableEndpoint endpoint,
long timeout)
throws Exception
receive in interface UMOMessageDispatcherendpoint - the endpoint to use when connecting to the resourcetimeout - 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
Exception - if the call to the underlying protocal cuases an exceptionpublic void exceptionThrown(Exception e)
exceptionThrown in interface ExceptionListenerpublic final boolean isDisposed()
UMOMessageDispatcher
isDisposed in interface UMOMessageDispatcherpublic final void dispose()
dispose in interface Disposablepublic UMOConnector getConnector()
UMOMessageDispatcher
getConnector in interface UMOMessageDispatcherprotected boolean useRemoteSync(UMOEvent event)
event - the current event
public OutputStream getOutputStream(UMOImmutableEndpoint endpoint,
UMOMessage message)
throws UMOException
getOutputStream in interface UMOMessageDispatcherendpoint - the endpoint that releates to this Dispatchermessage - the current message being processed
UMOException
public void connect()
throws Exception
UMOConnectable
connect in interface UMOConnectableException
public void disconnect()
throws Exception
UMOConnectable
disconnect in interface UMOConnectableExceptionprotected String getConnectEventId(UMOImmutableEndpoint endpoint)
public final boolean isConnected()
UMOConnectable
isConnected in interface UMOConnectablepublic String getConnectionDescription()
getConnectionDescription in interface UMOConnectable
public void reconnect()
throws Exception
Exceptionprotected abstract void doDispose()
protected abstract void doDispatch(UMOEvent event)
throws Exception
Exception
protected abstract UMOMessage doSend(UMOEvent event)
throws Exception
Exception
protected abstract void doConnect(UMOImmutableEndpoint endpoint)
throws Exception
Exception
protected abstract void doDisconnect()
throws Exception
Exception
protected abstract UMOMessage doReceive(UMOImmutableEndpoint endpoint,
long timeout)
throws Exception
endpoint - the endpoint to use when connecting to the resourcetimeout - 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
Exception - if the call to the underlying protocal cuases an exceptionprotected boolean isTransactionRollback()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||