Interface StateMachineExecutor<S,E>
- Type Parameters:
S
- the type of stateE
- the type of event
- All Superinterfaces:
StateMachineReactiveLifecycle
- All Known Implementing Classes:
ReactiveStateMachineExecutor
Interface for a
StateMachine
event executor.-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic class
static class
static interface
Completion callback to notify back complete or error.static interface
Callback interface when executor wants to handle transit. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addStateMachineInterceptor
(StateMachineInterceptor<S, E> interceptor) Adds the state machine interceptor.reactor.core.publisher.Mono<Void>
executeTriggerlessTransitions
(StateContext<S, E> context, State<S, E> state) Execute and check all triggerless transitions.void
queueDeferredEvent
(org.springframework.messaging.Message<E> message) Queue deferred event.reactor.core.publisher.Mono<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.Methods inherited from interface org.springframework.statemachine.support.StateMachineReactiveLifecycle
startReactively, stopReactively
-
Method Details
-
queueEvent
reactor.core.publisher.Mono<Void> queueEvent(reactor.core.publisher.Mono<org.springframework.messaging.Message<E>> message, StateMachineExecutor.StateMachineExecutorCallback callback) Queue event.- Parameters:
message
- the messagecallback
- the executor callback- Returns:
- completion when event is queued
-
queueDeferredEvent
Queue deferred event.- Parameters:
message
- the message
-
executeTriggerlessTransitions
reactor.core.publisher.Mono<Void> executeTriggerlessTransitions(StateContext<S, E> context, State<S, E> state) Execute and check all triggerless transitions.- Parameters:
context
- the state contextstate
- the state- Returns:
- completion when handled
-
setInitialEnabled
void setInitialEnabled(boolean enabled) Sets the if initial stage is enabled.- Parameters:
enabled
- the new flag
-
setForwardedInitialEvent
Set initial forwarded event.- Parameters:
message
- the forwarded message- See Also:
-
setStateMachineExecutorTransit
void setStateMachineExecutorTransit(StateMachineExecutor.StateMachineExecutorTransit<S, E> stateMachineExecutorTransit) Sets the state machine executor transit.- Parameters:
stateMachineExecutorTransit
- the state machine executor transit
-
addStateMachineInterceptor
Adds the state machine interceptor.- Parameters:
interceptor
- the interceptor
-