S - the type of stateE - the type of eventpublic class EnsembleListenerAdapter<S,E> extends java.lang.Object implements EnsembleListener<S,E>
EnsembleListener implementing all
methods which extended implementation can override.| Constructor and Description |
|---|
EnsembleListenerAdapter() |
| Modifier and Type | Method and Description |
|---|---|
void |
ensembleError(StateMachineEnsembleException exception)
Called when
StateMachineEnsemble resulted an error. |
void |
ensembleLeaderGranted(StateMachine<S,E> stateMachine)
Called when a state machine is granted a leader role
in an ensemble.
|
void |
ensembleLeaderRevoked(StateMachine<S,E> stateMachine)
Called when a state machine is revoked from a leader role
in an ensemble.
|
void |
stateChanged(StateMachineContext<S,E> context)
Called when ensemble is discovering a state change.
|
void |
stateMachineJoined(StateMachine<S,E> stateMachine,
StateMachineContext<S,E> context)
Called when state machine joined an ensemble.
|
void |
stateMachineLeft(StateMachine<S,E> stateMachine,
StateMachineContext<S,E> context)
Called when state machine left an ensemble.
|
public void stateMachineJoined(StateMachine<S,E> stateMachine, StateMachineContext<S,E> context)
EnsembleListenerStateMachine who
requested a join. User of this listener should check that a
StateMachine is the one interested of. Implementation
may choose to notify other StateMachine joins if it is
able to do so. This may be called multiple time in case ensemble
has made a choice to leave machine due to ensemble errors.stateMachineJoined in interface EnsembleListener<S,E>stateMachine - the state machinecontext - the state machine contextpublic void stateMachineLeft(StateMachine<S,E> stateMachine, StateMachineContext<S,E> context)
EnsembleListenerStateMachine who
requested a leave. User of this listener should check that a
StateMachine is the one interested of. Implementation
may choose to notify other StateMachine leaves if it is
able to do so.stateMachineLeft in interface EnsembleListener<S,E>stateMachine - the state machinecontext - the state machine contextpublic void stateChanged(StateMachineContext<S,E> context)
EnsembleListenerstateChanged in interface EnsembleListener<S,E>context - the state machine contextpublic void ensembleError(StateMachineEnsembleException exception)
EnsembleListenerStateMachineEnsemble resulted an error.ensembleError in interface EnsembleListener<S,E>exception - the exceptionpublic void ensembleLeaderGranted(StateMachine<S,E> stateMachine)
EnsembleListenerensembleLeaderGranted in interface EnsembleListener<S,E>stateMachine - the state machinepublic void ensembleLeaderRevoked(StateMachine<S,E> stateMachine)
EnsembleListenerensembleLeaderRevoked in interface EnsembleListener<S,E>stateMachine - the state machine