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
    Author:
    Bela Ban
    • Method Detail

      • init

        void init​(TP transport)
        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

        boolean 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:
      • loopback

        boolean loopback​(MessageBatch batch,
                         boolean oob)
      • process

        boolean 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:
      • process

        boolean 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: