Class AbstractPersistStateMachineHandler<S,E>

java.lang.Object
org.springframework.statemachine.support.LifecycleObjectSupport
org.springframework.statemachine.recipes.persist.AbstractPersistStateMachineHandler<S,E>
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, StateMachineReactiveLifecycle
Direct Known Subclasses:
FactoryPersistStateMachineHandler, GenericPersistStateMachineHandler

public abstract class AbstractPersistStateMachineHandler<S,E> extends LifecycleObjectSupport
AbstractPersistStateMachineHandler is a base recipe which can be used to handle a state change of an arbitrary entity in a persistent storage.
Author:
Janne Valkealahti
  • Field Details

    • interceptor

      protected final AbstractPersistStateMachineHandler<S,E>.org.springframework.statemachine.recipes.persist.AbstractPersistStateMachineHandler.PersistingStateChangeInterceptor interceptor
    • listeners

      protected final AbstractPersistStateMachineHandler<S,E>.org.springframework.statemachine.recipes.persist.AbstractPersistStateMachineHandler.CompositePersistStateChangeListener listeners
  • Constructor Details

    • AbstractPersistStateMachineHandler

      public AbstractPersistStateMachineHandler()
  • Method Details

    • getInitStateMachine

      protected abstract StateMachine<S,E> getInitStateMachine()
    • initStateMachine

      protected void initStateMachine(StateMachine<S,E> stateMachine)
    • handleEventWithState

      @Deprecated public boolean handleEventWithState(org.springframework.messaging.Message<E> event, S state)
      Deprecated.
      Handle event with entity.
      Parameters:
      event - the event
      state - the state
      Returns:
      true if event was accepted
      See Also:
    • handleEventWithStateReactively

      public reactor.core.publisher.Mono<Void> handleEventWithStateReactively(org.springframework.messaging.Message<E> event, S state)
      Handle event with entity reactively.
      Parameters:
      event - the event
      state - the state
      Returns:
      mono for completion
    • addPersistStateChangeListener

      public void addPersistStateChangeListener(AbstractPersistStateMachineHandler.GenericPersistStateChangeListener<S,E> listener)
      Adds the persist state change listener.
      Parameters:
      listener - the listener