S
- the type of stateE
- the type of eventpublic class DistributedLeaderAction<S,E> extends java.lang.Object implements Action<S,E>
Action
which is used to wrap execution of an Action
so that only a StateMachine
considered to be a leader in an
StateMachineEnsemble
will do the execution.
Executing action via DistributedLeaderAction
is bound to if
current machine is a leader or not. Effectively this means that if
leader doesn't exist, execution is discarded.Constructor and Description |
---|
DistributedLeaderAction(Action<S,E> action,
StateMachineEnsemble<S,E> ensemble)
Instantiates a new distributed leader action.
|
Modifier and Type | Method and Description |
---|---|
void |
execute(StateContext<S,E> context)
Execute action with a
StateContext . |
public void execute(StateContext<S,E> context)
Action
StateContext
.