S - the type of stateE - the type of eventpublic class DefaultStateMachineExecutor<S,E> extends LifecycleObjectSupport implements StateMachineExecutor<S,E>
StateMachineExecutor.StateMachineExecutor.StateMachineExecutorTransit<S,E>| Constructor and Description |
|---|
DefaultStateMachineExecutor(StateMachine<S,E> stateMachine,
StateMachine<S,E> relayStateMachine,
java.util.Collection<Transition<S,E>> transitions,
java.util.Map<Trigger<S,E>,Transition<S,E>> triggerToTransitionMap,
java.util.List<Transition<S,E>> triggerlessTransitions,
Transition<S,E> initialTransition,
org.springframework.messaging.Message<E> initialEvent,
TransitionConflictPolicy transitionConflictPolicy)
Instantiates a new default state machine executor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addStateMachineInterceptor(StateMachineInterceptor<S,E> interceptor)
Adds the state machine interceptor.
|
protected void |
doStart()
Subclasses may implement this method with the start behavior.
|
protected void |
doStop()
Subclasses may implement this method with the stop behavior.
|
void |
execute()
Execute
StateMachineExecutor logic. |
void |
executeTriggerlessTransitions(StateContext<S,E> context,
State<S,E> state)
Execute and check all triggerless transitions.
|
java.util.concurrent.locks.Lock |
getLock()
Gets the execution lock.
|
void |
queueDeferredEvent(org.springframework.messaging.Message<E> message)
Queue deferred event.
|
void |
queueEvent(org.springframework.messaging.Message<E> message)
Queue event.
|
void |
queueTrigger(Trigger<S,E> trigger,
org.springframework.messaging.Message<E> message)
Queue trigger.
|
void |
setForwardedInitialEvent(org.springframework.messaging.Message<E> message)
Set initial forwarded event.
|
void |
setInitialEnabled(boolean enabled)
Sets the if initial stage is enabled.
|
void |
setStateMachineExecutorTransit(StateMachineExecutor.StateMachineExecutorTransit<S,E> stateMachineExecutorTransit)
Sets the state machine executor transit.
|
afterPropertiesSet, destroy, doDestroy, getBeanFactory, getPhase, getTaskExecutor, getTaskScheduler, isAutoStartup, isRunning, onInit, setAutoStartup, setBeanFactory, setPhase, setTaskExecutor, setTaskScheduler, start, stop, stopclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitstart, stoppublic DefaultStateMachineExecutor(StateMachine<S,E> stateMachine, StateMachine<S,E> relayStateMachine, java.util.Collection<Transition<S,E>> transitions, java.util.Map<Trigger<S,E>,Transition<S,E>> triggerToTransitionMap, java.util.List<Transition<S,E>> triggerlessTransitions, Transition<S,E> initialTransition, org.springframework.messaging.Message<E> initialEvent, TransitionConflictPolicy transitionConflictPolicy)
stateMachine - the state machinerelayStateMachine - the relay state machinetransitions - the transitionstriggerToTransitionMap - the trigger to transition maptriggerlessTransitions - the triggerless transitionsinitialTransition - the initial transitioninitialEvent - the initial eventtransitionConflictPolicy - the transition conflict policypublic void queueEvent(org.springframework.messaging.Message<E> message)
StateMachineExecutorqueueEvent in interface StateMachineExecutor<S,E>message - the messagepublic void queueTrigger(Trigger<S,E> trigger, org.springframework.messaging.Message<E> message)
StateMachineExecutorqueueTrigger in interface StateMachineExecutor<S,E>trigger - the triggermessage - the messagepublic void queueDeferredEvent(org.springframework.messaging.Message<E> message)
StateMachineExecutorqueueDeferredEvent in interface StateMachineExecutor<S,E>message - the messagepublic void execute()
StateMachineExecutorStateMachineExecutor logic.execute in interface StateMachineExecutor<S,E>public void setStateMachineExecutorTransit(StateMachineExecutor.StateMachineExecutorTransit<S,E> stateMachineExecutorTransit)
StateMachineExecutorsetStateMachineExecutorTransit in interface StateMachineExecutor<S,E>stateMachineExecutorTransit - the state machine executor transitprotected void doStart()
LifecycleObjectSupportLifecycleObjectSupport.lifecycleLock.doStart in class LifecycleObjectSupportprotected void doStop()
LifecycleObjectSupportLifecycleObjectSupport.lifecycleLock.doStop in class LifecycleObjectSupportpublic void setInitialEnabled(boolean enabled)
StateMachineExecutorsetInitialEnabled in interface StateMachineExecutor<S,E>enabled - the new flagpublic void setForwardedInitialEvent(org.springframework.messaging.Message<E> message)
StateMachineExecutorsetForwardedInitialEvent in interface StateMachineExecutor<S,E>message - the forwarded messageStateMachineAccess.setForwardedInitialEvent(Message)public void addStateMachineInterceptor(StateMachineInterceptor<S,E> interceptor)
StateMachineExecutoraddStateMachineInterceptor in interface StateMachineExecutor<S,E>interceptor - the interceptorpublic java.util.concurrent.locks.Lock getLock()
StateMachineExecutorgetLock in interface StateMachineExecutor<S,E>public void executeTriggerlessTransitions(StateContext<S,E> context, State<S,E> state)
StateMachineExecutorexecuteTriggerlessTransitions in interface StateMachineExecutor<S,E>context - the state contextstate - the state