public class FiniteStateMachine.Transition extends Object implements Closeable
FiniteStateMachine. Note if this handle is lost the
FiniteStateMachine will likely go into an invalid state.| Modifier and Type | Method and Description |
|---|---|
void |
changeEndState(T endState)
Change the end state of the transition.
|
void |
close()
Close the current transition moving the
FiniteStateMachine to the end state and releasing all locks. |
void |
closeWithoutCallbacks()
Close the current transition moving the
FiniteStateMachine to the end state and releasing all locks without
calling any callbacks. |
T |
getStartState()
Get the state at the beginning of this transition.
|
void |
switchEndStateToErrorState()
Change the end state of the transition to the FSM error state.
|
public T getStartState()
public void changeEndState(T endState) throws FiniteStateMachine.UnallowedTransitionException
FiniteStateMachine.Transition was created.FiniteStateMachine.UnallowedTransitionException - if the new end state is not an allowed transition.public void switchEndStateToErrorState()
public void close()
throws FiniteStateMachine.FailedTransitionCallbackException
FiniteStateMachine to the end state and releasing all locks.close in interface Closeableclose in interface AutoCloseableFiniteStateMachine.FailedTransitionCallbackException - when start or end state callbacks fail. Note if this exception is thrown
the transition is not complete and the error must be handled to complete it.public void closeWithoutCallbacks()
FiniteStateMachine to the end state and releasing all locks without
calling any callbacks. This method should only be called after a close() has failed and the failure
cannot be handled.