Class JavaWebStartState
- java.lang.Object
-
- org.glassfish.appclient.server.core.jws.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
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
JavaWebStartState.Action
Possible actions the server can tell us about.
-
Constructor Summary
Constructors Constructor Description JavaWebStartState()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
isRunning()
Reports whether the state represents a "running" condition.boolean
isSuspended()
Reports whether the state represents a "suspended" condition.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).
-
-
-
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 abouttask
- 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:
-
-