S
- the type of stateE
- the type of eventpublic class ReactiveStateMachineExecutor<S,E> extends LifecycleObjectSupport implements StateMachineExecutor<S,E>
StateMachineExecutor
.StateMachineExecutor.ExecutorExceptionHolder, StateMachineExecutor.MonoSinkStateMachineExecutorCallback, StateMachineExecutor.StateMachineExecutorCallback, StateMachineExecutor.StateMachineExecutorTransit<S,E>
Constructor and Description |
---|
ReactiveStateMachineExecutor(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) |
Modifier and Type | Method and Description |
---|---|
void |
addStateMachineInterceptor(StateMachineInterceptor<S,E> interceptor)
Adds the state machine interceptor.
|
protected reactor.core.publisher.Mono<java.lang.Void> |
doPreStartReactively()
Subclasses may implement this for pre start logic.
|
protected reactor.core.publisher.Mono<java.lang.Void> |
doPreStopReactively()
Subclasses may implement this for pre stop logic.
|
reactor.core.publisher.Mono<java.lang.Void> |
executeTriggerlessTransitions(StateContext<S,E> context,
State<S,E> state)
Execute and check all triggerless transitions.
|
protected void |
onInit()
Subclasses may implement this for initialization logic.
|
void |
queueDeferredEvent(org.springframework.messaging.Message<E> message)
Queue deferred event.
|
reactor.core.publisher.Mono<java.lang.Void> |
queueEvent(reactor.core.publisher.Mono<org.springframework.messaging.Message<E>> message,
StateMachineExecutor.StateMachineExecutorCallback callback)
Queue event.
|
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, doPostStartReactively, doPostStopReactively, getBeanFactory, getPhase, isAutoStartup, isRunning, setAutoStartup, setBeanFactory, setPhase, start, startReactively, stop, stopReactively
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
startReactively, stopReactively
public ReactiveStateMachineExecutor(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)
protected void onInit() throws java.lang.Exception
LifecycleObjectSupport
InitializingBean
phase.onInit
in class LifecycleObjectSupport
java.lang.Exception
- exceptionprotected reactor.core.publisher.Mono<java.lang.Void> doPreStartReactively()
LifecycleObjectSupport
doPreStartReactively
in class LifecycleObjectSupport
protected reactor.core.publisher.Mono<java.lang.Void> doPreStopReactively()
LifecycleObjectSupport
doPreStopReactively
in class LifecycleObjectSupport
public void queueDeferredEvent(org.springframework.messaging.Message<E> message)
StateMachineExecutor
queueDeferredEvent
in interface StateMachineExecutor<S,E>
message
- the messagepublic reactor.core.publisher.Mono<java.lang.Void> executeTriggerlessTransitions(StateContext<S,E> context, State<S,E> state)
StateMachineExecutor
executeTriggerlessTransitions
in interface StateMachineExecutor<S,E>
context
- the state contextstate
- the statepublic void setInitialEnabled(boolean enabled)
StateMachineExecutor
setInitialEnabled
in interface StateMachineExecutor<S,E>
enabled
- the new flagpublic void setForwardedInitialEvent(org.springframework.messaging.Message<E> message)
StateMachineExecutor
setForwardedInitialEvent
in interface StateMachineExecutor<S,E>
message
- the forwarded messageStateMachineAccess.setForwardedInitialEvent(Message)
public void setStateMachineExecutorTransit(StateMachineExecutor.StateMachineExecutorTransit<S,E> stateMachineExecutorTransit)
StateMachineExecutor
setStateMachineExecutorTransit
in interface StateMachineExecutor<S,E>
stateMachineExecutorTransit
- the state machine executor transitpublic void addStateMachineInterceptor(StateMachineInterceptor<S,E> interceptor)
StateMachineExecutor
addStateMachineInterceptor
in interface StateMachineExecutor<S,E>
interceptor
- the interceptorpublic reactor.core.publisher.Mono<java.lang.Void> queueEvent(reactor.core.publisher.Mono<org.springframework.messaging.Message<E>> message, StateMachineExecutor.StateMachineExecutorCallback callback)
StateMachineExecutor
queueEvent
in interface StateMachineExecutor<S,E>
message
- the messagecallback
- the executor callback