Class DistributedStateMachine<S,E> 
java.lang.Object
org.springframework.statemachine.support.LifecycleObjectSupport
org.springframework.statemachine.ensemble.DistributedStateMachine<S,E> 
- Type Parameters:
- S- the type of state
- E- 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,- Region<S,,- E> - StateMachine<S,,- E> - StateMachineReactiveLifecycle
public class DistributedStateMachine<S,E> 
extends LifecycleObjectSupport
implements StateMachine<S,E> 
DistributedStateMachine is wrapping a real StateMachine and works
 together with a StateMachineEnsemble order to provide a distributed state
 machine.
 Every distributed state machine will enter its initial state regardless of
 a distributed state status.- 
Field SummaryFields inherited from interface org.springframework.context.SmartLifecycleDEFAULT_PHASE
- 
Constructor SummaryConstructorsConstructorDescriptionDistributedStateMachine(StateMachineEnsemble<S, E> ensemble, StateMachine<S, E> delegate) Instantiates a new distributed state machine.
- 
Method SummaryModifier and TypeMethodDescriptionvoidaddStateListener(StateMachineListener<S, E> listener) Adds the state listener.protected reactor.core.publisher.Mono<Void>Subclasses may implement this for pre start logic.protected reactor.core.publisher.Mono<Void>Subclasses may implement this for pre stop logic.Gets the state machine extended state.getId()Gets the region and state machine id.Gets the initial stateS.getState()Gets the currentState.Gets the state machine accessor.Collection<State<S,E>> Gets theStates defined in this region.Gets aTransitions for this region.getUuid()Gets the region and state machine unique id.booleanChecks for state machine error.booleanChecks if region complete.protected voidonInit()Subclasses may implement this for initialization logic.voidremoveStateListener(StateMachineListener<S, E> listener) Removes the state listener.booleanSend an eventEto the region.booleanSend an eventEwrapped with aMessageto the region.reactor.core.publisher.Flux<StateMachineEventResult<S,E>> reactor.core.publisher.Mono<List<StateMachineEventResult<S,E>>> sendEventCollect(reactor.core.publisher.Mono<org.springframework.messaging.Message<E>> event) reactor.core.publisher.Flux<StateMachineEventResult<S,E>> sendEvents(reactor.core.publisher.Flux<org.springframework.messaging.Message<E>> events) voidsetStateMachineError(Exception exception) Sets the state machine error.toString()Methods inherited from class org.springframework.statemachine.support.LifecycleObjectSupportafterPropertiesSet, destroy, doDestroy, doPostStartReactively, doPostStopReactively, getBeanFactory, getPhase, isAutoStartup, isRunning, setAutoStartup, setBeanFactory, setPhase, start, startReactively, stop, stopReactivelyMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.springframework.context.SmartLifecyclestopMethods inherited from interface org.springframework.statemachine.support.StateMachineReactiveLifecyclestartReactively, stopReactively
- 
Constructor Details- 
DistributedStateMachineInstantiates a new distributed state machine.- Parameters:
- ensemble- the state machine ensemble
- delegate- the delegating state machine
 
 
- 
- 
Method Details- 
onInitDescription copied from class:LifecycleObjectSupportSubclasses may implement this for initialization logic. Called during theInitializingBeanphase.- Overrides:
- onInitin class- LifecycleObjectSupport
- Throws:
- Exception- exception
 
- 
doPreStartReactivelyDescription copied from class:LifecycleObjectSupportSubclasses may implement this for pre start logic.- Overrides:
- doPreStartReactivelyin class- LifecycleObjectSupport
- Returns:
- the mono for completion
 
- 
doPreStopReactivelyDescription copied from class:LifecycleObjectSupportSubclasses may implement this for pre stop logic.- Overrides:
- doPreStopReactivelyin class- LifecycleObjectSupport
- Returns:
- the mono for completion
 
