Class EnsembleListenerAdapter<S,E>
java.lang.Object
org.springframework.statemachine.ensemble.EnsembleListenerAdapter<S,E>
- Type Parameters:
S
- the type of stateE
- the type of event
- All Implemented Interfaces:
EnsembleListener<S,
E>
Adapter implementation of
EnsembleListener
implementing all
methods which extended implementation can override.- Author:
- Janne Valkealahti
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
ensembleError
(StateMachineEnsembleException exception) Called whenStateMachineEnsemble
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.
-
Constructor Details
-
EnsembleListenerAdapter
public EnsembleListenerAdapter()
-
-
Method Details
-
stateMachineJoined
Description copied from interface:EnsembleListener
Called when state machine joined an ensemble. This callback is guaranteed to be called for aStateMachine
who requested a join. User of this listener should check that aStateMachine
is the one interested of. Implementation may choose to notify otherStateMachine
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.- Specified by:
stateMachineJoined
in interfaceEnsembleListener<S,
E> - Parameters:
stateMachine
- the state machinecontext
- the state machine context
-
stateMachineLeft
Description copied from interface:EnsembleListener
Called when state machine left an ensemble. This callback is guaranteed to be called for aStateMachine
who requested a leave. User of this listener should check that aStateMachine
is the one interested of. Implementation may choose to notify otherStateMachine
leaves if it is able to do so.- Specified by:
stateMachineLeft
in interfaceEnsembleListener<S,
E> - Parameters:
stateMachine
- the state machinecontext
- the state machine context
-
stateChanged
Description copied from interface:EnsembleListener
Called when ensemble is discovering a state change.- Specified by:
stateChanged
in interfaceEnsembleListener<S,
E> - Parameters:
context
- the state machine context
-
ensembleError
Description copied from interface:EnsembleListener
Called whenStateMachineEnsemble
resulted an error.- Specified by:
ensembleError
in interfaceEnsembleListener<S,
E> - Parameters:
exception
- the exception
-
ensembleLeaderGranted
Description copied from interface:EnsembleListener
Called when a state machine is granted a leader role in an ensemble.- Specified by:
ensembleLeaderGranted
in interfaceEnsembleListener<S,
E> - Parameters:
stateMachine
- the state machine
-
ensembleLeaderRevoked
Description copied from interface:EnsembleListener
Called when a state machine is revoked from a leader role in an ensemble.- Specified by:
ensembleLeaderRevoked
in interfaceEnsembleListener<S,
E> - Parameters:
stateMachine
- the state machine
-