Class UFC_NB

All Implemented Interfaces:
Lifecycle

public class UFC_NB extends UFC
Non-blocking alternative to UFC.

JIRA: https://issues.redhat.com/browse/JGRP-2172

Since:
4.0.4
  • Field Details

    • max_queue_size

      protected int max_queue_size
    • send_function

      protected final Consumer<Message> send_function
    • credit_send_task

      protected Future<?> credit_send_task
  • Constructor Details

    • UFC_NB

      public UFC_NB()
  • Method Details

    • 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 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:
      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 UFC
    • handleDownMessage

      protected Object handleDownMessage(Message msg, int length)
      Overrides:
      handleDownMessage 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