S
- the type of stateE
- the type of eventpublic interface EnsembleListener<S,E>
EnsembleListener
for various ensemble events.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.
|
void stateMachineJoined(StateMachine<S,E> stateMachine, StateMachineContext<S,E> context)
StateMachine
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.stateMachine
- the state machinecontext
- the state machine contextvoid stateMachineLeft(StateMachine<S,E> stateMachine, StateMachineContext<S,E> context)
StateMachine
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.stateMachine
- the state machinecontext
- the state machine contextvoid stateChanged(StateMachineContext<S,E> context)
context
- the state machine contextvoid ensembleError(StateMachineEnsembleException exception)
StateMachineEnsemble
resulted an error.exception
- the exceptionvoid ensembleLeaderGranted(StateMachine<S,E> stateMachine)
stateMachine
- the state machinevoid ensembleLeaderRevoked(StateMachine<S,E> stateMachine)
stateMachine
- the state machine