Class SenderState


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

      Fields 
      Modifier and Type Field Description
      static int FAILING
      Sender has failed and is unable to transmit messages.
      protected static java.util.concurrent.ConcurrentMap<Member,​SenderState> memberStates
      Registry of sender states for each cluster member.
      static int READY
      Sender is ready to transmit messages.
      static int SUSPECT
      Sender has been suspected of failure but not yet confirmed.
    • Field Detail

      • READY

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

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

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

        protected static final java.util.concurrent.ConcurrentMap<Member,​SenderState> memberStates
        Registry of sender states for each cluster member.
    • Method Detail

      • 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.