public abstract class AcsDoActivity
extends java.lang.Object
Implementation note: uses a single instance of ExecutorService
for cheaply reusing a thread in execute() for all do activities.
| Constructor and Description |
|---|
AcsDoActivity(java.lang.String name,
AcsSimpleState nextState,
AcsSimpleState errorState,
AcsLogger logger,
java.util.concurrent.ThreadPoolExecutor executor) |
| Modifier and Type | Method and Description |
|---|---|
void |
execute()
Runs
runActions() in a separate thread and returns immediately. |
abstract void |
runActions()
Must call the action methods associated with this activity.
|
void |
terminateActions()
Terminates the actions if they are still running.
|
public AcsDoActivity(java.lang.String name,
AcsSimpleState nextState,
AcsSimpleState errorState,
AcsLogger logger,
java.util.concurrent.ThreadPoolExecutor executor)
name - name for the activitynextState - 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.public void execute()
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.public abstract void runActions()
throws AcsStateActionException
AcsStateActionExceptionpublic void terminateActions()