|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.openejb.core.TransactionManagerWrapper
public class TransactionManagerWrapper
This class intercepts requests to the TransactonManager so that it can provide wrappers for javax.transaction.Transaction objects. The Transaction wrappers allow Synchronization objects can be more finely managed. This allows, for example, enterprise beans to have their synchronization callback methods executed before synchronization objects registered by the Persistence Manager instances or Connectors.
Synchronized objects can be registered in groups organized by priority. The Synchronization group with the highest priority, priority = 1, is handled first, so that all of 1st (priority=1) synchronization group beforeCompletion() and afterCompletion( ) methods are executed first. The synchronization group with the second highest priority (priority = 2) is handled second and so on.
Their are 3 priorities (1, 2, and 3). Synchronization objects may be added with any one of these priorities. If a Synchronization object is added with a priority higher then 3, its added to the third priority group. If a Synchronization object is added with a priority lower then 1, its added to the first priority group.
Within a synchronization group, Synchronization objects are handled in the order they were registered. The first Synchronization object added to the group is handled first.
All the beforeCompletion() methods on all the Synchronization objects will be executed before any of the afterCompletion() methods are executed. Both are executed according to priority and order registered.
| Field Summary | |
|---|---|
protected static org.apache.log4j.Category |
logger
|
| Constructor Summary | |
|---|---|
TransactionManagerWrapper(TransactionManager txMngr)
Constructor |
|
| Method Summary | |
|---|---|
void |
begin()
Delegates the call to the Transaction Manager passed into the constructor. |
void |
commit()
Delegates the call to the Transaction Manager passed into the constructor. |
int |
getStatus()
Delegates the call to the Transaction Manager passed into the constructor. |
static String |
getStatus(int status)
Returns the readable name for the specified status. |
Transaction |
getTransaction()
Delegates the call to the Transaction Manager passed into the constructor. |
TransactionManager |
getTxManager()
|
void |
resume(Transaction tx)
Delegates the call to the Transaction Manager passed into the constructor. |
void |
rollback()
Delegates the call to the Transaction Manager passed into the constructor. |
void |
setRollbackOnly()
Delegates the call to the Transaction Manager passed into the constructor. |
void |
setTransactionTimeout(int x)
Delegates the call to the Transaction Manager passed into the constructor. |
Transaction |
suspend()
Delegates the call to the Transaction Manager passed into the constructor. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static final org.apache.log4j.Category logger
| Constructor Detail |
|---|
public TransactionManagerWrapper(TransactionManager txMngr)
txMngr - The Transaction Manager plugged into OpenEJB| Method Detail |
|---|
public TransactionManager getTxManager()
public void begin()
throws SystemException,
NotSupportedException
begin in interface TransactionManagerSystemException
NotSupportedException
public void commit()
throws SystemException,
RollbackException,
HeuristicRollbackException,
HeuristicMixedException
commit in interface TransactionManagerSystemException
RollbackException
HeuristicRollbackException
HeuristicMixedException
public int getStatus()
throws SystemException
getStatus in interface TransactionManagerSystemException
public Transaction getTransaction()
throws SystemException
getTransaction in interface TransactionManagerSystemException
public void resume(Transaction tx)
throws SystemException,
InvalidTransactionException
resume in interface TransactionManagertx -
SystemException
InvalidTransactionException
public Transaction suspend()
throws SystemException
suspend in interface TransactionManagerSystemException
public void rollback()
throws SystemException
rollback in interface TransactionManagerSystemException
public void setRollbackOnly()
throws SystemException
setRollbackOnly in interface TransactionManagerSystemException
public void setTransactionTimeout(int x)
throws SystemException
setTransactionTimeout in interface TransactionManagerx -
SystemExceptionpublic static String getStatus(int status)
status - The status
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||