Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

alma::acs::genfw::runtime::sm::AcsDoActivity Class Reference

Collaboration diagram for alma::acs::genfw::runtime::sm::AcsDoActivity:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 AcsDoActivity (String name, AcsSimpleState nextState, AcsSimpleState errorState, AcsLogger logger, ThreadPoolExecutor executor)
void execute ()
abstract void runActions () throws AcsStateActionException
void terminateActions ()

Package Functions

void logActionFailure (String sourceStateName, String targetStateName, String actionName, Throwable thr)

Private Attributes

final AcsSimpleState m_nextState
final AcsSimpleState m_errorState
final String m_name
final AcsLogger logger
final ThreadPoolExecutor executor
volatile boolean m_completed

Detailed Description

Represents an Activity in state (do-activity).

Implementation note: uses a single instance of ExecutorService for cheaply reusing a thread in execute() for all do activities.

Author:
hsommer created Apr 29, 2004 3:55:28 PM


Constructor & Destructor Documentation

alma::acs::genfw::runtime::sm::AcsDoActivity::AcsDoActivity String  name,
AcsSimpleState  nextState,
AcsSimpleState  errorState,
AcsLogger  logger,
ThreadPoolExecutor  executor
[inline]
 

Parameters:
name name for the activity
nextState state to which the implicit "completion transition" will go.
errorState error state to which we'll go in case of errors.
logger Logger used by this class.
threadFactory The thread factory used for asynchronous execution of the runActions() method.


Member Function Documentation

void alma::acs::genfw::runtime::sm::AcsDoActivity::execute  )  [inline]
 

Runs runActions() in a separate thread and returns immediately. When the actions are completed, a transition to the next state is triggered, as specified in the constructor.

void alma::acs::genfw::runtime::sm::AcsDoActivity::logActionFailure String  sourceStateName,
String  targetStateName,
String  actionName,
Throwable  thr
[inline, package]
 

Parameters:
sourceStateName beginning of transition, or activity state
targetStateName end of transition, or null if the action comes from the do/ method of an activity state.
actionName 

abstract void alma::acs::genfw::runtime::sm::AcsDoActivity::runActions  )  throws AcsStateActionException [pure virtual]
 

Must call the action methods associated with this activity.

void alma::acs::genfw::runtime::sm::AcsDoActivity::terminateActions  )  [inline]
 

Terminates the actions if they are still running.


Member Data Documentation

final ThreadPoolExecutor alma::acs::genfw::runtime::sm::AcsDoActivity::executor [private]
 

not actually used as a queue, but simply to wrap and reuse a Thread, since only one do-action method is supposed to run at a time in a non-concurrent state machine. todo: or maybe it's a queue, if a composite (super) state also has a /do method ?

final AcsLogger alma::acs::genfw::runtime::sm::AcsDoActivity::logger [private]
 

volatile boolean alma::acs::genfw::runtime::sm::AcsDoActivity::m_completed [private]
 

final AcsSimpleState alma::acs::genfw::runtime::sm::AcsDoActivity::m_errorState [private]
 

final String alma::acs::genfw::runtime::sm::AcsDoActivity::m_name [private]
 

final AcsSimpleState alma::acs::genfw::runtime::sm::AcsDoActivity::m_nextState [private]
 


The documentation for this class was generated from the following file:
Generated on Thu Apr 30 02:52:56 2009 for ACS Java API by doxygen 1.3.8