- 
sendEventDescription copied from interface:RegionSend an eventEwrapped with aMessageto the region.NOTE: this method is now deprecated in favour of a reactive methods. 
- 
sendEventDescription copied from interface:RegionSend an eventEto the region.NOTE: this method is now deprecated in favour of a reactive methods. 
- 
sendEventpublic reactor.core.publisher.Flux<StateMachineEventResult<S,E>> sendEvent(reactor.core.publisher.Mono<org.springframework.messaging.Message<E>> event) Description copied from interface:RegionSend aMonoof event and return aFluxofStateMachineEventResults. Events are consumed after returned results are consumed.
- 
sendEventCollectpublic reactor.core.publisher.Mono<List<StateMachineEventResult<S,E>>> sendEventCollect(reactor.core.publisher.Mono<org.springframework.messaging.Message<E>> event) Description copied from interface:RegionSend aMonoof event and return aMonoof collectedStateMachineEventResults as a list. Events are consumed after returned results are consumed.- Specified by:
- sendEventCollectin interface- Region<S,- E> 
- Parameters:
- event- the event
- Returns:
- the event results
 
- 
sendEventspublic reactor.core.publisher.Flux<StateMachineEventResult<S,E>> sendEvents(reactor.core.publisher.Flux<org.springframework.messaging.Message<E>> events) Description copied from interface:RegionSend aFluxof events and return aFluxofStateMachineEventResults. Events are consumed after returned results are consumed.- Specified by:
- sendEventsin interface- Region<S,- E> 
- Parameters:
- events- the events
- Returns:
- the event results
 
- 
getStateDescription copied from interface:RegionGets the currentState.
- 
getStatesDescription copied from interface:RegionGets theStates defined in this region. Returned collection is an unmodifiable copy because states in a state machine are immutable.
- 
getTransitionsDescription copied from interface:RegionGets aTransitions for this region.- Specified by:
- getTransitionsin interface- Region<S,- E> 
- Returns:
- immutable copy of transitions
 
- 
isCompletepublic boolean isComplete()Description copied from interface:RegionChecks if region complete. Region is considered to be completed if it has reached its end state and no further event processing is happening.- Specified by:
- isCompletein interface- Region<S,- E> 
- Returns:
- true, if complete
 
- 
setStateMachineErrorDescription copied from interface:StateMachineSets the state machine error.- Specified by:
- setStateMachineErrorin interface- StateMachine<S,- E> 
- Parameters:
- exception- the new state machine error
 
- 
hasStateMachineErrorpublic boolean hasStateMachineError()Description copied from interface:StateMachineChecks for state machine error.- Specified by:
- hasStateMachineErrorin interface- StateMachine<S,- E> 
- Returns:
- true, if error has been set
 
- 
addStateListenerDescription copied from interface:RegionAdds the state listener.- Specified by:
- addStateListenerin interface- Region<S,- E> 
- Parameters:
- listener- the listener
 
- 
removeStateListenerDescription copied from interface:RegionRemoves the state listener.- Specified by:
- removeStateListenerin interface- Region<S,- E> 
- Parameters:
- listener- the listener
 
- 
getInitialStateDescription copied from interface:StateMachineGets the initial stateS.- Specified by:
- getInitialStatein interface- StateMachine<S,- E> 
- Returns:
- initial state
 
- 
getExtendedStateDescription copied from interface:StateMachineGets the state machine extended state.- Specified by:
- getExtendedStatein interface- StateMachine<S,- E> 
- Returns:
- extended state
 
- 
getStateMachineAccessorDescription copied from interface:StateMachineGets the state machine accessor.- Specified by:
- getStateMachineAccessorin interface- StateMachine<S,- E> 
- Returns:
- the state machine accessor
 
- 
getUuidDescription copied from interface:RegionGets the region and state machine unique id.
- 
getIdDescription copied from interface:RegionGets the region and state machine id. This identifier is provided for users disposal and can be set from a various ways to build a machines.
- 
toString
 
-