public class UserActivityImple extends Object implements UserActivity
Constructor and Description |
---|
UserActivityImple() |
Modifier and Type | Method and Description |
---|---|
GlobalId |
activityId() |
String |
activityName()
What is the name of the current activity? Use only for
debugging purposes!
|
ActivityImple |
current() |
ActivityHierarchy |
currentActivity() |
Outcome |
end()
Complete the activity with the completion status provided.
|
Outcome |
end(CompletionStatus cs)
Complete the activity with the completion status provided.
|
CompletionStatus |
getCompletionStatus()
Get the completion status currently associated with the activity.
|
int |
getTimeout()
Get the timeout value currently associated with activities.
|
void |
resume(ActivityHierarchy tx)
Given a token representing a context, associate it with the current
thread of control.
|
String |
serviceType() |
void |
setCompletionStatus(CompletionStatus endStatus)
Set the termination status for the current activity, if any.
|
void |
setTimeout(int timeout)
Set the timeout to be associated with all subsequently created
activities.
|
void |
start(String serviceType)
Start a new activity.
|
void |
start(String serviceType,
int timeout)
Start a new activity.
|
Status |
status() |
ActivityHierarchy |
suspend()
Suspend the current activity from this thread and return the token
representing the context, if any, or null otherwise.
|
public void start(String serviceType) throws WrongStateException, SystemException
start
in interface UserActivity
serviceType
- specifies the type of coordinator which will be
instantiated to manage the activity.WrongStateException
- Thrown if the any currently associated
activity is in a state that does not allow a new activity to be
enlisted.SystemException
- Thrown in any other situation.public void start(String serviceType, int timeout) throws WrongStateException, InvalidTimeoutException, SystemException
start
in interface UserActivity
serviceType
- specifies the type of coordinator which will be
instantiated to manage the activity.timeout
- The timeout associated with the activity. If the
activity has not been terminated by the time this period elapses, then
it will automatically be terminated.WrongStateException
- Thrown if the currently associated
activity is in a state that does not allow a new activity to be
enlisted as a child.InvalidTimeoutException
- Thrown if the specified timeout is
invalid within the current working environment.SystemException
- Thrown in any other situation.public Outcome end() throws InvalidActivityException, WrongStateException, ProtocolViolationException, SystemException, NoActivityException, SystemException, NoPermissionException, ActiveChildException
end
in interface UserActivity
InvalidActivityException
- Thrown if the current activity is
invalid in the execution environment.ActiveChildException
- Thrown if the current activity is aWrongStateException
- Thrown if the current activity is not in a
state that allows it to be completed, or is incompatible with the
completion status provided.ProtocolViolationException
- Thrown if the a violation of the
activity service or HLS protocol occurs.NoActivityException
- Thrown if there is no activity
associated with the invoking thread or none with the given type of coordinator.NoPermissionException
- Thrown if the invoking thread does
not have permission to terminate the transaction.SystemException
- Thrown if some other error occurred.Outcome
public Outcome end(CompletionStatus cs) throws InvalidActivityException, WrongStateException, ProtocolViolationException, SystemException, NoActivityException, NoPermissionException, ActiveChildException
end
in interface UserActivity
cs
- The CompletionStatus to use.InvalidActivityException
- Thrown if the current activity is
invalid in the execution environment.ActiveChildException
- Thrown if the current activity is aWrongStateException
- Thrown if the current activity is not in a
state that allows it to be completed, or is incompatible with the
completion status provided.ProtocolViolationException
- Thrown if the a violation of the
activity service or HLS protocol occurs.NoActivityException
- Thrown if there is no activity
associated with the invoking thread or none with the given type of coordinator.NoPermissionException
- Thrown if the invoking thread does
not have permission to terminate the transaction.SystemException
- Thrown if some other error occurred.com.arjuna.mw.wsas.Outcome
public void setCompletionStatus(CompletionStatus endStatus) throws NoActivityException, WrongStateException, SystemException
setCompletionStatus
in interface UserActivity
endStatus
- The state in which the activity
should attempt to terminate. This may
be one of the default values provided by WSAS or may be extended in
an implementation specific manner by an HLS.NoActivityException
- Thrown if there is no activity
associated with the invoking thread.WrongStateException
- Thrown if the completion status is
incompatible with the current state of the activity.SystemException
- Thrown if any other error occurs.public CompletionStatus getCompletionStatus() throws NoActivityException, SystemException
getCompletionStatus
in interface UserActivity
NoActivityException
- Thrown if there is no activity
associated with the current thread.SystemException
- Thrown if any other error occurs.public int getTimeout() throws SystemException
getTimeout
in interface UserActivity
SystemException
- Thrown if any error occurs.public void setTimeout(int timeout) throws InvalidTimeoutException, SystemException
setTimeout
in interface UserActivity
timeout
- The timeout (in seconds) to associate with all
subsequently created activities. This value must be 0 or greater.InvalidTimeoutException
- Thrown if the timeout value provided
is negative, too large, or if timeouts are simply not supported by
the activity implementation.SystemException
- Thrown if any other error occurs.public Status status() throws SystemException
status
in interface UserActivity
SystemException
- Thrown if any error occurs.Status
public String activityName() throws NoActivityException, SystemException
activityName
in interface UserActivity
NoActivityException
- Thrown if there is no activity
associated with the invoking thread.SystemException
- Thrown if any other error occurs.public GlobalId activityId() throws NoActivityException, SystemException
activityId
in interface UserActivity
NoActivityException
- Thrown if there is no activity
associated with the invoking thread.SystemException
- Thrown if any other error occurs.public ActivityHierarchy suspend() throws SystemException
suspend
in interface UserActivity
SystemException
- Thrown if any error occurs.public void resume(ActivityHierarchy tx) throws InvalidActivityException, SystemException
resume
in interface UserActivity
tx
- The activity to associate with this thread. This
may be null in which case the current thread becomes associated with
no activity.InvalidActivityException
- Thrown if the activity handle
is invalid in this context.SystemException
- Thrown if any other error occurs.public ActivityHierarchy currentActivity() throws SystemException
currentActivity
in interface UserActivity
SystemException
- Thrown if any error occurs.public String serviceType() throws NoActivityException, SystemException
serviceType
in interface UserActivity
NoActivityException
- Thrown if there is no activity
associated with the invoking thread.SystemException
- Thrown if any error occurs.public final ActivityImple current()
Copyright © 2016 JBoss by Red Hat. All rights reserved.