OPERAND
- The object type on which this state machine operates.STATE
- The state of the entity.EVENTTYPE
- The external eventType to be handled.EVENT
- The event object.@InterfaceAudience.Public @InterfaceStability.Evolving public final class StateMachineFactory<OPERAND,STATE extends Enum<STATE>,EVENTTYPE extends Enum<EVENTTYPE>,EVENT> extends Object
Constructor and Description |
---|
StateMachineFactory(STATE defaultInitialState)
Constructor
This is the only constructor in the API.
|
public StateMachineFactory(STATE defaultInitialState)
public StateMachineFactory<OPERAND,STATE,EVENTTYPE,EVENT> addTransition(STATE preState, STATE postState, EVENTTYPE eventType)
preState
- pre-transition statepostState
- post-transition stateeventType
- stimulus for the transitionthis
with the current
transition added as a new legal transition. This overload
has no hook object.
Note that the returned StateMachineFactory is a distinct
object.
This method is part of the API.public StateMachineFactory<OPERAND,STATE,EVENTTYPE,EVENT> addTransition(STATE preState, STATE postState, Set<EVENTTYPE> eventTypes)
preState
- pre-transition statepostState
- post-transition stateeventTypes
- List of stimuli for the transitionsthis
with the current
transition added as a new legal transition. This overload
has no hook object.
Note that the returned StateMachineFactory is a distinct
object.
This method is part of the API.public StateMachineFactory<OPERAND,STATE,EVENTTYPE,EVENT> addTransition(STATE preState, STATE postState, Set<EVENTTYPE> eventTypes, SingleArcTransition<OPERAND,EVENT> hook)
preState
- pre-transition statepostState
- post-transition stateeventTypes
- List of stimuli for the transitionshook
- transition hookthis
with the current
transition added as a new legal transition
Note that the returned StateMachineFactory is a distinct
object.
This method is part of the API.public StateMachineFactory<OPERAND,STATE,EVENTTYPE,EVENT> addTransition(STATE preState, STATE postState, EVENTTYPE eventType, SingleArcTransition<OPERAND,EVENT> hook)
preState
- pre-transition statepostState
- post-transition stateeventType
- stimulus for the transitionhook
- transition hookthis
with the current
transition added as a new legal transition
Note that the returned StateMachineFactory is a distinct object.
This method is part of the API.public StateMachineFactory<OPERAND,STATE,EVENTTYPE,EVENT> addTransition(STATE preState, Set<STATE> postStates, EVENTTYPE eventType, MultipleArcTransition<OPERAND,EVENT,STATE> hook)
preState
- pre-transition statepostStates
- valid post-transition stateseventType
- stimulus for the transitionhook
- transition hookthis
with the current
transition added as a new legal transition
Note that the returned StateMachineFactory is a distinct object.
This method is part of the API.public StateMachineFactory<OPERAND,STATE,EVENTTYPE,EVENT> installTopology()
this
, except that if
you won't need any synchronization to build a state machine
Note that the returned StateMachineFactory is a distinct object.
This method is part of the API.
The only way you could distinguish the returned
StateMachineFactory from this
would be by
measuring the performance of the derived
StateMachine
you can get from it.
Calling this is optional. It doesn't change the semantics of the factory,
if you call it then when you use the factory there is no synchronization.public StateMachine<STATE,EVENTTYPE,EVENT> make(OPERAND operand, STATE initialState, StateTransitionListener<OPERAND,EVENT,STATE> listener)
operand
- the object upon which the returned
StateMachine
will operate.initialState
- the state in which the returned
StateMachine
will start.listener
- An implementation of a StateTransitionListener
.public StateMachine<STATE,EVENTTYPE,EVENT> make(OPERAND operand)
public org.apache.hadoop.yarn.state.Graph generateStateGraph(String name)
name
- graph nameCopyright © 2021 Apache Software Foundation. All rights reserved.