Class SenderState
java.lang.Object
org.apache.catalina.tribes.transport.SenderState
Tracks the delivery state of a sender associated with a cluster member.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intSender has failed and is unable to transmit messages.protected static final ConcurrentMap<Member, SenderState> Registry of sender states for each cluster member.static final intSender is ready to transmit messages.static final intSender has been suspected of failure but not yet confirmed. -
Method Summary
Modifier and TypeMethodDescriptionstatic SenderStategetSenderState(Member member) Returns theSenderStatefor the given member, creating one if it does not exist.static SenderStategetSenderState(Member member, boolean create) Returns theSenderStatefor the given member.booleanReturnstrueif the sender has failed.booleanisReady()Returnstrueif the sender is ready to transmit messages.booleanReturnstrueif the sender is in a suspect or failing state.static voidremoveSenderState(Member member) Removes theSenderStatefor the given member from the registry.voidSets the sender state to failing.voidsetReady()Sets the sender state to ready.voidSets the sender state to suspect.
-
Field Details
-
READY
public static final int READYSender is ready to transmit messages.- See Also:
-
SUSPECT
public static final int SUSPECTSender has been suspected of failure but not yet confirmed.- See Also:
-
FAILING
public static final int FAILINGSender has failed and is unable to transmit messages.- See Also:
-
memberStates
Registry of sender states for each cluster member.
-
-
Method Details
-
getSenderState
Returns theSenderStatefor the given member, creating one if it does not exist.- Parameters:
member- the cluster member- Returns:
- the sender state for the member
-
getSenderState
Returns theSenderStatefor the given member.- Parameters:
member- the cluster membercreate- iftrue, creates a new state when none exists- Returns:
- the sender state, or
nullif not found and create isfalse
-
removeSenderState
Removes theSenderStatefor the given member from the registry.- Parameters:
member- the cluster member whose state should be removed
-
isSuspect
public boolean isSuspect()Returnstrueif the sender is in a suspect or failing state.- Returns:
trueif the sender is not ready
-
setSuspect
public void setSuspect()Sets the sender state to suspect. -
isReady
public boolean isReady()Returnstrueif the sender is ready to transmit messages.- Returns:
trueif the sender is in the ready state
-
setReady
public void setReady()Sets the sender state to ready. -
isFailing
public boolean isFailing()Returnstrueif the sender has failed.- Returns:
trueif the sender is in the failing state
-
setFailing
public void setFailing()Sets the sender state to failing.
-