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<Object> |
messages |
protected OutputStream |
out |
protected AbstractMessageReceiver |
receiver |
Constructor and Description |
---|
AbstractReceiverWorker(List<Object> messages,
AbstractMessageReceiver receiver) |
AbstractReceiverWorker(List<Object> 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() |
protected List<Object> |
handleEventResults(List<MuleEvent> events) |
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(MuleMessage 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 |
processMessages()
The actual logic used to receive messages from the underlying transport.
|
void |
release()
This method is called once this worker is no longer required.
|
void |
run()
|
protected InboundEndpoint endpoint
protected AbstractMessageReceiver receiver
protected OutputStream out
public AbstractReceiverWorker(List<Object> messages, AbstractMessageReceiver receiver)
public AbstractReceiverWorker(List<Object> messages, AbstractMessageReceiver receiver, OutputStream out)
protected void doRun()
public void processMessages() throws Exception
Exception
protected List<Object> handleEventResults(List<MuleEvent> events) throws Exception
Exception
protected void preRouteMuleMessage(MuleMessage 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 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–2016 MuleSoft, Inc.. All rights reserved.