org.mule.transport
Class AbstractReceiverResourceWorker
java.lang.Object
org.mule.transport.AbstractReceiverWorker
org.mule.transport.AbstractReceiverResourceWorker
- All Implemented Interfaces:
- java.lang.Runnable, javax.resource.spi.work.Work
- Direct Known Subclasses:
- TcpMessageReceiver.TcpWorker
public abstract class AbstractReceiverResourceWorker
- extends AbstractReceiverWorker
This is a Message receiver worker used by transports that do not have a way for the underlying transport
to call back to the receiver when a message is available such as Jms. This worker provides a
callback getNextMessage(Object)
where the receiver can read the next message from the underlying
transport.
Field Summary |
protected java.lang.Object |
resource
|
Method Summary |
void |
doRun()
The actual logic used to receive messages from the underlying transport. |
protected abstract java.lang.Object |
getNextMessage(java.lang.Object resource)
The method used to read the next message from the underlying transport. |
protected boolean |
hasMoreMessages(java.lang.Object message)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
resource
protected java.lang.Object resource
AbstractReceiverResourceWorker
public AbstractReceiverResourceWorker(java.lang.Object resource,
AbstractMessageReceiver receiver)
AbstractReceiverResourceWorker
public AbstractReceiverResourceWorker(java.lang.Object resource,
AbstractMessageReceiver receiver,
java.io.OutputStream out)
doRun
public void doRun()
- Description copied from class:
AbstractReceiverWorker
- The actual logic used to receive messages from the underlying transport. The default implementation
will execute the processing of messages within a TransactionTemplate. This template will manage the
transaction lifecycle for the list of messages associated with this receiver worker.
- Overrides:
doRun
in class AbstractReceiverWorker
hasMoreMessages
protected boolean hasMoreMessages(java.lang.Object message)
getNextMessage
protected abstract java.lang.Object getNextMessage(java.lang.Object resource)
throws java.lang.Exception
- The method used to read the next message from the underlying transport.
- Parameters:
resource
- the resource to read from, this may be a socket, a directory or some higher level
representation.
- Returns:
- the message read from the resource. This can be raw data such as a byte[].
- Throws:
java.lang.Exception
Copyright © 2003-2010 MuleSoft, Inc.. All Rights Reserved.