Interface StateMachineInterceptor<S,E> 
- Type Parameters:
- S- the type of state
- E- the type of event
- All Known Implementing Classes:
- AbstractPersistingStateMachineInterceptor,- JpaPersistingStateMachineInterceptor,- MongoDbPersistingStateMachineInterceptor,- RedisPersistingStateMachineInterceptor,- StateMachineInterceptorAdapter,- StateMachineSecurityInterceptor
public interface StateMachineInterceptor<S,E> 
Interface which can be registered with a state machine and can be used
 to intercept and break a state change chain.
- 
Method SummaryModifier and TypeMethodDescriptionvoidpostStateChange(State<S, E> state, org.springframework.messaging.Message<E> message, Transition<S, E> transition, StateMachine<S, E> stateMachine, StateMachine<S, E> rootStateMachine) Called after a state change.postTransition(StateContext<S, E> stateContext) Called after of a transition if transition happened.org.springframework.messaging.Message<E>preEvent(org.springframework.messaging.Message<E> message, StateMachine<S, E> stateMachine) Called before message is sent to processing.voidpreStateChange(State<S, E> state, org.springframework.messaging.Message<E> message, Transition<S, E> transition, StateMachine<S, E> stateMachine, StateMachine<S, E> rootStateMachine) Called prior of a state change.preTransition(StateContext<S, E> stateContext) Called prior of a start of a transition.stateMachineError(StateMachine<S, E> stateMachine, Exception exception) State when state machine is about to enter error it can't recover.
- 
Method Details- 
preEventorg.springframework.messaging.Message<E> preEvent(org.springframework.messaging.Message<E> message, StateMachine<S, E> stateMachine) Called before message is sent to processing. Throwing exception or returning null will skip the message.- Parameters:
- message- the message
- stateMachine- the state machine
- Returns:
- the intercepted message
 
- 
preStateChangevoid preStateChange(State<S, E> state, org.springframework.messaging.Message<E> message, Transition<S, E> transition, StateMachine<S, E> stateMachine, StateMachine<S, E> rootStateMachine) Called prior of a state change. Throwing an exception from this method will stop a state change logic.- Parameters:
- state- the state
- message- the message
- transition- the transition
- stateMachine- the state machine
- rootStateMachine- the root state machine
 
- 
postStateChangevoid postStateChange(State<S, E> state, org.springframework.messaging.Message<E> message, Transition<S, E> transition, StateMachine<S, E> stateMachine, StateMachine<S, E> rootStateMachine) Called after a state change.- Parameters:
- state- the state
- message- the message
- transition- the transition
- stateMachine- the state machine
- rootStateMachine- the root state machine
 
- 
preTransitionCalled prior of a start of a transition. Returningnullfrom this method will break the transtion chain.- Parameters:
- stateContext- the state context
- Returns:
- the state context
 
- 
postTransitionCalled after of a transition if transition happened.- Parameters:
- stateContext- the state context
- Returns:
- the state context
 
- 
stateMachineErrorState when state machine is about to enter error it can't recover.- Parameters:
- stateMachine- the state machine
- exception- the exception
- Returns:
- the exception
 
 
-