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.- Author:
- Janne Valkealahti
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic classstatic classstatic interfaceCompletion callback to notify back complete or error.static interfaceCallback interface when executor wants to handle transit. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddStateMachineInterceptor(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.voidqueueDeferredEvent(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.voidsetForwardedInitialEvent(org.springframework.messaging.Message<E> message) Set initial forwarded event.voidsetInitialEnabled(boolean enabled) Sets the if initial stage is enabled.voidsetStateMachineExecutorTransit(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
-