Package org.jgroups.stack
Interface MessageProcessingPolicy
- 
- All Known Implementing Classes:
- MaxOneThreadPerSender,- PassRegularMessagesUpDirectly,- SubmitToThreadPool,- UnbatchOOBBatches
 
 public interface MessageProcessingPolicyPolicy 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
- Author:
- Bela Ban
 
- 
- 
Method SummaryAll Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default voiddestroy()Called before the transport is stoppedvoidinit(TP transport)Called after creation.booleanloopback(Message msg, boolean oob)Process a message that was not received from the transport but from above (e.g.booleanloopback(MessageBatch batch, boolean oob)booleanprocess(Message msg, boolean oob)Process a message received from the transportbooleanprocess(MessageBatch batch, boolean oob)Process a batch received from the transportdefault voidreset()To reset stats
 
- 
- 
- 
Method Detail- 
initvoid init(TP transport) Called after creation. Implementations may want to cache the transport reference to get access to thread pools, message counters etc
 - 
resetdefault void reset() To reset stats
 - 
destroydefault void destroy() Called before the transport is stopped
 - 
loopbackboolean loopback(Message msg, boolean oob) 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:
 
 - 
loopbackboolean loopback(MessageBatch batch, boolean oob) 
 - 
processboolean process(Message msg, boolean oob) Process a message received from the transport- Parameters:
- msg- the message
- oob- true if the message is an OOB message
- Returns:
 
 - 
processboolean process(MessageBatch batch, boolean oob) Process a batch received from the transport- Parameters:
- batch- the batch
- oob- true if the batch contains only OOB messages
- Returns:
 
 
- 
 
-