Class AbstractPersistingStateMachineInterceptor<S,E,T>  
java.lang.Object
org.springframework.statemachine.support.StateMachineInterceptorAdapter<S,E>
 
org.springframework.statemachine.persist.AbstractPersistingStateMachineInterceptor<S,E,T>  
- Type Parameters:
- S- the type of state
- E- the type of event
- T- the type of persister context object
- All Implemented Interfaces:
- StateMachinePersist<S,,- E, - T> - StateMachineInterceptor<S,- E> 
- Direct Known Subclasses:
- JpaPersistingStateMachineInterceptor,- MongoDbPersistingStateMachineInterceptor,- RedisPersistingStateMachineInterceptor
public abstract class AbstractPersistingStateMachineInterceptor<S,E,T>  
extends StateMachineInterceptorAdapter<S,E>
implements StateMachinePersist<S,E,T>   
Base class for 
StateMachineInterceptor persisting StateMachineContexts.
 This class is to be used as a base implementation which wants to persist a machine which
 is about to kept running as normal use case for persistence is to stop machine, persist and
 then start it again.- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionprotected StateMachineContext<S,E> buildStateMachineContext(StateMachine<S, E> stateMachine, StateMachine<S, E> rootStateMachine, State<S, E> state) Deprecated.protected StateMachineContext<S,E> buildStateMachineContext(StateMachine<S, E> stateMachine, StateMachine<S, E> rootStateMachine, State<S, E> state, org.springframework.messaging.Message<E> message) Builds the state machine context.voidpostStateChange(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.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.abstract StateMachineContext<S,E> ReadStateMachineContextfrom persistent store.voidsetExtendedStateVariablesFunction(Function<StateMachine<S, E>, Map<Object, Object>> extendedStateVariablesFunction) Sets the function creating extended state variables.abstract voidwrite(StateMachineContext<S, E> context, T contextObj) WriteStateMachineContextinto persistent store.Methods inherited from class org.springframework.statemachine.support.StateMachineInterceptorAdapterpostTransition, preEvent, preTransition, stateMachineError
- 
Constructor Details- 
AbstractPersistingStateMachineInterceptorpublic AbstractPersistingStateMachineInterceptor()
 
- 
- 
Method Details- 
preStateChangepublic void preStateChange(State<S, E> state, org.springframework.messaging.Message<E> message, Transition<S, E> transition, StateMachine<S, E> stateMachine, StateMachine<S, E> rootStateMachine) Description copied from interface:StateMachineInterceptorCalled prior of a state change. Throwing an exception from this method will stop a state change logic.- Specified by:
- preStateChangein interface- StateMachineInterceptor<S,- E> 
- Overrides:
- preStateChangein class- StateMachineInterceptorAdapter<S,- E> 
- Parameters:
- state- the state
- message- the message
- transition- the transition
- stateMachine- the state machine
- rootStateMachine- the root state machine
 
- 
postStateChangepublic void postStateChange(State<S, E> state, org.springframework.messaging.Message<E> message, Transition<S, E> transition, StateMachine<S, E> stateMachine, StateMachine<S, E> rootStateMachine) Description copied from interface:StateMachineInterceptorCalled after a state change.- Specified by:
- postStateChangein interface- StateMachineInterceptor<S,- E> 
- Overrides:
- postStateChangein class- StateMachineInterceptorAdapter<S,- E> 
- Parameters:
- state- the state
- message- the message
- transition- the transition
- stateMachine- the state machine
- rootStateMachine- the root state machine
 
- 
writeWriteStateMachineContextinto persistent store.
- 
readReadStateMachineContextfrom persistent store.
- 
setExtendedStateVariablesFunctionpublic void setExtendedStateVariablesFunction(Function<StateMachine<S, E>, Map<Object, Object>> extendedStateVariablesFunction) Sets the function creating extended state variables.- Parameters:
- extendedStateVariablesFunction- the extended state variables function
 
- 
buildStateMachineContext@Deprecated protected StateMachineContext<S,E> buildStateMachineContext(StateMachine<S, E> stateMachine, StateMachine<S, E> rootStateMachine, State<S, E> state) Deprecated.Builds the state machine context. Note, for backward compatibility this method doesn't pass event or headers into aStateMachineContext. Implementor of this class, if using this method should move over tobuildStateMachineContext(StateMachine, StateMachine, State, Message).- Parameters:
- stateMachine- the state machine
- rootStateMachine- the root state machine
- state- the state
- Returns:
- the state machine context
 
- 
buildStateMachineContextprotected StateMachineContext<S,E> buildStateMachineContext(StateMachine<S, E> stateMachine, StateMachine<S, E> rootStateMachine, State<S, E> state, org.springframework.messaging.Message<E> message) Builds the state machine context.- Parameters:
- stateMachine- the state machine
- rootStateMachine- the root state machine
- state- the state
- message- the message
- Returns:
- the state machine context
 
 
- 
buildStateMachineContext(StateMachine, StateMachine, State, Message)