Class LatchStateMachineListener<S,E>
java.lang.Object
org.springframework.statemachine.listener.StateMachineListenerAdapter<S,E>
org.springframework.statemachine.test.support.LatchStateMachineListener<S,E>
- Type Parameters:
S
- the type of stateE
- the type of event
- All Implemented Interfaces:
StateMachineListener<S,
E>
A
StateMachineListener
which is used during the tests
to assert correct count of listener callbacks.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
static class
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
eventNotAccepted
(org.springframework.messaging.Message<E> event) Notified when event was not accepted.void
extendedStateChanged
(Object key, Object value) Notified when extended state variable is either added, modified or removed.List<StateMachine<S,
E>> List<StateMachine<S,
E>> List<Transition<S,
E>> List<Transition<S,
E>> List<Transition<S,
E>> void
reset
(int stateChangedCount, int stateEnteredCount, int stateExitedCount, int eventNotAcceptedCount, int transitionCount, int transitionStartedCount, int transitionEndedCount, int stateMachineStartedCount, int stateMachineStoppedCount, int extendedStateChangedCount) void
Notified when state is changed.void
stateEntered
(State<S, E> state) Notified when state is entered.void
stateExited
(State<S, E> state) Notified when state is exited.void
stateMachineStarted
(StateMachine<S, E> stateMachine) Notified when statemachine startsvoid
stateMachineStopped
(StateMachine<S, E> stateMachine) Notified when statemachine stopsvoid
transition
(Transition<S, E> transition) Notified when transition happened.void
transitionEnded
(Transition<S, E> transition) Notified when transition ended.void
transitionStarted
(Transition<S, E> transition) Notified when transition started.Methods inherited from class org.springframework.statemachine.listener.StateMachineListenerAdapter
stateContext, stateMachineError
-
Constructor Details
-
LatchStateMachineListener
public LatchStateMachineListener()
-
-
Method Details
-
stateChanged
Description copied from interface:StateMachineListener
Notified when state is changed.- Specified by:
stateChanged
in interfaceStateMachineListener<S,
E> - Overrides:
stateChanged
in classStateMachineListenerAdapter<S,
E> - Parameters:
from
- the source stateto
- the target state
-
stateEntered
Description copied from interface:StateMachineListener
Notified when state is entered.- Specified by:
stateEntered
in interfaceStateMachineListener<S,
E> - Overrides:
stateEntered
in classStateMachineListenerAdapter<S,
E> - Parameters:
state
- the state
-
stateExited
Description copied from interface:StateMachineListener
Notified when state is exited.- Specified by:
stateExited
in interfaceStateMachineListener<S,
E> - Overrides:
stateExited
in classStateMachineListenerAdapter<S,
E> - Parameters:
state
- the state
-
eventNotAccepted
Description copied from interface:StateMachineListener
Notified when event was not accepted.- Specified by:
eventNotAccepted
in interfaceStateMachineListener<S,
E> - Overrides:
eventNotAccepted
in classStateMachineListenerAdapter<S,
E> - Parameters:
event
- the event
-
transition
Description copied from interface:StateMachineListener
Notified when transition happened.- Specified by:
transition
in interfaceStateMachineListener<S,
E> - Overrides:
transition
in classStateMachineListenerAdapter<S,
E> - Parameters:
transition
- the transition
-
transitionStarted
Description copied from interface:StateMachineListener
Notified when transition started.- Specified by:
transitionStarted
in interfaceStateMachineListener<S,
E> - Overrides:
transitionStarted
in classStateMachineListenerAdapter<S,
E> - Parameters:
transition
- the transition
-
transitionEnded
Description copied from interface:StateMachineListener
Notified when transition ended.- Specified by:
transitionEnded
in interfaceStateMachineListener<S,
E> - Overrides:
transitionEnded
in classStateMachineListenerAdapter<S,
E> - Parameters:
transition
- the transition
-
stateMachineStarted
Description copied from interface:StateMachineListener
Notified when statemachine starts- Specified by:
stateMachineStarted
in interfaceStateMachineListener<S,
E> - Overrides:
stateMachineStarted
in classStateMachineListenerAdapter<S,
E> - Parameters:
stateMachine
- the statemachine
-
stateMachineStopped
Description copied from interface:StateMachineListener
Notified when statemachine stops- Specified by:
stateMachineStopped
in interfaceStateMachineListener<S,
E> - Overrides:
stateMachineStopped
in classStateMachineListenerAdapter<S,
E> - Parameters:
stateMachine
- the statemachine
-
extendedStateChanged
Description copied from interface:StateMachineListener
Notified when extended state variable is either added, modified or removed.- Specified by:
extendedStateChanged
in interfaceStateMachineListener<S,
E> - Overrides:
extendedStateChanged
in classStateMachineListenerAdapter<S,
E> - Parameters:
key
- the variable keyvalue
- the variable value
-
reset
public void reset(int stateChangedCount, int stateEnteredCount, int stateExitedCount, int eventNotAcceptedCount, int transitionCount, int transitionStartedCount, int transitionEndedCount, int stateMachineStartedCount, int stateMachineStoppedCount, int extendedStateChangedCount) -
getStateChangedLatch
-
getStateEnteredLatch
-
getStateExitedLatch
-
getEventNotAcceptedLatch
-
getTransitionLatch
-
getTransitionStartedLatch
-
getTransitionEndedLatch
-
getStateMachineStartedLatch
-
getStateMachineStoppedLatch
-
getExtendedStateChangedLatch
-
getStateChanged
-
getStateEntered
-
getStateExited
-
getEventNotAccepted
-
getTransition
-
getTransitionStarted
-
getTransitionEnded
-
getStateMachineStarted
-
getStateMachineStopped
-
getExtendedStateChanged
-