|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.openejb.core.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.
Inner Class Summary | |
class |
TransactionManagerWrapper.TransactionWrapper
Wraps the Transaction Manager's transaction implementation to facilitate a finer grain control for the Container. |
Field Summary | |
(package private) javax.transaction.TransactionManager |
transactionManager
Transaction Manager Instance |
(package private) java.util.Hashtable |
wrapperMap
|
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. |
javax.transaction.Transaction |
getTransaction()
Delegates the call to the Transaction Manager passed into the constructor. |
javax.transaction.TransactionManager |
getTxManager()
|
javax.transaction.Transaction |
getTxWrapper(javax.transaction.Transaction tx)
Returns the wrapper for a given transaction |
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 |
|
Field Detail |
javax.transaction.TransactionManager transactionManager
TransactionService
java.util.Hashtable wrapperMap
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 javax.transaction.Transaction getTxWrapper(javax.transaction.Transaction tx) throws javax.transaction.SystemException
tx
- javax.transaction.SystemException
-
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |