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.


Constructor Index

 o Lifecycle()

Method Index

 o doStateCommand(String)
Performs the command if its present state allows it.
 o getPartNamesNeeded()
Returns an array of the part names this part needs to do its work.
 o getStateCommandableAide()
Returns the aide handling the StateCommandable's state manchine.
 o isStarted()
Returns true if the cell is started or false if not.
 o setPart(String, Object)
Sets a named part, in response to part needs.
 o start()
Attempts to start the cell by issuing the Start command.

Constructors

 o Lifecycle
 public Lifecycle()

Methods

 o getStateCommandableAide
 public StateCommandableAide getStateCommandableAide()
Returns the aide handling the StateCommandable's state manchine.

Returns:
the very handy aide.
 o 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.
 o 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.
 o 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.
 o 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.
 o 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