Class TimeoutTransition<E>

  • Type Parameters:
    E - The type of events the FSM processes.

    public class TimeoutTransition<E>
    extends Transition<E>
    A timeout transition is an FSM transition that is not executed by an event: the FSM goes through such a transition on a timeout.
    • Field Detail

      • TIMEOUT_THREAD_NAME_BASE

        public static final String TIMEOUT_THREAD_NAME_BASE
        The base name (starts with) of the threads created for the timeout.
        See Also:
        Constant Field Values
    • Constructor Detail

      • TimeoutTransition

        public TimeoutTransition​(OutputState<E> srcState,
                                 InputState<E> tgtState,
                                 LongSupplier timeout)
        Creates the timeout transition.
        Parameters:
        srcState - The source state of the transition.
        tgtState - The output state of the transition.
        timeout - The function that returns the timeout value in ms.
        Throws:
        IllegalArgumentException - If one of the states is null.
    • Method Detail

      • startTimeout

        public void startTimeout()
        Launches the timer.
      • stopTimeout

        public void stopTimeout()
        Stops the timer.
      • accept

        protected boolean accept​(E event)
        Specified by:
        accept in class Transition<E>