Class SenderState

java.lang.Object
org.apache.catalina.tribes.transport.SenderState

public class SenderState extends Object
Tracks the delivery state of a sender associated with a cluster member.
  • Field Details

    • READY

      public static final int READY
      Sender is ready to transmit messages.
      See Also:
    • SUSPECT

      public static final int SUSPECT
      Sender has been suspected of failure but not yet confirmed.
      See Also:
    • FAILING

      public static final int FAILING
      Sender has failed and is unable to transmit messages.
      See Also:
    • memberStates

      protected static final ConcurrentMap<Member, SenderState> memberStates
      Registry of sender states for each cluster member.
  • Method Details

    • getSenderState

      public static SenderState getSenderState(Member member)
      Returns the SenderState for the given member, creating one if it does not exist.
      Parameters:
      member - the cluster member
      Returns:
      the sender state for the member
    • getSenderState

      public static SenderState getSenderState(Member member, boolean create)
      Returns the SenderState for the given member.
      Parameters:
      member - the cluster member
      create - if true, creates a new state when none exists
      Returns:
      the sender state, or null if not found and create is false
    • removeSenderState

      public static void removeSenderState(Member member)
      Removes the SenderState for the given member from the registry.
      Parameters:
      member - the cluster member whose state should be removed
    • isSuspect

      public boolean isSuspect()
      Returns true if the sender is in a suspect or failing state.
      Returns:
      true if the sender is not ready
    • setSuspect

      public void setSuspect()
      Sets the sender state to suspect.
    • isReady

      public boolean isReady()
      Returns true if the sender is ready to transmit messages.
      Returns:
      true if the sender is in the ready state
    • setReady

      public void setReady()
      Sets the sender state to ready.
    • isFailing

      public boolean isFailing()
      Returns true if the sender has failed.
      Returns:
      true if the sender is in the failing state
    • setFailing

      public void setFailing()
      Sets the sender state to failing.