Class MaxOneThreadPerSender.Entry

java.lang.Object
org.jgroups.util.MaxOneThreadPerSender.Entry
Enclosing class:
MaxOneThreadPerSender

protected class MaxOneThreadPerSender.Entry extends Object
  • Field Details

    • lock

      protected final Lock lock
    • running

      protected boolean running
    • mcast

      protected final boolean mcast
    • batch

      protected final MessageBatch batch
    • sender

      protected final Address sender
    • cluster_name

      protected final AsciiString cluster_name
    • submitted_msgs

      protected long submitted_msgs
    • submitted_batches

      protected long submitted_batches
    • queued_msgs

      protected long queued_msgs
    • queued_batches

      protected long queued_batches
  • Constructor Details

  • Method Details

    • reset

    • process

      protected boolean process(Message msg, boolean loopback)
    • process

      protected boolean process(MessageBatch batch)
    • submit

      protected boolean submit(Message msg, boolean loopback)
    • submit

      protected boolean submit(MessageBatch batch)
    • allowedToSubmitToThreadPool

      protected boolean allowedToSubmitToThreadPool(Message msg)
      Either allows access to submit a task to the thread pool for delivery to the application, or queues the message
      Parameters:
      msg - the message
      Returns:
      true if the message can be submitted to the thread pool, or false (msg was queued)
    • allowedToSubmitToThreadPool

      protected boolean allowedToSubmitToThreadPool(MessageBatch msg_batch)
    • workAvailable

      protected boolean workAvailable(MessageBatch msg_batch)
      Called by MaxOneThreadPerSender.BatchHandlerLoop. Atomically transfer messages from the entry's batch to this batch and returns true if messages were transferred. If not, sets running to false and returns false. In the latter case, the handler must terminate (or else, we could have multiple handler running).
      Parameters:
      msg_batch - the batch to which messages from this.batch should be transferred to.
    • setRunning

      protected void setRunning(boolean flag)
    • toString

      public String toString()
      Overrides:
      toString in class Object