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
NonBlockingFiniteStateMachine
s 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
ConstructorDescriptionDelayedTransitionTo
(S desiredState) Constructs aNonBlockingFiniteStateMachine.DelayedTransitionTo
without a specified time (to be schedule as soon as possible).DelayedTransitionTo
(S desiredState, long lDuration, TimeUnit timeUnit) Constructs aNonBlockingFiniteStateMachine.DelayedTransitionTo
with the specified time. -
Method Summary
Modifier and TypeMethodDescriptiongetDesiredState
(S currentState, ExecutionContext context) Determines the desired state of theFiniteStateMachine
for theEvent
given the current state of theFiniteStateMachine
.long
Obtains the amount of time to wait before the transition to the desired state should occurObtains theTimeUnit
for thegetDuration()
-
Constructor Details
-
DelayedTransitionTo
Constructs aNonBlockingFiniteStateMachine.DelayedTransitionTo
without a specified time (to be schedule as soon as possible).- Parameters:
desiredState
- the desired state to which to transition
-
DelayedTransitionTo
Constructs aNonBlockingFiniteStateMachine.DelayedTransitionTo
with 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 theFiniteStateMachine
for theEvent
given the current state of theFiniteStateMachine
.- Specified by:
getDesiredState
in interfaceEvent<S extends Enum<S>>
- Parameters:
currentState
- the current state of theFiniteStateMachine
context
- theExecutionContext
for theEvent
- Returns:
- the desired state of the
FiniteStateMachine
ornull
if 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 theTimeUnit
for thegetDuration()
- Returns:
- the
TimeUnit
-