All Packages Class Hierarchy This Package Previous Next Index
Class uhr.core.cell.Lifecycle
java.lang.Object
|
+----uhr.core.cell.Lifecycle
- public class Lifecycle
- extends Object
- implements StateCommandable,
PartUser
This class handles a cell's lifecycle, a formidable task made
easier by cell design and the StateCommandableAide.
IMPLEMENTATION IN PROGRESS.
-
Lifecycle()
-
-
doStateCommand(String)
- Performs the command if its present state allows it.
-
getPartNamesNeeded()
- Returns an array of the part names this part needs to
do its work.
-
getStateCommandableAide()
- Returns the aide handling the StateCommandable's state manchine.
-
isStarted()
- Returns true if the cell is started or false if not.
-
setPart(String,
Object)
- Sets a named part, in response to part needs.
-
start()
- Attempts to start the cell by issuing the Start command.
Lifecycle
public Lifecycle()
getStateCommandableAide
public StateCommandableAide getStateCommandableAide()
- Returns the aide handling the StateCommandable's state manchine.
- Returns:
- the very handy aide.
doStateCommand
public void doStateCommand(String command)
- Performs the command if its present state allows it.
- Parameters:
- command - the command to perform. It must be in the
published list of commands available.
- Throws: IllegalArgumentException
- if unknown command.
- Throws: IllegalStateException
- if not in proper state to
perform the command. Gee, this is precise. :-)
- Throws: RuntimeException
- or such if the command fails.
getPartNamesNeeded
public String[] getPartNamesNeeded()
- Returns an array of the part names this part needs to
do its work. These are "core.CellDK".
- Returns:
- the names of the parts needed.
setPart
public void setPart(String name,
Object part)
- Sets a named part, in response to part needs. This implementation
supports needed part replacement anytime. See the PartUser
interface for further documentation.
- Parameters:
- name - the name of the needed part.
- part - the needed part.
isStarted
public boolean isStarted()
- Returns true if the cell is started or false if not. If started
then the current state is Running or Paused.
- Returns:
- true if started or false if not.
start
public void start()
- Attempts to start the cell by issuing the Start command. This
will work if the current state is Created or Initialized, ir
isStarted() returns false..
All Packages Class Hierarchy This Package Previous Next Index