Class StateMachineHandler<T extends Annotation,S,E>

java.lang.Object
org.springframework.statemachine.processor.StateMachineHandler<T,S,E>
Type Parameters:
T - the type of annotation
S - the type of state
E - the type of event
All Implemented Interfaces:
org.springframework.core.Ordered

public class StateMachineHandler<T extends Annotation,S,E> extends Object implements org.springframework.core.Ordered
Handler for a common object representing something to be run. This is usually used when a plain pojo is configured with WithStateMachine and OnTransition annotations.
Author:
Janne Valkealahti
  • Constructor Details

    • StateMachineHandler

      public StateMachineHandler(Class<?> beanClass, Object target, Method method, T metaAnnotation, Annotation annotation)
      Instantiates a new container handler.
      Parameters:
      beanClass - the bean class
      target - the target bean
      metaAnnotation - the meta annotation
      annotation - the annotation
      method - the method
    • StateMachineHandler

      public StateMachineHandler(Class<?> beanClass, Object target, String methodName, T metaAnnotation, Annotation annotation)
      Instantiates a new container handler.
      Parameters:
      beanClass - the bean class
      target - the target bean
      methodName - the method name
      metaAnnotation - the meta annotation
      annotation - the annotation
    • StateMachineHandler

      public StateMachineHandler(Class<?> beanClass, T metaAnnotation, Annotation annotation, MethodInvokingStateMachineRuntimeProcessor<T,S,E> processor)
      Instantiates a new container handler.
      Parameters:
      beanClass - the bean class
      metaAnnotation - the meta annotation
      annotation - the annotation
      processor - the processor
  • Method Details

    • getOrder

      public int getOrder()
      Specified by:
      getOrder in interface org.springframework.core.Ordered
    • getMetaAnnotation

      public T getMetaAnnotation()
      Gets the meta annotation.
      Returns:
      the meta annotation
    • getAnnotation

      public Annotation getAnnotation()
      Gets the annotation.
      Returns:
      the annotation
    • getBeanClass

      public Class<?> getBeanClass()
      Gets the bean class.
      Returns:
      the bean class
    • setOrder

      public void setOrder(int order)
      Sets the order used get value from getOrder(). Default value is Ordered.LOWEST_PRECEDENCE.
      Parameters:
      order - the new order
    • handle

      public Object handle(StateMachineRuntime<S,E> stateMachineRuntime)
      Handle container using a StateMachineRuntimeProcessor.
      Parameters:
      stateMachineRuntime - the state machine runtime
      Returns:
      the result value
    • toString

      public String toString()
      Overrides:
      toString in class Object