Class StateMachineState<S,E>
java.lang.Object
org.springframework.statemachine.support.LifecycleObjectSupport
org.springframework.statemachine.state.AbstractState<S,E>
org.springframework.statemachine.state.StateMachineState<S,E>
- Type Parameters:
S- the type of stateE- the type of event
- All Implemented Interfaces:
org.springframework.beans.factory.Aware,org.springframework.beans.factory.BeanFactoryAware,org.springframework.beans.factory.DisposableBean,org.springframework.beans.factory.InitializingBean,org.springframework.context.Lifecycle,org.springframework.context.Phased,org.springframework.context.SmartLifecycle,State<S,,E> StateMachineReactiveLifecycle
A
State implementation where state is wrapped in a substatemachine.- Author:
- Janne Valkealahti
-
Field Summary
Fields inherited from interface org.springframework.context.SmartLifecycle
DEFAULT_PHASE -
Constructor Summary
ConstructorsConstructorDescriptionStateMachineState(S id, StateMachine<S, E> submachine) Instantiates a new state machine state.StateMachineState(S id, StateMachine<S, E> submachine, Collection<E> deferred) Instantiates a new state machine state.StateMachineState(S id, StateMachine<S, E> submachine, Collection<E> deferred, Collection<Function<StateContext<S, E>, reactor.core.publisher.Mono<Void>>> entryActions, Collection<Function<StateContext<S, E>, reactor.core.publisher.Mono<Void>>> exitActions) Instantiates a new state machine state.StateMachineState(S id, StateMachine<S, E> submachine, Collection<E> deferred, Collection<Function<StateContext<S, E>, reactor.core.publisher.Mono<Void>>> entryActions, Collection<Function<StateContext<S, E>, reactor.core.publisher.Mono<Void>>> exitActions, PseudoState<S, E> pseudoState) Instantiates a new state machine state.StateMachineState(S id, StateMachine<S, E> submachine, PseudoState<S, E> pseudoState) Instantiates a new state machine state. -
Method Summary
Modifier and TypeMethodDescriptionreactor.core.publisher.Mono<Void>entry(StateContext<S, E> context) Initiate an entry sequence for the state.reactor.core.publisher.Mono<Void>exit(StateContext<S, E> context) Initiate an exit sequence for the state.getIds()Gets the state identifiers.Collection<State<S,E>> Gets all possible states this state knows about including itself and substates.reactor.core.publisher.Flux<StateMachineEventResult<S,E>> Send an eventEwrapped with aMessageto the state and return aStateMachineEventResultfor results.booleanshouldDefer(org.springframework.messaging.Message<E> event) Checks if state wants to defer an event.toString()Methods inherited from class org.springframework.statemachine.state.AbstractState
addActionListener, addStateListener, armTriggers, disarmTriggers, doPreStartReactively, doPreStopReactively, executeAction, getDeferredEvents, getEntryActions, getExitActions, getId, getPseudoState, getRegions, getStateActions, getSubmachine, getTriggers, handleStateDoOnComplete, isComposite, isOrthogonal, isSimple, isSubmachineState, notifyStateOnComplete, removeActionListener, removeStateListener, setStateDoActionPolicy, setStateDoActionPolicyTimeout, setTriggersMethods inherited from class org.springframework.statemachine.support.LifecycleObjectSupport
afterPropertiesSet, destroy, doDestroy, doPostStartReactively, doPostStopReactively, getBeanFactory, getPhase, isAutoStartup, isRunning, onInit, setAutoStartup, setBeanFactory, setPhase, start, startReactively, stop, stopReactivelyMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.springframework.context.SmartLifecycle
stop
-
Constructor Details
-
StateMachineState
Instantiates a new state machine state.- Parameters:
id- the state identifiersubmachine- the submachine
-
StateMachineState
Instantiates a new state machine state.- Parameters:
id- the state identifiersubmachine- the submachinedeferred- the deferred
-
StateMachineState
Instantiates a new state machine state.- Parameters:
id- the state identifiersubmachine- the submachinepseudoState- the pseudo state
-
StateMachineState
public StateMachineState(S id, StateMachine<S, E> submachine, Collection<E> deferred, Collection<Function<StateContext<S, E>, reactor.core.publisher.Mono<Void>>> entryActions, Collection<Function<StateContext<S, E>, reactor.core.publisher.Mono<Void>>> exitActions, PseudoState<S, E> pseudoState) Instantiates a new state machine state.- Parameters:
id- the state identifiersubmachine- the submachinedeferred- the deferredentryActions- the entry actionsexitActions- the exit actionspseudoState- the pseudo state
-
StateMachineState
public StateMachineState(S id, StateMachine<S, E> submachine, Collection<E> deferred, Collection<Function<StateContext<S, E>, reactor.core.publisher.Mono<Void>>> entryActions, Collection<Function<StateContext<S, E>, reactor.core.publisher.Mono<Void>>> exitActions) Instantiates a new state machine state.- Parameters:
id- the state identifiersubmachine- the submachinedeferred- the deferredentryActions- the entry actionsexitActions- the exit actions
-
-
Method Details
-
getIds
Description copied from interface:StateGets the state identifiers. Usually returned collection contains only one identifier except in a case where state is an orthogonal. -
getStates
Description copied from interface:StateGets all possible states this state knows about including itself and substates. -
exit
Description copied from interface:StateInitiate an exit sequence for the state. -
entry
Description copied from interface:StateInitiate an entry sequence for the state. -
sendEvent
public reactor.core.publisher.Flux<StateMachineEventResult<S,E>> sendEvent(org.springframework.messaging.Message<E> event) Description copied from interface:StateSend an eventEwrapped with aMessageto the state and return aStateMachineEventResultfor results. -
shouldDefer
Description copied from interface:StateChecks if state wants to defer an event.- Specified by:
shouldDeferin interfaceState<S,E> - Overrides:
shouldDeferin classAbstractState<S,E> - Parameters:
event- the wrapped event- Returns:
- true if event should be deferred
-
toString
- Overrides:
toStringin classAbstractState<S,E>
-