Class JavaWebStartState


  • public class JavaWebStartState
    extends Object
    Models the state (and transitions) related to Java Web Start support of app clients for a given client.

    As an app is enabled, disabled, suspended, or resumed, the state of how Java Web Start should respond is different. What transitions are permitted in each state is also enforced.

    Implementation note: I tried recording the valid transitions (action plus new state) as part of the state value definitions themselves in the enum. This did not seem to work; in any JavaWebStartState.Transition values for earlier states, references to states defined later in the enum were null! It's probably a little cleaner design to keep the states and the set of valid transitions separate from each other anyway.

    Author:
    tjquinn
    • Constructor Detail

      • JavaWebStartState

        public JavaWebStartState()
    • Method Detail

      • transition

        public void transition​(JavaWebStartState.Action action,
                               Runnable task)
        Records a transition to the new state that is implied by the current state and the specified action, executing the associated task as part of the transition (if the transition is valid).

        The specified action must match a valid transition from the current state.

        Parameters:
        action - the Action the server is notifying us about
        task - the work to perform
      • isRunning

        public boolean isRunning()
        Reports whether the state represents a "running" condition.
        Returns:
      • isSuspended

        public boolean isSuspended()
        Reports whether the state represents a "suspended" condition.
        Returns: