Class MaxOneThreadPerSender

  • All Implemented Interfaces:
    MessageProcessingPolicy

    public class MaxOneThreadPerSender
    extends SubmitToThreadPool
    MessageProcessingPolicy which processes regular messages and message batches by assigning a max of 1 thread per message from the same sender. So if we have sender A, B, C and D, we'll have no more than 4 threads handling regular unicasts and 4 threads handling regular multicasts.

    See JGRP-2143 for details.

    Since:
    4.0
    Author:
    Bela Ban
    • Constructor Detail

      • MaxOneThreadPerSender

        public MaxOneThreadPerSender()
    • Method Detail

      • dump

        public java.lang.String dump()
      • destroy

        public void destroy()
        Description copied from interface: MessageProcessingPolicy
        Called before the transport is stopped
      • loopback

        public void loopback​(Message msg,
                             boolean oob,
                             boolean internal)
        Description copied from interface: MessageProcessingPolicy
        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.
        Specified by:
        loopback in interface MessageProcessingPolicy
        Overrides:
        loopback in class SubmitToThreadPool
        Parameters:
        msg - the message to be looped back up the stack.
        oob - true if the message is an OOB message
        internal - true if the message is internal
      • process

        public void process​(MessageBatch batch,
                            boolean oob,
                            boolean internal)
        Description copied from interface: MessageProcessingPolicy
        Process a batch received from the transport
        Specified by:
        process in interface MessageProcessingPolicy
        Overrides:
        process in class SubmitToThreadPool
        Parameters:
        batch - the batch
        oob - true if the batch contains only OOB messages
        internal - true if the batch contains only internal messages (or internal and OOB messages)
      • viewChange

        public void viewChange​(java.util.List<Address> members)