Class AbstractStateMachineFactory<S,E> 
java.lang.Object
org.springframework.statemachine.support.LifecycleObjectSupport
org.springframework.statemachine.config.AbstractStateMachineFactory<S,E> 
- Type Parameters:
- S- the type of state
- E- the type of event
- All Implemented Interfaces:
- org.springframework.beans.factory.Aware,- org.springframework.beans.factory.BeanFactoryAware,- org.springframework.beans.factory.BeanNameAware,- org.springframework.beans.factory.DisposableBean,- org.springframework.beans.factory.InitializingBean,- org.springframework.context.Lifecycle,- org.springframework.context.Phased,- org.springframework.context.SmartLifecycle,- StateMachineFactory<S,,- E> - StateMachineReactiveLifecycle
- Direct Known Subclasses:
- ObjectStateMachineFactory
public abstract class AbstractStateMachineFactory<S,E> 
extends LifecycleObjectSupport
implements StateMachineFactory<S,E>, org.springframework.beans.factory.BeanNameAware 
Base 
StateMachineFactory implementation building StateMachines.- 
Field SummaryFields inherited from interface org.springframework.context.SmartLifecycleDEFAULT_PHASE
- 
Constructor SummaryConstructorsConstructorDescriptionAbstractStateMachineFactory(StateMachineModel<S, E> defaultStateMachineModel, StateMachineModelFactory<S, E> stateMachineModelFactory) Instantiates a new abstract state machine factory.
- 
Method SummaryModifier and TypeMethodDescriptionprotected abstract RegionState<S,E> buildRegionStateInternal(S id, Collection<Region<S, E>> regions, Collection<E> deferred, Collection<Function<StateContext<S, E>, reactor.core.publisher.Mono<Void>>> entryActions, Collection<Function<StateContext<S, E>, reactor.core.publisher.Mono<Void>>> exitActions, PseudoState<S, E> pseudoState, StateMachineModel<S, E> stateMachineModel) buildStateInternal(S id, Collection<E> deferred, Collection<Function<StateContext<S, E>, reactor.core.publisher.Mono<Void>>> entryActions, Collection<Function<StateContext<S, E>, reactor.core.publisher.Mono<Void>>> exitActions, Collection<Function<StateContext<S, E>, reactor.core.publisher.Mono<Void>>> stateActions, PseudoState<S, E> pseudoState, StateMachineModel<S, E> stateMachineModel) protected abstract StateMachine<S,E> buildStateMachineInternal(Collection<State<S, E>> states, Collection<Transition<S, E>> transitions, State<S, E> initialState, Transition<S, E> initialTransition, org.springframework.messaging.Message<E> initialEvent, ExtendedState extendedState, PseudoState<S, E> historyState, Boolean contextEventsEnabled, org.springframework.beans.factory.BeanFactory beanFactory, String beanName, String machineId, UUID uuid, StateMachineModel<S, E> stateMachineModel) Build a newStateMachineinstance.getStateMachine(String machineId) Build a newStateMachineinstance with a given machine id.getStateMachine(UUID uuid) Build a newStateMachineinstance with a given machine uuid.getStateMachine(UUID uuid, String machineId) Main constructor that create aStateMachine.protected org.springframework.beans.factory.BeanFactoryresolveBeanFactory(StateMachineModel<S, E> stateMachineModel) protected StateMachineModel<S,E> resolveStateMachineModel(String machineId) voidsetBeanName(String name) voidsetContextEventsEnabled(Boolean contextEvents) Instructs this factory to enable application context events.voidsetHandleAutostartup(boolean handleAutostartup) Instructs this factory to handle auto-start flag manually by calling lifecycle start method.voidsetStateMachineMonitor(StateMachineMonitor<S, E> stateMachineMonitor) Set state machine monitor.Methods inherited from class org.springframework.statemachine.support.LifecycleObjectSupportafterPropertiesSet, destroy, doDestroy, doPostStartReactively, doPostStopReactively, doPreStartReactively, doPreStopReactively, getBeanFactory, getPhase, isAutoStartup, isRunning, onInit, setAutoStartup, setBeanFactory, setPhase, start, startReactively, stop, stopReactivelyMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.context.SmartLifecyclestop
- 
Constructor Details- 
AbstractStateMachineFactorypublic AbstractStateMachineFactory(StateMachineModel<S, E> defaultStateMachineModel, StateMachineModelFactory<S, E> stateMachineModelFactory) Instantiates a new abstract state machine factory.- Parameters:
- defaultStateMachineModel- the default state machine model
- stateMachineModelFactory- the state machine model factory
 
 
- 
- 
Method Details- 
setBeanName- Specified by:
- setBeanNamein interface- org.springframework.beans.factory.BeanNameAware
 
