protected class TcpMessageReceiver.TcpWorker extends AbstractReceiverResourceWorker implements Disposable, Expirable
Modifier and Type | Field and Description |
---|---|
protected TcpInputStream |
dataIn |
protected boolean |
dataInWorkFinished |
protected OutputStream |
dataOut |
protected Object |
notify |
protected TcpProtocol |
protocol |
protected Socket |
socket |
protected InputStream |
underlyingIn |
resource
endpoint, messages, out, receiver
PHASE_NAME
Constructor and Description |
---|
TcpMessageReceiver.TcpWorker(Socket socket,
AbstractMessageReceiver receiver) |
Modifier and Type | Method and Description |
---|---|
protected void |
bindTransaction(Transaction tx)
Template method used to bind the resources of this receiver to the transaction.
|
void |
dispose()
A lifecycle method where implementor should free up any resources.
|
void |
expired() |
protected Object |
getNextMessage(Object resource)
The method used to read the next message from the underlying transport.
|
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 boolean |
hasMoreMessages(Object message) |
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 |
release()
This method is called once this worker is no longer required.
|
protected void |
shutdownSocket() |
doRun
handleEventResults, postProcessMessage, preProcessMessage, processMessages, run
protected Socket socket
protected TcpInputStream dataIn
protected InputStream underlyingIn
protected OutputStream dataOut
protected TcpProtocol protocol
protected boolean dataInWorkFinished
protected Object notify
public TcpMessageReceiver.TcpWorker(Socket socket, AbstractMessageReceiver receiver) throws IOException
IOException
public void dispose()
Disposable
dispose
in interface Disposable
public void release()
AbstractReceiverWorker
release
in interface javax.resource.spi.work.Work
release
in class AbstractReceiverWorker
protected void shutdownSocket() throws IOException
IOException
protected void bindTransaction(Transaction tx) throws TransactionException
AbstractReceiverWorker
bindTransaction
in class AbstractReceiverWorker
tx
- the current transaction or null if there is no transactionTransactionException
protected Object getNextMessage(Object resource) throws Exception
AbstractReceiverResourceWorker
getNextMessage
in class AbstractReceiverResourceWorker
resource
- the resource to read from, this may be a socket, a directory or some higher level
representation.Exception
protected boolean hasMoreMessages(Object message)
hasMoreMessages
in class AbstractReceiverResourceWorker
protected void handleResults(List messages) throws Exception
AbstractReceiverWorker
handleResults
in class AbstractReceiverWorker
messages
- a list of messages. This argument will not be nullException
protected void preRouteMuleMessage(MuleMessage message) throws Exception
AbstractReceiverWorker
preRouteMuleMessage
in class AbstractReceiverWorker
message
- the next message to be processedException
Copyright © 2003–2016 MuleSoft, Inc.. All rights reserved.