public abstract class QueuedConversation extends Conversation
Derivatives need to provide an executor, via getExecutor() method, and processing logic, via processMessage() method. If messages need to be processed in the same order as they are accepted, it is up to the derivative to supply an executor that will execute processing sequentially.
Modifier | Constructor and Description |
---|---|
protected |
QueuedConversation(String topic,
int id,
int parentId,
Executor executor)
Create a new queued dispatch conversation with the supplied id and
topic.
|
Modifier and Type | Method and Description |
---|---|
void |
acceptMessage(byte[] message)
Accept a byte form of a message in the context of a given conversation.
|
Executor |
executor()
Get the executor to be used for processing messages.
|
List<Throwable> |
getProcessingErrors()
Return the list of errors intercepted as part of asynchronous message
processing.
|
abstract void |
processMessage(byte[] message)
Process message, possibly asynchronously in the context of the executor
supplied by getExecutor() method.
|
connection, equals, hashCode, id, isEnded, parentId, setConnection, topic
protected QueuedConversation(String topic, int id, int parentId, Executor executor)
topic
- conversation topicid
- unique conversation idparentId
- unique conversation id of the parent conversation; 0 if
no parent conversationexecutor
- executor for processing messagespublic final void acceptMessage(byte[] message)
Conversation
acceptMessage
in class Conversation
message
- byte buffer containing the raw messagepublic Executor executor()
public abstract void processMessage(byte[] message)
message
- message to be processedCopyright © 2015. All Rights Reserved.