- 
getStateMachineDescription copied from interface:StateMachineFactoryBuild a newStateMachineinstance.- Specified by:
- getStateMachinein interface- StateMachineFactory<S,- E> 
- Returns:
- a new state machine instance.
 
- 
getStateMachineDescription copied from interface:StateMachineFactoryBuild a newStateMachineinstance with a given machine id.- Specified by:
- getStateMachinein interface- StateMachineFactory<S,- E> 
- Parameters:
- machineId- the machine id
- Returns:
- a new state machine instance.
 
- 
getStateMachineDescription copied from interface:StateMachineFactoryBuild a newStateMachineinstance with a given machine uuid.- Specified by:
- getStateMachinein interface- StateMachineFactory<S,- E> 
- Parameters:
- uuid- to be used internally
- Returns:
- a new state machine instance.
 
- 
getStateMachineMain constructor that create aStateMachine.- Parameters:
- uuid- for internal usage. Can be null, in that case a random one will be generated.
- machineId- represent a user Id, up to you to set what you want.
- Returns:
- a StateMachine
 
- 
setHandleAutostartuppublic void setHandleAutostartup(boolean handleAutostartup) Instructs this factory to handle auto-start flag manually by calling lifecycle start method.- Parameters:
- handleAutostartup- the new handle autostartup
 
- 
setContextEventsEnabledInstructs this factory to enable application context events.- Parameters:
- contextEvents- the new context events enabled
 
- 
setStateMachineMonitorSet state machine monitor.- Parameters:
- stateMachineMonitor- the state machine monitor
 
- 
resolveBeanFactoryprotected org.springframework.beans.factory.BeanFactory resolveBeanFactory(StateMachineModel<S, E> stateMachineModel) 
- 
resolveStateMachineModel
- 
buildStateMachineInternalprotected abstract StateMachine<S,E> buildStateMachineInternal(Collection<State<S, E>> states, Collection<Transition<S, E>> transitions, State<S, E> initialState, Transition<S, E> initialTransition, org.springframework.messaging.Message<E> initialEvent, ExtendedState extendedState, PseudoState<S, E> historyState, Boolean contextEventsEnabled, org.springframework.beans.factory.BeanFactory beanFactory, String beanName, String machineId, UUID uuid, StateMachineModel<S, E> stateMachineModel) 
- 
buildStateInternalprotected abstract State<S,E> buildStateInternal(S id, Collection<E> deferred, Collection<Function<StateContext<S, E>, reactor.core.publisher.Mono<Void>>> entryActions, Collection<Function<StateContext<S, E>, reactor.core.publisher.Mono<Void>>> exitActions, Collection<Function<StateContext<S, E>, reactor.core.publisher.Mono<Void>>> stateActions, PseudoState<S, E> pseudoState, StateMachineModel<S, E> stateMachineModel) 
- 
buildRegionStateInternalprotected abstract RegionState<S,E> buildRegionStateInternal(S id, Collection<Region<S, E>> regions, Collection<E> deferred, Collection<Function<StateContext<S, E>, reactor.core.publisher.Mono<Void>>> entryActions, Collection<Function<StateContext<S, E>, reactor.core.publisher.Mono<Void>>> exitActions, PseudoState<S, E> pseudoState, StateMachineModel<S, E> stateMachineModel) 
 
-