|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.atomikos.datasource.xa.session.SessionHandleState
public class SessionHandleState
A reusable state tracker for XA session/connection handles. An instance of this class can be used for automatically tracking the enlistment and termination states of all branches that a connection handle is involved in. It does this by switching states behind the scenes, so the same instance can be used for several branches.
| Constructor Summary | |
|---|---|
SessionHandleState(XATransactionalResource resource,
XAResource xaResource)
|
|
| Method Summary | |
|---|---|
boolean |
isActiveInTransaction(CompositeTransaction tx)
Tests if the session is active (enlisted) in the given transaction. |
boolean |
isErroneous()
Checks if the session has had any errors. |
boolean |
isInactiveInTransaction(CompositeTransaction tx)
Tests if the session is inactive (delisted) for the given transaction. |
boolean |
isTerminated()
Checks if the session handle is terminated (i.e., can be discarded) and the underlying vendor xa connection/session can be reused or destroyed. |
void |
notifyBeforeUse(CompositeTransaction ct)
Notification that the session handle is about to be used in the current transaction context (i.e. |
void |
notifySessionBorrowed()
Notification that the session was gotten from the pool. |
void |
notifySessionClosed()
Notification that the session handle has been closed by the application. |
void |
notifySessionErrorOccurred()
Marks this session as erroneous. |
void |
notifyTransactionTerminated(CompositeTransaction ct)
Notifies the session that the transaction was terminated. |
void |
registerSessionHandleStateChangeListener(SessionHandleStateChangeListener listener)
|
String |
toString()
|
void |
unregisterSessionHandleStateChangeListener(SessionHandleStateChangeListener listener)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public SessionHandleState(XATransactionalResource resource,
XAResource xaResource)
| Method Detail |
|---|
public boolean isTerminated()
public void notifySessionBorrowed()
public void notifySessionClosed()
public void notifyBeforeUse(CompositeTransaction ct)
throws InvalidSessionHandleStateException
ct - The current transaction, or null if none.
InvalidSessionHandleStateExceptionpublic boolean isErroneous()
public void notifySessionErrorOccurred()
public void notifyTransactionTerminated(CompositeTransaction ct)
ct - public void registerSessionHandleStateChangeListener(SessionHandleStateChangeListener listener)
public void unregisterSessionHandleStateChangeListener(SessionHandleStateChangeListener listener)
public String toString()
toString in class Objectpublic boolean isActiveInTransaction(CompositeTransaction tx)
tx -
public boolean isInactiveInTransaction(CompositeTransaction tx)
tx -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||