public abstract class AbstractReceiverWorker extends Object implements javax.resource.spi.work.Work
MessageReceiver
implementations.Modifier and Type | Field and Description |
---|---|
protected InboundEndpoint |
endpoint |
protected List |
messages |
protected OutputStream |
out |
protected AbstractMessageReceiver |
receiver |
Constructor and Description |
---|
AbstractReceiverWorker(List messages,
AbstractMessageReceiver receiver) |
AbstractReceiverWorker(List messages,
AbstractMessageReceiver receiver,
OutputStream out) |
Modifier and Type | Method and Description |
---|---|
protected abstract void |
bindTransaction(Transaction tx)
Template method used to bind the resources of this receiver to the transaction.
|
protected void |
doRun()
The actual logic used to receive messages from the underlying transport.
|
protected void |
handleException(Exception e)
A conveniece method that passes the exception to the connector's ExceptionListener
|
protected void |
handleResults(List messages)
When Mule has finished processing the current messages, there may be zero or more messages to process
by the receiver if request/response messaging is being used.
|
protected MuleMessage |
postProcessMessage(MuleMessage message)
If a result is returned back this method will get called before the message is added to te list of
results (these are later passed to
handleResults(java.util.List) ) |
protected Object |
preProcessMessage(Object message)
Before a message is passed into Mule this callback is called and can be used by the worker to inspect the
message before it gets sent to Mule
|
protected void |
preRouteMuleMessage(DefaultMuleMessage message)
This callback is called before a message is routed into Mule and can be used by the worker to set connection
specific properties to message before it gets routed
|
void |
release()
This method is called once this worker is no longer required.
|
void |
run()
|
protected List messages
protected InboundEndpoint endpoint
protected AbstractMessageReceiver receiver
protected OutputStream out
public AbstractReceiverWorker(List messages, AbstractMessageReceiver receiver)
public AbstractReceiverWorker(List messages, AbstractMessageReceiver receiver, OutputStream out)
protected void doRun()
protected void preRouteMuleMessage(DefaultMuleMessage message) throws Exception
message
- the next message to be processedException
protected abstract void bindTransaction(Transaction tx) throws TransactionException
tx
- the current transaction or null if there is no transactionTransactionException
protected void handleException(Exception e)
e
- protected void handleResults(List messages) throws Exception
messages
- a list of messages. This argument will not be nullException
protected Object preProcessMessage(Object message) throws Exception
message
- the next message to be processedException
protected MuleMessage postProcessMessage(MuleMessage message) throws Exception
handleResults(java.util.List)
)message
- the result message, this will never be nullException
public void release()
release
in interface javax.resource.spi.work.Work
Copyright © 2003–2013 MuleSource, Inc.. All rights reserved.