Class StateMachineHandler<T extends Annotation,S,E>
java.lang.Object
org.springframework.statemachine.processor.StateMachineHandler<T,S,E>
- Type Parameters:
T
- the type of annotationS
- the type of stateE
- 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
-
Field Summary
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
-
Constructor Summary
ConstructorDescriptionStateMachineHandler
(Class<?> beanClass, Object target, Method method, T metaAnnotation, Annotation annotation) Instantiates a new container handler.StateMachineHandler
(Class<?> beanClass, Object target, String methodName, T metaAnnotation, Annotation annotation) Instantiates a new container handler.StateMachineHandler
(Class<?> beanClass, T metaAnnotation, Annotation annotation, MethodInvokingStateMachineRuntimeProcessor<T, S, E> processor) Instantiates a new container handler. -
Method Summary
Modifier and TypeMethodDescriptionGets the annotation.Class<?>
Gets the bean class.Gets the meta annotation.int
getOrder()
handle
(StateMachineRuntime<S, E> stateMachineRuntime) Handle container using aStateMachineRuntimeProcessor
.void
setOrder
(int order) Sets the order used get value fromgetOrder()
.toString()
-
Constructor Details
-
StateMachineHandler
public StateMachineHandler(Class<?> beanClass, Object target, Method method, T metaAnnotation, Annotation annotation) Instantiates a new container handler.- Parameters:
beanClass
- the bean classtarget
- the target beanmetaAnnotation
- the meta annotationannotation
- the annotationmethod
- the method
-
StateMachineHandler
public StateMachineHandler(Class<?> beanClass, Object target, String methodName, T metaAnnotation, Annotation annotation) Instantiates a new container handler.- Parameters:
beanClass
- the bean classtarget
- the target beanmethodName
- the method namemetaAnnotation
- the meta annotationannotation
- 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 classmetaAnnotation
- the meta annotationannotation
- the annotationprocessor
- the processor
-
-
Method Details
-
getOrder
public int getOrder()- Specified by:
getOrder
in interfaceorg.springframework.core.Ordered
-
getMetaAnnotation
Gets the meta annotation.- Returns:
- the meta annotation
-
getAnnotation
Gets the annotation.- Returns:
- the annotation
-
getBeanClass
Gets the bean class.- Returns:
- the bean class
-
setOrder
public void setOrder(int order) Sets the order used get value fromgetOrder()
. Default value isOrdered.LOWEST_PRECEDENCE
.- Parameters:
order
- the new order
-
handle
Handle container using aStateMachineRuntimeProcessor
.- Parameters:
stateMachineRuntime
- the state machine runtime- Returns:
- the result value
-
toString
-