Class SimpleApplicationAgent

All Implemented Interfaces:

public abstract class SimpleApplicationAgent
extends java.lang.Object
implements ToolAgent

This is a base class for writing agents for applications that have a life cycle exceeding a single tool agent invocation, and have only state information that can efficiently be persisted as a binary large object in an RDBMs.

An example for such an application is the wait tool (see User Manual). A wait tool (or "wait application") is created by one tool agent invocation. Then another tool agent invocation waits for the completion of the wait, while yet another tool agent invocation may cause the wait tool to complete prematurely. The wait tool has state that is controlled by the tool agents and a timer provided by the enviroment. Its state is therefore completely serializable (no open sockets, tool controlled threads etc.).

This base class mainly provides access to the application directory that does all the important work.

$Revision: 1607 $
Michael Lipp

Constructor Summary
          Creates an instance of SimpleApplicationAgent with all attributes initialized to default values.
Method Summary
protected  SimpleApplicationDirectoryLocal applicationDirectory()
          Return the application directory.
 void terminate(Activity activity)
          Terminates execution of the given activity.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface

Constructor Detail


public SimpleApplicationAgent()
Creates an instance of SimpleApplicationAgent with all attributes initialized to default values.

Method Detail


protected SimpleApplicationDirectoryLocal applicationDirectory()
Return the application directory.

the application directory
Throws: - if an application directory EJB cannot be instantiated


public void terminate(Activity activity)
               throws ApplicationNotStoppedException,
Terminates execution of the given activity. This base implementation simply removes the application instance fom the application directory.

Specified by:
terminate in interface ToolAgent
activity - the activity to be canceled
ApplicationNotStoppedException - if execution cannot be terminated (see ApplicationNotStoppedException). workflow engine should retry the tool invocation
java.rmi.RemoteException - if a temporary problem occurs and the workflow engine should retry the tool invocation