|
||||||||||
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(javax.transaction.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 java.lang.String |
getStatus(int status)
Returns the readable name for the specified status. |
javax.transaction.Transaction |
getTransaction()
Delegates the call to the Transaction Manager passed into the constructor. |
javax.transaction.TransactionManager |
getTxManager()
|
void |
resume(javax.transaction.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. |
javax.transaction.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(javax.transaction.TransactionManager txMngr)
txMngr
- The Transaction Manager plugged into OpenEJBMethod Detail |
---|
public javax.transaction.TransactionManager getTxManager()
public void begin() throws javax.transaction.SystemException, javax.transaction.NotSupportedException
begin
in interface javax.transaction.TransactionManager
javax.transaction.SystemException
javax.transaction.NotSupportedException
public void commit() throws javax.transaction.SystemException, javax.transaction.RollbackException, javax.transaction.HeuristicRollbackException, javax.transaction.HeuristicMixedException
commit
in interface javax.transaction.TransactionManager
javax.transaction.SystemException
javax.transaction.RollbackException
javax.transaction.HeuristicRollbackException
javax.transaction.HeuristicMixedException
public int getStatus() throws javax.transaction.SystemException
getStatus
in interface javax.transaction.TransactionManager
javax.transaction.SystemException
public javax.transaction.Transaction getTransaction() throws javax.transaction.SystemException
getTransaction
in interface javax.transaction.TransactionManager
javax.transaction.SystemException
public void resume(javax.transaction.Transaction tx) throws javax.transaction.SystemException, javax.transaction.InvalidTransactionException
resume
in interface javax.transaction.TransactionManager
tx
-
javax.transaction.SystemException
javax.transaction.InvalidTransactionException
public javax.transaction.Transaction suspend() throws javax.transaction.SystemException
suspend
in interface javax.transaction.TransactionManager
javax.transaction.SystemException
public void rollback() throws javax.transaction.SystemException
rollback
in interface javax.transaction.TransactionManager
javax.transaction.SystemException
public void setRollbackOnly() throws javax.transaction.SystemException
setRollbackOnly
in interface javax.transaction.TransactionManager
javax.transaction.SystemException
public void setTransactionTimeout(int x) throws javax.transaction.SystemException
setTransactionTimeout
in interface javax.transaction.TransactionManager
x
-
javax.transaction.SystemException
public static java.lang.String getStatus(int status)
status
- The status
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |