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.

References m_completed, m_errorState, m_name, and m_nextState.


Member Function Documentation

void alma::acs::genfw::runtime::sm::AcsDoActivity::execute (  )  [inline]
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 

References alma::acs::logging::AcsLogger::log(), and logger.

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

Must call the action methods associated with this activity.

Referenced by execute().

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

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 ?

Referenced by execute(), and terminateActions().

Referenced by AcsDoActivity(), and execute().

Referenced by AcsDoActivity(), and execute().


The documentation for this class was generated from the following file:

Generated by  doxygen 1.6.2