Package com.tangosol.util.fsm
Class NonBlockingFiniteStateMachine.DelayedTransitionTo<S extends Enum<S>>
java.lang.Object
com.tangosol.util.fsm.NonBlockingFiniteStateMachine.DelayedTransitionTo<S>
- All Implemented Interfaces:
Event<S>,Instruction
- Enclosing class:
NonBlockingFiniteStateMachine<S extends Enum<S>>
public static class NonBlockingFiniteStateMachine.DelayedTransitionTo<S extends Enum<S>>
extends Object
implements Instruction, Event<S>
A
NonBlockingFiniteStateMachine.DelayedTransitionTo is a specialized Instruction for
NonBlockingFiniteStateMachines that enables a StateEntryAction to request a delayed transition to another state,
unlike a Instruction.TransitionTo Instruction which occurs
immediately.- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.tangosol.util.fsm.Instruction
Instruction.ProcessEvent<S extends Enum<S>>, Instruction.TransitionTo<S extends Enum<S>> -
Field Summary
Fields inherited from interface com.tangosol.util.fsm.Instruction
NOTHING, STOP -
Constructor Summary
ConstructorsConstructorDescriptionDelayedTransitionTo(S desiredState) Constructs aNonBlockingFiniteStateMachine.DelayedTransitionTowithout a specified time (to be schedule as soon as possible).DelayedTransitionTo(S desiredState, long lDuration, TimeUnit timeUnit) Constructs aNonBlockingFiniteStateMachine.DelayedTransitionTowith the specified time. -
Method Summary
Modifier and TypeMethodDescriptiongetDesiredState(S currentState, ExecutionContext context) Determines the desired state of theFiniteStateMachinefor theEventgiven the current state of theFiniteStateMachine.longObtains the amount of time to wait before the transition to the desired state should occurObtains theTimeUnitfor thegetDuration()
-
Constructor Details
-
DelayedTransitionTo
Constructs aNonBlockingFiniteStateMachine.DelayedTransitionTowithout a specified time (to be schedule as soon as possible).- Parameters:
desiredState- the desired state to which to transition
-
DelayedTransitionTo
Constructs aNonBlockingFiniteStateMachine.DelayedTransitionTowith the specified time.- Parameters:
desiredState- the desired state to which to transitionlDuration- the amount of time to wait before the desired transition should occurtimeUnit- the unit of time measure
-
-
Method Details
-
getDesiredState
Determines the desired state of theFiniteStateMachinefor theEventgiven the current state of theFiniteStateMachine.- Specified by:
getDesiredStatein interfaceEvent<S extends Enum<S>>- Parameters:
currentState- the current state of theFiniteStateMachinecontext- theExecutionContextfor theEvent- Returns:
- the desired state of the
FiniteStateMachineornullif no transition is required
-
getDuration
public long getDuration()Obtains the amount of time to wait before the transition to the desired state should occur- Returns:
- the amount of time in the
getTimeUnit()
-
getTimeUnit
Obtains theTimeUnitfor thegetDuration()- Returns:
- the
TimeUnit
-