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.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected classThis 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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voiddoStart()protected StringReturns a bean name known to context per contract withBeanNameAware.protected CompositeStateMachineListener<S,E> protected StateMachineEventPublisherGets the state machine event publisher.protected StateMachineInterceptorList<S,E> protected CompositeStateMachineMonitor<S,E> protected voidnotifyActionMonitor(StateMachine<S, E> stateMachine, Function<StateContext<S, E>, reactor.core.publisher.Mono<Void>> action, long duration) protected voidnotifyEventNotAccepted(StateContext<S, E> stateContext) protected voidnotifyExtendedStateChanged(Object key, Object value, StateContext<S, E> stateContext) protected voidnotifyStateChanged(StateContext<S, E> stateContext) protected voidnotifyStateEntered(StateContext<S, E> stateContext) protected voidnotifyStateExited(StateContext<S, E> stateContext) protected voidnotifyStateMachineError(StateContext<S, E> stateContext) protected voidnotifyStateMachineStarted(StateContext<S, E> stateContext) protected voidnotifyStateMachineStopped(StateContext<S, E> stateContext) protected voidnotifyTransition(StateContext<S, E> stateContext) protected voidnotifyTransitionEnd(StateContext<S, E> stateContext) protected voidnotifyTransitionMonitor(StateMachine<S, E> stateMachine, Transition<S, E> transition, long duration) protected voidnotifyTransitionStart(StateContext<S, E> stateContext) voidsetBeanName(String name) voidsetContextEventsEnabled(boolean contextEventsEnabled) Set if context application events are enabled.voidsetStateMachineEventPublisher(StateMachineEventPublisher stateMachineEventPublisher) Sets the state machine event publisher.protected voidsetStateMachineInterceptors(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, 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
stop
-
Constructor Details
-
StateMachineObjectSupport
public StateMachineObjectSupport()
-
-
Method Details
-
doStart
protected void doStart() -
setBeanName
- Specified by:
setBeanNamein 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
-