S - the type of stateE - the type of eventpublic abstract class AbstractStateMachineFactory<S,E> extends LifecycleObjectSupport implements StateMachineFactory<S,E>, org.springframework.beans.factory.BeanNameAware
StateMachineFactory implementation building StateMachines.| Constructor and Description |
|---|
AbstractStateMachineFactory(StateMachineModel<S,E> defaultStateMachineModel,
StateMachineModelFactory<S,E> stateMachineModelFactory)
Instantiates a new abstract state machine factory.
|
| Modifier and Type | Method and Description |
|---|---|
protected abstract RegionState<S,E> |
buildRegionStateInternal(S id,
java.util.Collection<Region<S,E>> regions,
java.util.Collection<E> deferred,
java.util.Collection<? extends Action<S,E>> entryActions,
java.util.Collection<? extends Action<S,E>> exitActions,
PseudoState<S,E> pseudoState,
StateMachineModel<S,E> stateMachineModel) |
protected abstract State<S,E> |
buildStateInternal(S id,
java.util.Collection<E> deferred,
java.util.Collection<? extends Action<S,E>> entryActions,
java.util.Collection<? extends Action<S,E>> exitActions,
java.util.Collection<? extends Action<S,E>> stateActions,
PseudoState<S,E> pseudoState,
StateMachineModel<S,E> stateMachineModel) |
protected abstract StateMachine<S,E> |
buildStateMachineInternal(java.util.Collection<State<S,E>> states,
java.util.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,
java.lang.Boolean contextEventsEnabled,
org.springframework.beans.factory.BeanFactory beanFactory,
org.springframework.core.task.TaskExecutor taskExecutor,
org.springframework.scheduling.TaskScheduler taskScheduler,
java.lang.String beanName,
java.lang.String machineId,
java.util.UUID uuid,
StateMachineModel<S,E> stateMachineModel) |
StateMachine<S,E> |
getStateMachine()
Build a new
StateMachine instance. |
StateMachine<S,E> |
getStateMachine(java.lang.String machineId)
Build a new
StateMachine instance
with a given machine id. |
StateMachine<S,E> |
getStateMachine(java.util.UUID uuid)
Build a new
StateMachine instance
with a given machine uuid. |
StateMachine<S,E> |
getStateMachine(java.util.UUID uuid,
java.lang.String machineId)
Main constructor that create a
StateMachine. |
protected org.springframework.beans.factory.BeanFactory |
resolveBeanFactory(StateMachineModel<S,E> stateMachineModel) |
protected StateMachineModel<S,E> |
resolveStateMachineModel(java.lang.String machineId) |
protected org.springframework.core.task.TaskExecutor |
resolveTaskExecutor(StateMachineModel<S,E> stateMachineModel) |
protected org.springframework.scheduling.TaskScheduler |
resolveTaskScheduler(StateMachineModel<S,E> stateMachineModel) |
void |
setBeanName(java.lang.String name) |
void |
setContextEventsEnabled(java.lang.Boolean contextEvents)
Instructs this factory to enable application context events.
|
void |
setHandleAutostartup(boolean handleAutostartup)
Instructs this factory to handle auto-start flag manually
by calling lifecycle start method.
|
void |
setStateMachineMonitor(StateMachineMonitor<S,E> stateMachineMonitor)
Set state machine monitor.
|
afterPropertiesSet, destroy, doDestroy, doStart, doStop, getBeanFactory, getPhase, getTaskExecutor, getTaskScheduler, isAutoStartup, isRunning, onInit, setAutoStartup, setBeanFactory, setPhase, setTaskExecutor, setTaskScheduler, start, stop, stoppublic AbstractStateMachineFactory(StateMachineModel<S,E> defaultStateMachineModel, StateMachineModelFactory<S,E> stateMachineModelFactory)
defaultStateMachineModel - the default state machine modelstateMachineModelFactory - the state machine model factorypublic void setBeanName(java.lang.String name)
setBeanName in interface org.springframework.beans.factory.BeanNameAwarepublic StateMachine<S,E> getStateMachine()
StateMachineFactoryStateMachine instance.getStateMachine in interface StateMachineFactory<S,E>public StateMachine<S,E> getStateMachine(java.lang.String machineId)
StateMachineFactoryStateMachine instance
with a given machine id.getStateMachine in interface StateMachineFactory<S,E>machineId - the machine idpublic StateMachine<S,E> getStateMachine(java.util.UUID uuid)
StateMachineFactoryStateMachine instance
with a given machine uuid.getStateMachine in interface StateMachineFactory<S,E>uuid - to be used internallypublic StateMachine<S,E> getStateMachine(java.util.UUID uuid, java.lang.String machineId)
StateMachine.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.StateMachinepublic void setHandleAutostartup(boolean handleAutostartup)
handleAutostartup - the new handle autostartuppublic void setContextEventsEnabled(java.lang.Boolean contextEvents)
contextEvents - the new context events enabledpublic void setStateMachineMonitor(StateMachineMonitor<S,E> stateMachineMonitor)
stateMachineMonitor - the state machine monitorprotected org.springframework.beans.factory.BeanFactory resolveBeanFactory(StateMachineModel<S,E> stateMachineModel)
protected org.springframework.core.task.TaskExecutor resolveTaskExecutor(StateMachineModel<S,E> stateMachineModel)
protected org.springframework.scheduling.TaskScheduler resolveTaskScheduler(StateMachineModel<S,E> stateMachineModel)
protected StateMachineModel<S,E> resolveStateMachineModel(java.lang.String machineId)
protected abstract StateMachine<S,E> buildStateMachineInternal(java.util.Collection<State<S,E>> states, java.util.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, java.lang.Boolean contextEventsEnabled, org.springframework.beans.factory.BeanFactory beanFactory, org.springframework.core.task.TaskExecutor taskExecutor, org.springframework.scheduling.TaskScheduler taskScheduler, java.lang.String beanName, java.lang.String machineId, java.util.UUID uuid, StateMachineModel<S,E> stateMachineModel)
protected abstract State<S,E> buildStateInternal(S id, java.util.Collection<E> deferred, java.util.Collection<? extends Action<S,E>> entryActions, java.util.Collection<? extends Action<S,E>> exitActions, java.util.Collection<? extends Action<S,E>> stateActions, PseudoState<S,E> pseudoState, StateMachineModel<S,E> stateMachineModel)
protected abstract RegionState<S,E> buildRegionStateInternal(S id, java.util.Collection<Region<S,E>> regions, java.util.Collection<E> deferred, java.util.Collection<? extends Action<S,E>> entryActions, java.util.Collection<? extends Action<S,E>> exitActions, PseudoState<S,E> pseudoState, StateMachineModel<S,E> stateMachineModel)