|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.objectweb.jass.as.UserActivityImpl
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 | |
UserActivityImpl()
Default Constructor. |
Method Summary | |
void |
begin(int timeout)
Create a new Activity and associate it with the current thread. |
javax.activity.Outcome |
broadcast(java.lang.String signalSetName)
Causes the SignalSet specified by signalSetName to start producing signals for all registered Actions. |
javax.activity.Outcome |
complete()
Causes the active Activity context to be completed with its current CompletionStatus. |
javax.activity.Outcome |
completeWithStatus(int completionStatus)
Causes the active Activity context to complete with the specified CompletionStatus. |
void |
forget(javax.activity.GlobalId globalId)
NOT YET IMPLEMENTED |
int |
getCompletionStatus()
Returns the current value of the CompletionStatus of the active Activity. |
javax.activity.ActivityCoordinator |
getCoordinator()
Returns the ActivityCoordinator of the active Activity, or null if there is no Activity associated with the calling thread. |
javax.activity.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. |
javax.activity.ActivityCoordinator |
getParentCoordinator()
Returns the ActivityCoordinator of the parent of the active Activity, or null if the active Activity is a top-level Activity. |
javax.activity.propertygroup.PropertyGroup |
getPropertyGroup(java.lang.String name)
NOT YET IMPLEMENTED |
javax.activity.coordination.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. |
javax.activity.GlobalId[] |
recover()
NOT YET IMPLEMENTED |
javax.activity.ActivityCoordinator |
recreate(javax.activity.GlobalId activity,
javax.activity.GlobalId parent,
boolean resume)
NOT YET IMPLEMENTED |
void |
registerService(javax.activity.coordination.ServiceManager service)
Registers a ServiceManager for the type of high-level service (HLS) whose activities are to be demarcated through the target UserActivity instance. |
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. |
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 UserActivityImpl()
Method Detail |
public void begin(int timeout) throws javax.activity.InvalidStateException, javax.activity.ServiceNotRegisteredException, javax.activity.TimeoutRangeException, javax.activity.SystemException
begin
in interface javax.activity.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.
javax.activity.InvalidStateException
- - Thrown if the parent Activity has
been marked as CompletionStatusFailOnly.
javax.activity.ServiceNotRegisteredException
- - Thrown if no ServiceManager
has been registered.
javax.activity.TimeoutRangeException
- - Thrown if timeout is less than -1 or
if it is outside an administratively configured range in the deployed
system.
javax.activity.SystemException
public javax.activity.Outcome completeWithStatus(int completionStatus) throws javax.activity.NoActivityException, javax.activity.ActivityPendingException, javax.activity.ContextPendingException, javax.activity.ServiceNotRegisteredException, javax.activity.NotOriginatorException, javax.activity.InvalidStateException, javax.activity.ActivityNotProcessedException, javax.activity.SystemException
completeWithStatus
in interface javax.activity.UserActivity
completionStatus
-
javax.activity.NoActivityException
javax.activity.ActivityPendingException
javax.activity.ContextPendingException
javax.activity.ServiceNotRegisteredException
javax.activity.NotOriginatorException
javax.activity.InvalidStateException
javax.activity.ActivityNotProcessedException
javax.activity.SystemException
public javax.activity.Outcome complete() throws javax.activity.NoActivityException, javax.activity.ActivityPendingException, javax.activity.ContextPendingException, javax.activity.ServiceNotRegisteredException, javax.activity.NotOriginatorException, javax.activity.ActivityNotProcessedException, javax.activity.SystemException
complete
in interface javax.activity.UserActivity
javax.activity.NoActivityException
javax.activity.ActivityPendingException
javax.activity.ContextPendingException
javax.activity.ServiceNotRegisteredException
javax.activity.NotOriginatorException
javax.activity.ActivityNotProcessedException
javax.activity.SystemException
public void setCompletionStatus(int completionStatus) throws javax.activity.NoActivityException, javax.activity.InvalidStateException, javax.activity.ServiceNotRegisteredException, javax.activity.SystemException
setCompletionStatus
in interface javax.activity.UserActivity
completionStatus
- - the CompletionStatus value to set.
javax.activity.NoActivityException
- - Thrown if there is no Activity associated
with the calling thread of execution.
javax.activity.InvalidStateException
- - Thrown if an attempt is made to update a
CompletionStatus of CompletionStatusFailOnly or if a null or invalid
value is specified by completionStatus.
javax.activity.ServiceNotRegisteredException
- - Thrown if no ServiceManager has
been registered.
javax.activity.SystemException
public int getCompletionStatus() throws javax.activity.ServiceNotRegisteredException, javax.activity.NoActivityException, javax.activity.SystemException
getCompletionStatus
in interface javax.activity.UserActivity
javax.activity.ServiceNotRegisteredException
- - Thrown if there is no Activity
associated with the calling thread of execution.
javax.activity.NoActivityException
- - Thrown if no ServiceManager has been
registered.
javax.activity.SystemException
- - Thrown if the Activity service encounters an
unexpected error condition.public int getStatus() throws javax.activity.ServiceNotRegisteredException, javax.activity.SystemException
getStatus
in interface javax.activity.UserActivity
javax.activity.ServiceNotRegisteredException
- Thrown if no ServiceManager
has been registered.
javax.activity.SystemException
- Thrown if the Activity service encounters an
unexpected error condition.public java.lang.String getName() throws javax.activity.ServiceNotRegisteredException, javax.activity.SystemException
getName
in interface javax.activity.UserActivity
javax.activity.ServiceNotRegisteredException
- Thrown if no ServiceManager has been registered.
javax.activity.SystemException
- - Thrown if the Activity service encounters an unexpected error condition.public void setTimeout(int timeout) throws javax.activity.ServiceNotRegisteredException, javax.activity.TimeoutRangeException, javax.activity.SystemException
setTimeout
in interface javax.activity.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.
javax.activity.ServiceNotRegisteredException
- - Thrown if no ServiceManager
has been registered.
javax.activity.TimeoutRangeException
- - Thrown if timeout is less
than -1 or if it is outside an administratively configured range
in the deployed system.
javax.activity.SystemException
- - Thrown if the Activity service encounters an
unexpected error condition.public int getTimeout() throws javax.activity.ServiceNotRegisteredException, javax.activity.SystemException
getTimeout
in interface javax.activity.UserActivity
javax.activity.ServiceNotRegisteredException
- - Thrown if no ServiceManager
has been registered.
javax.activity.SystemException
public javax.activity.GlobalId getGlobalId() throws javax.activity.ServiceNotRegisteredException, javax.activity.SystemException
getGlobalId
in interface javax.activity.UserActivity
javax.activity.ServiceNotRegisteredException
javax.activity.SystemException
public javax.activity.Outcome broadcast(java.lang.String signalSetName) throws javax.activity.NoActivityException, javax.activity.SignalSetUnknownException, javax.activity.ServiceNotRegisteredException, javax.activity.InvalidActivityException, javax.activity.ActivityNotProcessedException, javax.activity.SystemException
broadcast
in interface javax.activity.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.
javax.activity.SignalSetUnknownException
javax.activity.ServiceNotRegisteredException
- - Thrown if no ServiceManager has
been registered.
javax.activity.InvalidActivityException
- Thrown if an attempt is made to use the
Synchronization or ChildLifetime SignalSets, or if the Activity is in
the process of completion.
javax.activity.ActivityNotProcessedException
javax.activity.SystemException
javax.activity.NoActivityException
public javax.activity.ActivityCoordinator getCoordinator() throws javax.activity.ServiceNotRegisteredException, javax.activity.NoImplementException, javax.activity.SystemException
getCoordinator
in interface javax.activity.UserActivity
javax.activity.ServiceNotRegisteredException
javax.activity.NoImplementException
javax.activity.SystemException
public javax.activity.ActivityCoordinator getParentCoordinator() throws javax.activity.ServiceNotRegisteredException, javax.activity.NoImplementException, javax.activity.SystemException
getParentCoordinator
in interface javax.activity.UserActivity
javax.activity.ServiceNotRegisteredException
- - Thrown if no ServiceManager has been registered.
javax.activity.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.
javax.activity.SystemException
public javax.activity.propertygroup.PropertyGroup getPropertyGroup(java.lang.String name) throws javax.activity.PropertyGroupUnknownException, javax.activity.ServiceNotRegisteredException, javax.activity.NoActivityException, javax.activity.SystemException
getPropertyGroup
in interface javax.activity.UserActivity
javax.activity.PropertyGroupUnknownException
javax.activity.ServiceNotRegisteredException
javax.activity.NoActivityException
javax.activity.SystemException
public void registerService(javax.activity.coordination.ServiceManager service) throws javax.activity.PropertyGroupUnknownException, javax.activity.ServiceAlreadyRegisteredException, javax.activity.SystemException
registerService
in interface javax.activity.UserActivity
service
- - the ServiceManager for the HLS whose activities are to be demarcated
through the target UserActivity instance.
javax.activity.PropertyGroupUnknownException
- - Thrown if the ServiceManager cannot obtain a
PropertyGroupManager for one or more of the PropertyGroups it uses.
javax.activity.ServiceAlreadyRegisteredException
- - Thrown if a ServiceManager has already
been registered with the UserActivity instance.
javax.activity.SystemException
public javax.activity.coordination.ServiceManager getService() throws javax.activity.SystemException
getService
in interface javax.activity.UserActivity
javax.activity.SystemException
public javax.activity.ActivityCoordinator recreate(javax.activity.GlobalId activity, javax.activity.GlobalId parent, boolean resume) throws javax.activity.ServiceNotRegisteredException, javax.activity.ActivityCompletedException, java.lang.IllegalArgumentException, javax.activity.SystemException
recreate
in interface javax.activity.UserActivity
javax.activity.ServiceNotRegisteredException
javax.activity.ActivityCompletedException
java.lang.IllegalArgumentException
javax.activity.SystemException
public javax.activity.GlobalId[] recover() throws javax.activity.ServiceNotRegisteredException, javax.activity.SystemException
recover
in interface javax.activity.UserActivity
javax.activity.ServiceNotRegisteredException
javax.activity.SystemException
public void forget(javax.activity.GlobalId globalId) throws javax.activity.ServiceNotRegisteredException, javax.activity.SystemException
forget
in interface javax.activity.UserActivity
javax.activity.ServiceNotRegisteredException
javax.activity.SystemException
public static void setActivityIdGenerator(ActivityIdGenerator generator)
generator
- - A reference to the unique ActivityIdGeneratorpublic int getNumberOfActivities()
public static int getInstances()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |