|
IBM WebSphere Application ServerTM Release 7 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface UserActivitySession
The UserActivitySession interface is used to begin and end ActivitySessions and to query various attributes of the ActivitySession associated with the calling thread.
An ActivitySession is a unit of work scope that can be used to coordinate multiple one-phase commit (1PC) resources to complete with a common outcome. In addition to providing a means for the coordination of 1PC resources an ActivitySession can also be used to provide a user-signon (e.g. HttpSession) scoped activation policy for EJBs.
An ActivitySession is used in much the same way as a JTA transaction. Application components may use the UserActivitySession interface to provide bean-managed demaracation of ActivitySession contexts. EJB components may alternatively be deployed to use container-managed ActivitySessions, in which case the EJB container manages the demarcation of ActivitySession contexts.
This interface defines the set of ActivitySession operations available to an application component that has been configured to use bean-managed ActivitySessions. An implementation of this interface is obtained via a JNDI lookup of the URI "java:comp/websphere/UserActivitySession".
Field Summary | |
---|---|
static int |
EndModeCheckPoint
Directs all the resources enlisted with the ActivitySession to checkpoint. |
static int |
EndModeReset
Directs all the resources enlisted with the ActivitySession to reset. |
static int |
StatusNoSession
There is no active ActivitySession associated with the calling thread |
static int |
StatusSessionActive
There is an active ActivitySession associated with the calling thread |
static int |
StatusSessionCompleted
The ActivitySession associated with the calling thread has completed |
static int |
StatusSessionCompleting
The ActivitySession associated with the calling thread is in the process of ending |
static int |
StatusUnknown
The ActivitySession service is unable to determine the status of the ActivitySession associated with the calling thread. |
Method Summary | |
---|---|
void |
beginSession()
Create a new ActivitySession and associate it with the current thread. |
void |
checkpointSession()
Checkpoints all the resources enisted in the current ActivitySession but allows further work within the ActivitySession. |
void |
endSession(int EndMode)
Completes the ActivitySession associated with the current thread and checkpoints or resets all of the resources enlisted with it. |
java.lang.String |
getSessionName()
Obtain the name of the ActivitySession associated with the thread. |
int |
getSessionTimeout()
Returns the default timeout value. |
int |
getStatus()
Obtain the status of the ActivitySession associated with the current thread. |
void |
resetSession()
Resets all the resources enlisted in the current ActivitySession but allows further work within the ActivitySession. |
void |
setResetOnly()
Marks the ActivitySession associated with the current thread such that the only possible outcome is reset. |
void |
setSessionTimeout(int timeout)
Sets the default timeout, in seconds, after which any subsequently started ActivitySessions may be automatically completed by the ActivitySession service. |
Field Detail |
---|
static final int EndModeCheckPoint
static final int EndModeReset
static final int StatusSessionActive
static final int StatusSessionCompleting
static final int StatusSessionCompleted
static final int StatusNoSession
static final int StatusUnknown
Method Detail |
---|
void beginSession() throws ActivitySessionAlreadyActiveException, TransactionPendingException, NotSupportedException, SystemException
ActivitySessionAlreadyActiveException
- Thrown if the thread is already
associated with a session.
TransactionPendingException
- Thrown if the thread is associated with
a transaction. ActivitySessions may not be nested within transactions.
NotSupportedException
- Thrown if the access to the UserActivitySession
interface is not allowed, for example if the caller is executing under
an ActivitySession container policy of ActivitySessionNotSupported
SystemException
- Thrown if the ActivitySession service
encounters an unexpected error conditionvoid endSession(int EndMode) throws ActivitySessionPendingException, ContextPendingException, NoActivitySessionException, NotOriginatorException, MixedOutcomeException, ActivitySessionResetException, NotSupportedException, SystemException
If there is a contained transaction within the ActivitySession context
and the end more is EndModeCheckpoint
, then a
ContextPendingException
is raised and neither the transaction context
nor the ActivitySession context are affected by the operation. The caller must
either complete the transaction first or end the ActivitySession with an end
mode of EndModeReset
. If there are contained transactions within
the ActivitySession context and the end mode is EndModeReset
, then
the contained transactions are marked rollback_only.
EndMode
- indicates the end mode with which enlisted resources should be directed
to complete. The EndMode value must be EndModeCheckpoint
or
EndModeReset
ActivitySessionPendingException
- Thrown to indicate that there is outstanding
asynchronous work associated with the ActivitySession. The ActivitySession
remains active.
ContextPendingException
- Thrown if there is a contained transaction
that has not been completed and the EndMode is EndModeCheckPoint. The
ActivitySession and transaction contexts remain unchanged.
NoActivitySessionException
- Thrown to indicate that no ActivitySession is associated
with the current thread.
NotOriginatorException
- Thrown to indicate that the calling thread does
not belong in the originating execution environment and that this
operation is therefore disallowed.
MixedOutcomeException
- Thrown if the ActivitySessionResources
enlisted in the ActivitySesison were not all completed
in the same direction. An array of NotProcessedExceptions indicates
the resources that were Reset.
ActivitySessionResetException
- Thrown if a request to checkpoint resulted
in all the ActivitySessionResources being reset.
NotSupportedException
- Thrown if the access to the UserActivitySession
interface is not allowed, for example if the caller is executing under
an ActivitySession container policy of ActivitySessionNotSupported
SystemException
- Thrown if the ActivitySession service
encounters an unexpected error conditionEndModeCheckPoint
,
EndModeReset
void resetSession() throws ActivitySessionPendingException, NoActivitySessionException, NotOriginatorException, NotSupportedException, SystemException
When this method completes, the thread is associated with the same ActivitySession as it was prior to this method being called. The enlisted resources remain associated with the ActivitySession although they may not participate further in the ActivitySession.
ActivitySessionPendingException
- Thrown to indicate that there is outstanding
asynchronous work associated with the ActivitySession. No enlisted resources are reset
NoActivitySessionException
- Thrown to indicate that no ActivitySession is
associated with the current thread.
NotOriginatorException
- Thrown to indicate that the ActivitySession associated
with the calling thread did not originate in the current execution environment and that
this operation is therefore disallowed.
NotSupportedException
- Thrown if the access to the UserActivitySession
interface is not allowed, for example if the caller is executing under
an ActivitySession container policy of ActivitySessionNotSupported
SystemException
- Thrown if the ActivitySession service encounters an
unexpected error conditionvoid checkpointSession() throws ActivitySessionPendingException, NoActivitySessionException, NotOriginatorException, MixedOutcomeException, ActivitySessionResetException, NotSupportedException, SystemException
When this method completes, the thread is associated with the same ActivitySession as it was prior to this method being called. The enlisted resources remain associated with the ActivitySession although they may not participate further in the ActivitySession.
ActivitySessionPendingException
- Thrown to indicate that there is outstanding
asynchronous work associated with the ActivitySession. No enlisted resources are
checkpointed.
NoActivitySessionException
- Thrown to indicate that no ActivitySession is
associated with the current thread.
NotOriginatorException
- Thrown to indicate that the ActivitySession associated
with the calling thread did not originate in the current execution environment and that
this operation is therefore disallowed.
MixedOutcomeException
- Thrown if the resources enlisted in the ActivitySession
were not all completed in the same direction. The nested NotProcessedException
indicates the resources that were reset.
ActivitySessionResetException
- Thrown if a request to checkpoint resulted
in all the enlisted resources being reset.
NotSupportedException
- Thrown if the access to the UserActivitySession
interface is not allowed, for example if the caller is executing under an
ActivitySession container policy of ActivitySessionNotSupported
SystemException
- Thrown if the ActivitySession service encounters an unexpected
error condition
int getStatus() throws SystemException
StatusNoSession
SystemException
- Thrown if the ActivitySession service encounters an
unexpected error conditionStatusNoSession
,
StatusSessionActive
,
StatusSessionCompleted
,
StatusSessionCompleting
,
StatusUnknown
java.lang.String getSessionName() throws SystemException
SystemException
- Thrown if the ActivitySession service encounters
an unexpected error conditionvoid setSessionTimeout(int timeout) throws TimeoutOutOfRangeException, SystemException
The timeout is a useful mechanism for protecting against clients that fail to end an ActivitySession in a timely fashion.
timeout
- the default time, in seconds, after which an ActivitySession
may be automatically reset by the ActivitySession service.
TimeoutRangeException
- Thrown if timeout
is less than
-1 or if it is greater than 1000000000 (1 billion).
SystemException
- Thrown if the ActivitySession service encounters
an unexpected error condition.
TimeoutOutOfRangeException
int getSessionTimeout() throws SystemException
SystemException
- Thrown if the ActivitySession service encounters
an unexpected error condition.void setResetOnly() throws NoActivitySessionException, SystemException
NoActivitySessionException
- Thrown to indicate that no ActivitySession is associated
with the current thread.
SystemException
- Thrown if the ActivitySession service
encounters an unexpected error condition
|
IBM WebSphere Application ServerTM Release 7 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |