|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.objectweb.jass.as.ActivityService
Implements the access interface to the AS (UserActivity) available to HLSs.
Field Summary | |
static java.lang.String |
CHILDLIFETIME_SS_NAME
|
static int |
DEFAULT_TIMEOUT
|
static java.lang.String |
SYNCHRONIZATION_SS_NAME
|
Constructor Summary | |
ActivityService()
Default Constructor. |
Method Summary | |
void |
associateActivityToCurrentThread(ActivityCoordinator activity)
|
void |
begin(int timeout)
Create a new Activity and associate it with the current thread. |
Outcome |
broadcast(java.lang.String signalSetName)
Causes the SignalSet specified by signalSetName to start producing signals for all registered Actions. |
Outcome |
complete()
Causes the active Activity context to be completed with its current CompletionStatus. |
Outcome |
completeWithStatus(int completionStatus)
Causes the active Activity context to complete with the specified CompletionStatus. |
ActivityCoordinator |
disassociateActivityFromCurrentThread()
|
void |
forget(GlobalId globalId)
NOT YET IMPLEMENTED |
int |
getCompletionStatus()
Returns the current value of the CompletionStatus of the active Activity. |
ActivityCoordinator |
getCoordinator()
Returns the ActivityCoordinator of the active Activity, or null if there is no Activity associated with the calling thread. |
GlobalId |
getGlobalId()
Returns the GlobalId of the active Activity. |
static int |
getInstances()
|
java.lang.String |
getName()
Returns a printable string describing the active Activity. |
int |
getNumberOfActivities()
Return the number of activities in the activities HashMap. |
ActivityCoordinator |
getParentCoordinator()
Returns the ActivityCoordinator of the parent of the active Activity, or null if the active Activity is a top-level Activity. |
PropertyGroup |
getPropertyGroup(java.lang.String name)
NOT YET IMPLEMENTED |
ServiceManager |
getService()
Returns the registered ServiceManager for this UserActivity instance. |
int |
getStatus()
Returns the current value of the Status of the active Activity. |
int |
getTimeout()
Returns the default timeout value. |
GlobalId |
hibernate()
Not yet implemented. |
void |
linkActivityToId(java.lang.String actId,
ActivityCoordinator activity)
|
void |
reactivate(GlobalId globalId)
Not yet implemented. |
GlobalId[] |
recover()
NOT YET IMPLEMENTED |
ActivityCoordinator |
recreate(GlobalId activity,
GlobalId parent,
boolean resume)
NOT YET IMPLEMENTED |
void |
registerService(ServiceManager service)
Registers a ServiceManager for the type of high-level service (HLS) whose activities are to be demarcated through the target UserActivity instance. |
void |
resume(ActivityToken activityToken)
Resumes the association of the Activity, and any nested Activities and transactions, represented by the ActivityToken with the calling thread of execution. |
void |
resumeAll(ActivityToken activityToken)
Not yet implemented. |
void |
resumeGroup(ActivityToken activityToken)
Not yet implemented. |
static void |
setActivityIdGenerator(ActivityIdGenerator generator)
Sets the Activity Id Generator for all Activity Service instances. |
void |
setCompletionStatus(int completionStatus)
OK Sets the CompletionStatus of the active Activity. |
void |
setTimeout(int timeout)
Sets the default timeout, in seconds, after which an Activity may be automatically completed by the Activity service. |
ActivityToken |
suspend()
Suspends the association of the current Activity from the calling thread of execution along with any child Activities of the same ContextGroup nested within that Activity. |
ActivityToken |
suspendAll()
Not yet implemented. |
ActivityToken |
suspendGroup()
Not yet implemented. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static int DEFAULT_TIMEOUT
public static java.lang.String SYNCHRONIZATION_SS_NAME
public static java.lang.String CHILDLIFETIME_SS_NAME
Constructor Detail |
public ActivityService()
Method Detail |
public void begin(int timeout) throws InvalidStateException, ServiceNotRegisteredException, TimeoutRangeException, SystemException
begin
in interface UserActivity
timeout
- - the period (in seconds) within which the Activity
must be completed. If it is not completed within this period then
it is subject to being completed by the Activity service with
the CompletionStatusFail status.
InvalidStateException
- - Thrown if the parent Activity has
been marked as CompletionStatusFailOnly.
ServiceNotRegisteredException
- - Thrown if no ServiceManager
has been registered.
TimeoutRangeException
- - Thrown if timeout is less than -1 or
if it is outside an administratively configured range in the deployed
system.
SystemException
public Outcome completeWithStatus(int completionStatus) throws NoActivityException, ActivityPendingException, ContextPendingException, ServiceNotRegisteredException, NotOriginatorException, InvalidStateException, ActivityNotProcessedException, SystemException
completeWithStatus
in interface UserActivity
completionStatus
-
NoActivityException
ActivityPendingException
ContextPendingException
ServiceNotRegisteredException
NotOriginatorException
InvalidStateException
ActivityNotProcessedException
SystemException
public Outcome complete() throws NoActivityException, ActivityPendingException, ContextPendingException, ServiceNotRegisteredException, NotOriginatorException, ActivityNotProcessedException, SystemException
complete
in interface UserActivity
NoActivityException
ActivityPendingException
ContextPendingException
ServiceNotRegisteredException
NotOriginatorException
ActivityNotProcessedException
SystemException
public void setCompletionStatus(int completionStatus) throws NoActivityException, InvalidStateException, ServiceNotRegisteredException, SystemException
setCompletionStatus
in interface UserActivity
completionStatus
- - the CompletionStatus value to set.
NoActivityException
- - Thrown if there is no Activity associated
with the calling thread of execution.
InvalidStateException
- - Thrown if an attempt is made to update a
CompletionStatus of CompletionStatusFailOnly or if a null or invalid
value is specified by completionStatus.
ServiceNotRegisteredException
- - Thrown if no ServiceManager has
been registered.
SystemException
public int getCompletionStatus() throws ServiceNotRegisteredException, NoActivityException, SystemException
getCompletionStatus
in interface UserActivity
ServiceNotRegisteredException
- - Thrown if there is no Activity
associated with the calling thread of execution.
NoActivityException
- - Thrown if no ServiceManager has been
registered.
SystemException
- - Thrown if the Activity service encounters an
unexpected error condition.public int getStatus() throws ServiceNotRegisteredException, SystemException
getStatus
in interface UserActivity
ServiceNotRegisteredException
- Thrown if no ServiceManager
has been registered.
SystemException
- Thrown if the Activity service encounters an
unexpected error condition.public java.lang.String getName() throws ServiceNotRegisteredException, SystemException
getName
in interface UserActivity
ServiceNotRegisteredException
- Thrown if no ServiceManager has been registered.
SystemException
- - Thrown if the Activity service encounters an unexpected error condition.public void setTimeout(int timeout) throws ServiceNotRegisteredException, TimeoutRangeException, SystemException
setTimeout
in interface UserActivity
timeout
- - the default timeout period (in seconds) used by
any future Activities begun with a timeout value of zero. This default
is used for an Activity that is begun with a timeout parameter value
of 0.
A value of -1 indicates no timeout. A value of 0 for the default timeout
indicates that a system-managed value or implementation-specific default
should be used. The timeout is a useful mechanism for protecting against
clients that fail to end an Activity in a timely fashion.
ServiceNotRegisteredException
- - Thrown if no ServiceManager
has been registered.
TimeoutRangeException
- - Thrown if timeout is less
than -1 or if it is outside an administratively configured range
in the deployed system.
SystemException
- - Thrown if the Activity service encounters an
unexpected error condition.public int getTimeout() throws ServiceNotRegisteredException, SystemException
getTimeout
in interface UserActivity
ServiceNotRegisteredException
- - Thrown if no ServiceManager
has been registered.
SystemException
public GlobalId getGlobalId() throws ServiceNotRegisteredException, SystemException
getGlobalId
in interface UserActivity
ServiceNotRegisteredException
SystemException
public Outcome broadcast(java.lang.String signalSetName) throws NoActivityException, SignalSetUnknownException, ServiceNotRegisteredException, InvalidActivityException, ActivityNotProcessedException, SystemException
broadcast
in interface UserActivity
signalSetName
- - the name of the SignalSet that is to produce the
signals.
NoActivityException-
- Thrown if there is no Activity associated
with the calling thread of execution.
SignalSetUnknownException
ServiceNotRegisteredException
- - Thrown if no ServiceManager has
been registered.
InvalidActivityException
- Thrown if an attempt is made to use the
Synchronization or ChildLifetime SignalSets, or if the Activity is in
the process of completion.
ActivityNotProcessedException
SystemException
NoActivityException
public ActivityCoordinator getCoordinator() throws ServiceNotRegisteredException, NoImplementException, SystemException
getCoordinator
in interface UserActivity
ServiceNotRegisteredException
NoImplementException
SystemException
public ActivityCoordinator getParentCoordinator() throws ServiceNotRegisteredException, NoImplementException, SystemException
getParentCoordinator
in interface UserActivity
ServiceNotRegisteredException
- - Thrown if no ServiceManager has been registered.
NoImplementException
- - Thrown if the Activity service does not provide an implementation
of this method in the calling environment, for example if a J2EE client
calls this method.
SystemException
public PropertyGroup getPropertyGroup(java.lang.String name) throws PropertyGroupUnknownException, ServiceNotRegisteredException, NoActivityException, SystemException
getPropertyGroup
in interface UserActivity
PropertyGroupUnknownException
ServiceNotRegisteredException
NoActivityException
SystemException
public void registerService(ServiceManager service) throws PropertyGroupUnknownException, ServiceAlreadyRegisteredException, SystemException
registerService
in interface UserActivity
service
- - the ServiceManager for the HLS whose activities are to be demarcated
through the target UserActivity instance.
PropertyGroupUnknownException
- - Thrown if the ServiceManager cannot obtain a
PropertyGroupManager for one or more of the PropertyGroups it uses.
ServiceAlreadyRegisteredException
- - Thrown if a ServiceManager has already
been registered with the UserActivity instance.
SystemException
public ServiceManager getService() throws SystemException
getService
in interface UserActivity
SystemException
public ActivityCoordinator recreate(GlobalId activity, GlobalId parent, boolean resume) throws ServiceNotRegisteredException, ActivityCompletedException, java.lang.IllegalArgumentException, SystemException
recreate
in interface UserActivity
ServiceNotRegisteredException
ActivityCompletedException
java.lang.IllegalArgumentException
SystemException
public GlobalId[] recover() throws ServiceNotRegisteredException, SystemException
recover
in interface UserActivity
ServiceNotRegisteredException
SystemException
public void forget(GlobalId globalId) throws ServiceNotRegisteredException, SystemException
forget
in interface UserActivity
ServiceNotRegisteredException
SystemException
public ActivityToken suspend() throws ServiceNotRegisteredException, SystemException
suspend
in interface ActivityManager
ServiceNotRegisteredException
SystemException
public void resume(ActivityToken activityToken) throws InvalidActivityException, InvalidParentContextException, ServiceNotRegisteredException, SystemException
resume
in interface ActivityManager
activityToken
- - the ActivityToken to resume. The
ActivityToken represents a hierarchy of one of more
Activities and transactions and must have been obtained
by a prior call to suspend.
InvalidActivityException
InvalidParentContextException
ServiceNotRegisteredException
SystemException
public ActivityToken suspendGroup() throws ServiceNotRegisteredException, SystemException
suspendGroup
in interface ActivityManager
ServiceNotRegisteredException
SystemException
public void resumeGroup(ActivityToken activityToken) throws InvalidActivityException, InvalidParentContextException, ServiceNotRegisteredException, SystemException
resumeGroup
in interface ActivityManager
InvalidActivityException
InvalidParentContextException
ServiceNotRegisteredException
SystemException
public ActivityToken suspendAll() throws ServiceNotRegisteredException, SystemException
suspendAll
in interface ActivityManager
ServiceNotRegisteredException
SystemException
public void resumeAll(ActivityToken activityToken) throws InvalidActivityException, InvalidParentContextException, ServiceNotRegisteredException, SystemException
resumeAll
in interface ActivityManager
InvalidActivityException
InvalidParentContextException
ServiceNotRegisteredException
SystemException
public GlobalId hibernate() throws ServiceNotRegisteredException, InvalidActivityException, SystemException
hibernate
in interface ActivityManager
ServiceNotRegisteredException
InvalidActivityException
SystemException
public void reactivate(GlobalId globalId) throws ActivityCompletedException, InvalidParentContextException, ServiceNotRegisteredException, SystemException
reactivate
in interface ActivityManager
ActivityCompletedException
InvalidParentContextException
ServiceNotRegisteredException
SystemException
public static void setActivityIdGenerator(ActivityIdGenerator generator)
generator
- - A reference to the unique ActivityIdGeneratorpublic int getNumberOfActivities()
public void associateActivityToCurrentThread(ActivityCoordinator activity)
associateActivityToCurrentThread
in interface ActivityManager
public ActivityCoordinator disassociateActivityFromCurrentThread()
disassociateActivityFromCurrentThread
in interface ActivityManager
public void linkActivityToId(java.lang.String actId, ActivityCoordinator activity)
linkActivityToId
in interface ActivityManager
public static int getInstances()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |