Package com.github.kabal163.statemachine
Class LifecycleManagerImpl
- java.lang.Object
-
- com.github.kabal163.statemachine.LifecycleManagerImpl
-
- All Implemented Interfaces:
LifecycleManager
public class LifecycleManagerImpl extends Object implements LifecycleManager
-
-
Constructor Summary
Constructors Constructor Description LifecycleManagerImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TransitionResult
execute(StatefulObject statefulObject, String event)
Executes a transition of the stateful object according the event.TransitionResult
execute(StatefulObject statefulObject, String event, Map<String,Object> variables)
Executes a transition of the stateful object according the event.void
init()
-
-
-
Method Detail
-
init
public void init()
-
execute
public TransitionResult execute(StatefulObject statefulObject, String event)
Description copied from interface:LifecycleManager
Executes a transition of the stateful object according the event.- Specified by:
execute
in interfaceLifecycleManager
- Parameters:
statefulObject
- an object which state should be changed with corresponding actions executionevent
- a signal which helps to define the target state- Returns:
TransitionResult
transition result containing information about executed transition
-
execute
public TransitionResult execute(StatefulObject statefulObject, String event, Map<String,Object> variables)
Description copied from interface:LifecycleManager
Executes a transition of the stateful object according the event. The method contains an additional map of variables which is used in the actions and conditions during a transition.- Specified by:
execute
in interfaceLifecycleManager
- Parameters:
statefulObject
- an object which state should be changed with corresponding actions executionevent
- a signal which helps to define the target statevariables
- any external data which is necessary during transition performance- Returns:
TransitionResult
transition result containing information about executed transition
-
-