All Packages Class Hierarchy This Package Previous Next Index
Class uhr.core.role.StateCommandableAideFactory
java.lang.Object
|
+----uhr.core.role.StateCommandableAideFactory
- public class StateCommandableAideFactory
- extends Object
This is a factory for StateCommandableAides. The advantage is
the aides created already have the desired StateMachine. This
allows more concise StateCommandable implementations and more
StateMachine reuse.
The factory comes with several popular built in StateMachines.
More may be added to suit your domain. The built in ones are:
ID = RunTest, no propogated commands.
Transitions - State, Command, NewState
1. Created, RunTest, Running
ID = Start, no propogated commands.
Transitions - State, Command, NewState
1. Created, Start, Running
-
StateCommandableAideFactory()
-
-
addStateMachine(String, StateMachine)
- Adds the state machine to the factory using the id.
-
createAide(String)
- Creates an aide with the StateMachine having the id.
-
createAide(String, StateCommandable)
- Creates an aide with the StateMachine having the id, and the
commandable.
-
enumerateStateMachineIDs()
- Returns an enumeration of all the StateMachine ids in the factory.
-
getStateMachine(String)
- Returns the StateMachine for the id or null if none.
StateCommandableAideFactory
public StateCommandableAideFactory()
createAide
public static StateCommandableAide createAide(String stateMachineID)
- Creates an aide with the StateMachine having the id.
- Parameters:
- stateMachineID - identifies the StateMachine to use.
- Returns:
- a new aide.
- Throws: IllegalStateException
- if no StateMachine with the id
has been added to the factory.
createAide
public static StateCommandableAide createAide(String stateMachineID,
StateCommandable commandable)
- Creates an aide with the StateMachine having the id, and the
commandable.
- Parameters:
- stateMachineID - identifies the StateMachine to use.
- commandable - the aide's StateCommandable.
- Returns:
- a new aide.
- Throws: IllegalStateException
- if no StateMachine with the id
has been added to the factory.
addStateMachine
public static void addStateMachine(String id,
StateMachine machine)
- Adds the state machine to the factory using the id.
- Parameters:
- id - the machine identifier, unique to this factory.
- machine - the state machine to be added.
- Throws: IllegalStateException
- if the id has already been added.
enumerateStateMachineIDs
public static Enumeration enumerateStateMachineIDs()
- Returns an enumeration of all the StateMachine ids in the factory.
- Returns:
- the ids in no particular order.
getStateMachine
public static StateMachine getStateMachine(String id)
- Returns the StateMachine for the id or null if none.
- Parameters:
- id - the id to use to lookup the StateMachine added with the id.
- Returns:
- the StateMachine with the id or null if none.
All Packages Class Hierarchy This Package Previous Next Index