Class UFC_NB


  • public class UFC_NB
    extends UFC
    Non-blocking alternative to UFC.
    JIRA: https://issues.jboss.org/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

      • UFC_NB

        public UFC_NB()
    • Method Detail

      • getMaxQueueSize

        public int getMaxQueueSize()
      • setMaxQueueSize

        public UFC_NB setMaxQueueSize​(int s)
      • getNumberOfQueuedMessages

        public int getNumberOfQueuedMessages()
      • getQueuedSize

        public int getQueuedSize()
      • getNumberOfQueuings

        public int getNumberOfQueuings()
      • isQueuingTo

        public boolean isQueuingTo​(Address dest)
      • getQueuedMessagesTo

        public int getQueuedMessagesTo​(Address dest)
      • 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 and queues are ready to receive events. Will be called from bottom to top. This call will replace the START and START_OK events.
        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
        This method is called on a JChannel.disconnect(). Stops work (e.g. by closing multicast socket). Will be called from top to bottom. This means that at the time of the method invocation the neighbor protocol below is still working. This method will replace the STOP, STOP_OK, CLEANUP and CLEANUP_OK events. The ProtocolStack guarantees that when this method is called all messages in the down queue will have been flushed
        Overrides:
        stop in class UFC
      • createCredit

        protected <T extends Credit> T createCredit​(int initial_credits)
        Overrides:
        createCredit in class UFC
      • 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