java.lang.Object
org.apache.geronimo.transaction.manager.TransactionManagerImpl
- All Implemented Interfaces:
- org.apache.geronimo.transaction.ExtendedTransactionManager, javax.transaction.TransactionManager, XidImporter
- public class TransactionManagerImpl
- extends java.lang.Object
- implements org.apache.geronimo.transaction.ExtendedTransactionManager, XidImporter
Simple implementation of a transaction manager.
- Version:
- $Rev: 156292 $ $Date: 2005-03-05 18:48:02 -0800 (Sat, 05 Mar 2005) $
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
transactionLog
final TransactionLog transactionLog
xidFactory
final XidFactory xidFactory
defaultTransactionTimeoutMilliseconds
private final int defaultTransactionTimeoutMilliseconds
transactionTimeoutMilliseconds
private final java.lang.ThreadLocal transactionTimeoutMilliseconds
threadTx
private final java.lang.ThreadLocal threadTx
recoveryLog
private static final org.apache.commons.logging.Log recoveryLog
recovery
final Recovery recovery
resourceManagers
final org.apache.geronimo.gbean.ReferenceCollection resourceManagers
recoveryErrors
private java.util.List recoveryErrors
GBEAN_INFO
public static final org.apache.geronimo.gbean.GBeanInfo GBEAN_INFO
TransactionManagerImpl
public TransactionManagerImpl(int defaultTransactionTimeoutSeconds,
TransactionLog transactionLog,
java.util.Collection resourceManagers)
throws javax.transaction.xa.XAException
- TODO NOTE!!! this should be called in an unspecified transaction context, but we cannot enforce this restriction!
getTransaction
public javax.transaction.Transaction getTransaction()
throws javax.transaction.SystemException
- Specified by:
getTransaction in interface javax.transaction.TransactionManager
setTransactionTimeout
public void setTransactionTimeout(int seconds)
throws javax.transaction.SystemException
- Specified by:
setTransactionTimeout in interface javax.transaction.TransactionManager
getStatus
public int getStatus()
throws javax.transaction.SystemException
- Specified by:
getStatus in interface javax.transaction.TransactionManager
begin
public void begin()
throws javax.transaction.NotSupportedException,
javax.transaction.SystemException
- Specified by:
begin in interface javax.transaction.TransactionManager
begin
public javax.transaction.Transaction begin(long transactionTimeoutMilliseconds)
throws javax.transaction.NotSupportedException,
javax.transaction.SystemException
- Specified by:
begin in interface org.apache.geronimo.transaction.ExtendedTransactionManager
suspend
public javax.transaction.Transaction suspend()
throws javax.transaction.SystemException
- Specified by:
suspend in interface javax.transaction.TransactionManager
resume
public void resume(javax.transaction.Transaction tx)
throws java.lang.IllegalStateException,
javax.transaction.InvalidTransactionException,
javax.transaction.SystemException
- Specified by:
resume in interface javax.transaction.TransactionManager
setRollbackOnly
public void setRollbackOnly()
throws java.lang.IllegalStateException,
javax.transaction.SystemException
- Specified by:
setRollbackOnly in interface javax.transaction.TransactionManager
commit
public void commit()
throws javax.transaction.HeuristicMixedException,
javax.transaction.HeuristicRollbackException,
java.lang.IllegalStateException,
javax.transaction.RollbackException,
java.lang.SecurityException,
javax.transaction.SystemException
- Specified by:
commit in interface javax.transaction.TransactionManager
rollback
public void rollback()
throws java.lang.IllegalStateException,
java.lang.SecurityException,
javax.transaction.SystemException
- Specified by:
rollback in interface javax.transaction.TransactionManager
importXid
public javax.transaction.Transaction importXid(javax.transaction.xa.Xid xid,
long transactionTimeoutMilliseconds)
throws javax.transaction.xa.XAException,
javax.transaction.SystemException
- Specified by:
importXid in interface XidImporter
commit
public void commit(javax.transaction.Transaction tx,
boolean onePhase)
throws javax.transaction.xa.XAException
- Specified by:
commit in interface XidImporter
forget
public void forget(javax.transaction.Transaction tx)
throws javax.transaction.xa.XAException
- Specified by:
forget in interface XidImporter
prepare
public int prepare(javax.transaction.Transaction tx)
throws javax.transaction.xa.XAException
- Specified by:
prepare in interface XidImporter
rollback
public void rollback(javax.transaction.Transaction tx)
throws javax.transaction.xa.XAException
- Specified by:
rollback in interface XidImporter
getTransactionTimeoutMilliseconds
long getTransactionTimeoutMilliseconds(long transactionTimeoutMilliseconds)
recoverResourceManager
protected void recoverResourceManager(ResourceManager resourceManager)
getExternalXids
public java.util.Map getExternalXids()
- Specified by:
getExternalXids in interface org.apache.geronimo.transaction.ExtendedTransactionManager
getGBeanInfo
public static org.apache.geronimo.gbean.GBeanInfo getGBeanInfo()