Package org.jgroups.stack
Interface MessageProcessingPolicy
- All Known Implementing Classes:
MaxOneThreadPerSender,PassRegularMessagesUpDirectly,SubmitToThreadPool,UnbatchOOBBatches
public interface MessageProcessingPolicy
Policy which decides how to process a received message or message batch. Example: pass the message or batch to
the thread pool (default impl), or pass only one (unicast and mulicast) message per sender to the thread pool at a
time and queue others from the same sender.
- Since:
- 4.0
-
Method Summary
Modifier and TypeMethodDescriptiondefault voiddestroy()Called before the transport is stoppedvoidCalled after creation.booleanProcess a message that was not received from the transport but from above (e.g.booleanProcess a message received from the transportbooleanprocess(MessageBatch batch, boolean oob) Process a batch received from the transportdefault voidreset()To reset stats
-
Method Details
-
init
Called after creation. Implementations may want to cache the transport reference to get access to thread pools, message counters etc -
reset
default void reset()To reset stats -
destroy
default void destroy()Called before the transport is stopped -
loopback
Process a message that was not received from the transport but from above (e.g. the channel or a protocol), and needs to be looped back up because (1) the destination address is null (every multicast message is looped back) or (2) the destination address is the sender's address (unicast message to self).A message that is looped back can bypass cluster name matching.
- Parameters:
msg- the message to be looped back up the stack.oob- true if the message is an OOB message- Returns:
-
process
Process a message received from the transport- Parameters:
msg- the messageoob- true if the message is an OOB message- Returns:
-
process
Process a batch received from the transport- Parameters:
batch- the batchoob- true if the batch contains only OOB messages- Returns:
-