Class MFC_NB

  • All Implemented Interfaces:
    Lifecycle

    public class MFC_NB
    extends MFC
    Non-blocking alternative to MFC.
    JIRA: JIRA: https://issues.redhat.com/browse/JGRP-2172
    Since:
    4.0.4
    Author:
    Bela Ban
    • Field Detail

      • max_queue_size

        protected int max_queue_size
      • send_function

        protected final java.util.function.Consumer<Message> send_function
      • credit_send_task

        protected java.util.concurrent.Future<?> credit_send_task
    • Constructor Detail

      • MFC_NB

        public MFC_NB()
    • Method Detail

      • getMaxQueueSize

        public int getMaxQueueSize()
      • setMaxQueueSize

        public MFC_NB setMaxQueueSize​(int s)
      • isQueuing

        public boolean isQueuing()
      • getNumberOfQueuedMessages

        public int getNumberOfQueuedMessages()
      • getQueuedSize

        public int getQueuedSize()
      • getNumberOfQueuings

        public int getNumberOfQueuings()
      • start

        public void start()
                   throws java.lang.Exception
        Description copied from class: Protocol
        This method is called on a JChannel.connect(String); starts work. Protocols are connected ready to receive events. Will be called from bottom to top.
        Specified by:
        start in interface Lifecycle
        Overrides:
        start in class FlowControl
        Throws:
        java.lang.Exception - Thrown if protocol cannot be started successfully. This will cause the ProtocolStack to fail, so JChannel.connect(String) will throw an exception
      • stop

        public void stop()
        Description copied from class: Protocol
        Called on a JChannel.disconnect(); stops work (e.g. by closing multicast socket). Will be called from top to bottom.
        Specified by:
        stop in interface Lifecycle
        Overrides:
        stop in class MFC
      • handleDownMessage

        protected java.lang.Object handleDownMessage​(Message msg,
                                                     int length)
        Overrides:
        handleDownMessage in class MFC
      • sendCreditRequestsIfNeeded

        protected void sendCreditRequestsIfNeeded()
        Checks the sent table: if some credits are in queueing mode and credits left are less than min_credits: send a credit request