Class StateMachineObjectSupport<S,E>
java.lang.Object
org.springframework.statemachine.support.LifecycleObjectSupport
org.springframework.statemachine.support.StateMachineObjectSupport<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.BeanNameAware
,org.springframework.beans.factory.DisposableBean
,org.springframework.beans.factory.InitializingBean
,org.springframework.context.Lifecycle
,org.springframework.context.Phased
,org.springframework.context.SmartLifecycle
,StateMachineReactiveLifecycle
- Direct Known Subclasses:
AbstractStateMachine
public abstract class StateMachineObjectSupport<S,E>
extends LifecycleObjectSupport
implements org.springframework.beans.factory.BeanNameAware
Support and helper class for base state machine implementation.
- Author:
- Janne Valkealahti
-
Nested Class Summary
Modifier and TypeClassDescriptionprotected class
This class is used to relay listener events from a submachines which works as its own listener context. -
Field Summary
Fields inherited from interface org.springframework.context.SmartLifecycle
DEFAULT_PHASE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
doStart()
protected String
Returns a bean name known to context per contract withBeanNameAware
.protected CompositeStateMachineListener<S,
E> protected StateMachineEventPublisher
Gets the state machine event publisher.protected StateMachineInterceptorList<S,
E> protected CompositeStateMachineMonitor<S,
E> protected void
notifyActionMonitor
(StateMachine<S, E> stateMachine, Function<StateContext<S, E>, reactor.core.publisher.Mono<Void>> action, long duration) protected void
notifyEventNotAccepted
(StateContext<S, E> stateContext) protected void
notifyExtendedStateChanged
(Object key, Object value, StateContext<S, E> stateContext) protected void
notifyStateChanged
(StateContext<S, E> stateContext) protected void
notifyStateEntered
(StateContext<S, E> stateContext) protected void
notifyStateExited
(StateContext<S, E> stateContext) protected void
notifyStateMachineError
(StateContext<S, E> stateContext) protected void
notifyStateMachineStarted
(StateContext<S, E> stateContext) protected void
notifyStateMachineStopped
(StateContext<S, E> stateContext) protected void
notifyTransition
(StateContext<S, E> stateContext) protected void
notifyTransitionEnd
(StateContext<S, E> stateContext) protected void
notifyTransitionMonitor
(StateMachine<S, E> stateMachine, Transition<S, E> transition, long duration) protected void
notifyTransitionStart
(StateContext<S, E> stateContext) void
setBeanName
(String name) void
setContextEventsEnabled
(boolean contextEventsEnabled) Set if context application events are enabled.void
setStateMachineEventPublisher
(StateMachineEventPublisher stateMachineEventPublisher) Sets the state machine event publisher.protected void
setStateMachineInterceptors
(List<StateMachineInterceptor<S, E>> interceptors) 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
-
Constructor Details
-
StateMachineObjectSupport
public StateMachineObjectSupport()
-
-
Method Details
-
doStart
protected void doStart() -
setBeanName
- Specified by:
setBeanName
in interfaceorg.springframework.beans.factory.BeanNameAware
-
getBeanName
Returns a bean name known to context per contract withBeanNameAware
.- Returns:
- a bean name
-
getStateMachineEventPublisher
Gets the state machine event publisher.- Returns:
- the state machine event publisher
-
setStateMachineEventPublisher
Sets the state machine event publisher.- Parameters:
stateMachineEventPublisher
- the new state machine event publisher
-
setContextEventsEnabled
public void setContextEventsEnabled(boolean contextEventsEnabled) Set if context application events are enabled. Events are enabled by default. Set this to false if you don't want state machine to send application context events.- Parameters:
contextEventsEnabled
- the enabled flag
-
getStateListener
-
getStateMachineMonitor
-
notifyStateChanged
-
notifyStateEntered
-
notifyStateExited
-
notifyEventNotAccepted
-
notifyTransitionStart
-
notifyTransition
-
notifyTransitionEnd
-
notifyStateMachineStarted
-
notifyStateMachineStopped
-
notifyStateMachineError
-
notifyExtendedStateChanged
-
notifyTransitionMonitor
protected void notifyTransitionMonitor(StateMachine<S, E> stateMachine, Transition<S, E> transition, long duration) -
notifyActionMonitor
protected void notifyActionMonitor(StateMachine<S, E> stateMachine, Function<StateContext<S, E>, reactor.core.publisher.Mono<Void>> action, long duration) -
getStateMachineInterceptors
-
setStateMachineInterceptors
-