Class StateMachineEnsembleObjectSupport<S,E>
java.lang.Object
org.springframework.statemachine.support.LifecycleObjectSupport
org.springframework.statemachine.ensemble.StateMachineEnsembleObjectSupport<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,StateMachineEnsemble<S,,E> StateMachineReactiveLifecycle
- Direct Known Subclasses:
ZookeeperStateMachineEnsemble
public abstract class StateMachineEnsembleObjectSupport<S,E>
extends LifecycleObjectSupport
implements StateMachineEnsemble<S,E>
Support class for implementing
StateMachineEnsembles.-
Field Summary
Fields inherited from interface org.springframework.context.SmartLifecycle
DEFAULT_PHASE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddEnsembleListener(EnsembleListener<S, E> listener) Adds the ensemble listener.abstract voidjoin(StateMachine<S, E> stateMachine) Request a join to a state machine ensemble.abstract voidleave(StateMachine<S, E> stateMachine) Request a leave from an ensemble.protected voidnotifyError(StateMachineEnsembleException exception) protected voidnotifyGranted(StateMachine<S, E> stateMachine) protected voidnotifyJoined(StateMachine<S, E> stateMachine, StateMachineContext<S, E> context) protected voidnotifyLeft(StateMachine<S, E> stateMachine, StateMachineContext<S, E> context) protected voidnotifyRevoked(StateMachine<S, E> stateMachine) protected voidnotifyStateChanged(StateMachineContext<S, E> context) voidremoveEnsembleListener(EnsembleListener<S, E> listener) Removes the ensemble listener.Methods inherited from class org.springframework.statemachine.support.LifecycleObjectSupport
afterPropertiesSet, destroy, doDestroy, doPostStartReactively, doPostStopReactively, doPreStartReactively, doPreStopReactively, 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, toString, wait, wait, waitMethods inherited from interface org.springframework.context.SmartLifecycle
stopMethods inherited from interface org.springframework.statemachine.ensemble.StateMachineEnsemble
getLeader, getState, setState
-
Constructor Details
-
StateMachineEnsembleObjectSupport
public StateMachineEnsembleObjectSupport()
-
-
Method Details
-
join
Description copied from interface:StateMachineEnsembleRequest a join to a state machine ensemble. This method is a request to join an ensemble and doesn't guarantee a requester will eventually successfully join. Join operation needs to be used together withEnsembleListenerandEnsembleListener.stateMachineJoined(StateMachine, StateMachineContext)is called with aStateMachineinstance for successful join.- Specified by:
joinin interfaceStateMachineEnsemble<S,E> - Parameters:
stateMachine- the state machine
-
leave
Description copied from interface:StateMachineEnsembleRequest a leave from an ensemble. This method is a request to leave an ensemble. After this method is called no further processing is done for a instance ofStateMachine. AdditionallyEnsembleListener.stateMachineLeft(StateMachine, StateMachineContext)is called when leave request is fully processed.- Specified by:
leavein interfaceStateMachineEnsemble<S,E> - Parameters:
stateMachine- the state machine
-
addEnsembleListener
Description copied from interface:StateMachineEnsembleAdds the ensemble listener.- Specified by:
addEnsembleListenerin interfaceStateMachineEnsemble<S,E> - Parameters:
listener- the listener
-
removeEnsembleListener
Description copied from interface:StateMachineEnsembleRemoves the ensemble listener.- Specified by:
removeEnsembleListenerin interfaceStateMachineEnsemble<S,E> - Parameters:
listener- the listener
-
notifyJoined
-
notifyLeft
-
notifyError
-
notifyGranted
-
notifyRevoked
-
notifyStateChanged
-