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
StateMachineEnsemble
s.- Author:
- Janne Valkealahti
-
Field Summary
Fields inherited from interface org.springframework.context.SmartLifecycle
DEFAULT_PHASE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addEnsembleListener
(EnsembleListener<S, E> listener) Adds the ensemble listener.abstract void
join
(StateMachine<S, E> stateMachine) Request a join to a state machine ensemble.abstract void
leave
(StateMachine<S, E> stateMachine) Request a leave from an ensemble.protected void
notifyError
(StateMachineEnsembleException exception) protected void
notifyGranted
(StateMachine<S, E> stateMachine) protected void
notifyJoined
(StateMachine<S, E> stateMachine, StateMachineContext<S, E> context) protected void
notifyLeft
(StateMachine<S, E> stateMachine, StateMachineContext<S, E> context) protected void
notifyRevoked
(StateMachine<S, E> stateMachine) protected void
notifyStateChanged
(StateMachineContext<S, E> context) void
removeEnsembleListener
(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, stopReactively
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.context.SmartLifecycle
stop
Methods inherited from interface org.springframework.statemachine.ensemble.StateMachineEnsemble
getLeader, getState, setState
-
Constructor Details
-
StateMachineEnsembleObjectSupport
public StateMachineEnsembleObjectSupport()
-
-
Method Details
-
join
Description copied from interface:StateMachineEnsemble
Request 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 withEnsembleListener
andEnsembleListener.stateMachineJoined(StateMachine, StateMachineContext)
is called with aStateMachine
instance for successful join.- Specified by:
join
in interfaceStateMachineEnsemble<S,
E> - Parameters:
stateMachine
- the state machine
-
leave
Description copied from interface:StateMachineEnsemble
Request 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:
leave
in interfaceStateMachineEnsemble<S,
E> - Parameters:
stateMachine
- the state machine
-
addEnsembleListener
Description copied from interface:StateMachineEnsemble
Adds the ensemble listener.- Specified by:
addEnsembleListener
in interfaceStateMachineEnsemble<S,
E> - Parameters:
listener
- the listener
-
removeEnsembleListener
Description copied from interface:StateMachineEnsemble
Removes the ensemble listener.- Specified by:
removeEnsembleListener
in interfaceStateMachineEnsemble<S,
E> - Parameters:
listener
- the listener
-
notifyJoined
-
notifyLeft
-
notifyError
-
notifyGranted
-
notifyRevoked
-
notifyStateChanged
-