| java.lang.Object de.danet.an.workflow.tools.util.SimpleApplicationDirectoryEJB
SimpleApplicationDirectoryEJB | public class SimpleApplicationDirectoryEJB implements SessionBean(Code) | | This EJB provides a directory for simple applications. Applications
are considered simple in this context if their state can
efficiently be represented (and stored) using a single serializable
object.
This directory maps a unique id to the activity unique key
information of the executing activity and an associated state (and
vice versa). Optionally, the assignment time and an assigned
resource may be saved in this directory as well.
See Also: de.danet.an.workflow.util author: Michael Lipp version: $Revision: 1.15 $ |
Constructor Summary | |
public | SimpleApplicationDirectoryEJB() Creates an instance of SimpleApplicationDirectoryEJB
with all attributes initialized to default values. |
Method Summary | |
public void | ejbActivate() Not called for stateless session beans. | public void | ejbCreate() Create a new EJB. | public void | ejbPassivate() Not called for stateless session beans. | public void | ejbRemove() Remove this EJB. | public SimpleApplicationInfo | infoByActivity(ActivityUniqueKey auk) Return the information associated with the activity. | public Collection | infosByApplication(String applName) Return infos associated with a given application. | public Collection | infosByKey(String applName, String applInstKey) Return the infos associated with the given application name and key. | public Collection | infosByResource(String applName, String resourceKey) Return infos associated with a given application and resource. | public SimpleApplicationInfo | instanceInfo(long instId) Return the information associated with the application instance. | public long | registerInstance(String applName, Activity activity, Object state, boolean saveAssignment) Register a new application instance. | public long | registerInstance(String applName, String applInstKey, Activity activity, Object state, boolean saveAssignment) Register a new application instance. | public void | removeInstance(long instId) Remove an application instance. | public void | setSessionContext(SessionContext context) Save the session context asigned by the container. | public void | updateInvokingActivity(long instId, ActivityUniqueKey auk) Update the activity associated with the given application
instance. | public void | updateState(long instId, Object state) Update the state information associated with the given
application instance id. |
SimpleApplicationDirectoryEJB | public SimpleApplicationDirectoryEJB()(Code) | | Creates an instance of SimpleApplicationDirectoryEJB
with all attributes initialized to default values.
|
ejbActivate | public void ejbActivate() throws EJBException(Code) | | Not called for stateless session beans.
See Also: javax.ejb.SessionBean |
ejbCreate | public void ejbCreate() throws CreateException(Code) | | Create a new EJB.
throws: CreateException - if creation fails |
ejbPassivate | public void ejbPassivate() throws EJBException(Code) | | Not called for stateless session beans.
See Also: javax.ejb.SessionBean |
ejbRemove | public void ejbRemove()(Code) | | Remove this EJB.
|
infosByApplication | public Collection infosByApplication(String applName)(Code) | | Return infos associated with a given application.
Parameters: applName - the application name the infos as collection |
infosByKey | public Collection infosByKey(String applName, String applInstKey) throws InvalidKeyException(Code) | | Return the infos associated with the given application name and key.
Parameters: applName - the application name Parameters: applInstKey - the key associated with the instance the infos or an empty collection if no infoswith the given application name and key exist |
infosByResource | public Collection infosByResource(String applName, String resourceKey)(Code) | | Return infos associated with a given application and resource.
Parameters: applName - the application name Parameters: resourceKey - the resource's key the infos as collection |
registerInstance | public long registerInstance(String applName, String applInstKey, Activity activity, Object state, boolean saveAssignment)(Code) | | Register a new application instance. This method returns a unique
key that may be used to
Parameters: applName - the application name Parameters: applInstKey - an arbitrary key for this instance, up to 1000characters long Parameters: activity - the invoking activity Parameters: state - the application state Parameters: saveAssignment - if true the assignedresource will be saved to allow searching application instanceswith a particular assignee the instance id |
setSessionContext | public void setSessionContext(SessionContext context)(Code) | | Save the session context asigned by the container.
Parameters: context - the context |
updateInvokingActivity | public void updateInvokingActivity(long instId, ActivityUniqueKey auk) throws InvalidKeyException(Code) | | Update the activity associated with the given application
instance. This is useful if an application instance is started
by one tool (agent) invocation and stopped by another.
Be careful to ensure the eventual termination of the
application. If the creating activity has completed, the
terminate method of the tool agent that started the application
will not be called on abnormal process completion. So, if a
process is terminated abnormally and the starting activity is
closed and the stopping activity has not yet been started (and
associated with the application) the application will not be
stopped. This should normally not be a problem for simple
applications.
As a convenience, any application information that is still
registered after a process completion will automatically be
deleted.
The new activity must belong to the same process as the
activity that initially created the application instance.
Parameters: instId - the application instance id previously assignedby SimpleApplicationDirectoryEJB.registerInstance registerInstance Parameters: auk - the new activity's unique key. May benull if the application instance is temporarilynot associated with an activity. throws: InvalidKeyException - if there is no application instancewith the given id |
|
|