org.apache.geronimo.transaction.manager
Class TransactionManagerImpl

java.lang.Object
  extended byorg.apache.geronimo.transaction.manager.TransactionManagerImpl
All Implemented Interfaces:
ExtendedTransactionManager, TransactionManager, XidImporter
Direct Known Subclasses:
TransactionManagerImplGBean

public class TransactionManagerImpl
extends Object
implements ExtendedTransactionManager, XidImporter

Simple implementation of a transaction manager.

Version:
$Rev: 381214 $ $Date: 2006-02-27 02:12:56 +0100 (Mon, 27 Feb 2006) $

Constructor Summary
TransactionManagerImpl(int defaultTransactionTimeoutSeconds, XidFactory xidFactory, TransactionLog transactionLog, Collection resourceManagers)
          TODO NOTE!!! this should be called in an unspecified transaction context, but we cannot enforce this restriction!
 
Method Summary
 void begin()
           
 Transaction begin(long transactionTimeoutMilliseconds)
           
 void commit()
           
 void commit(Transaction tx, boolean onePhase)
           
 void forget(Transaction tx)
           
 Map getExternalXids()
           
 int getStatus()
           
 Transaction getTransaction()
           
 Transaction importXid(Xid xid, long transactionTimeoutMilliseconds)
           
 int prepare(Transaction tx)
           
protected  void recoverResourceManager(ResourceManager resourceManager)
           
 void resume(Transaction tx)
           
 void rollback()
           
 void rollback(Transaction tx)
           
 void setRollbackOnly()
           
 void setTransactionTimeout(int seconds)
           
 Transaction suspend()
           
protected  List watchResourceManagers(Collection resourceManagers)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TransactionManagerImpl

public TransactionManagerImpl(int defaultTransactionTimeoutSeconds,
                              XidFactory xidFactory,
                              TransactionLog transactionLog,
                              Collection resourceManagers)
                       throws XAException
TODO NOTE!!! this should be called in an unspecified transaction context, but we cannot enforce this restriction!

Method Detail

watchResourceManagers

protected List watchResourceManagers(Collection resourceManagers)

getTransaction

public Transaction getTransaction()
                           throws SystemException
Specified by:
getTransaction in interface TransactionManager
Throws:
SystemException

setTransactionTimeout

public void setTransactionTimeout(int seconds)
                           throws SystemException
Specified by:
setTransactionTimeout in interface TransactionManager
Throws:
SystemException

getStatus

public int getStatus()
              throws SystemException
Specified by:
getStatus in interface TransactionManager
Throws:
SystemException

begin

public void begin()
           throws NotSupportedException,
                  SystemException
Specified by:
begin in interface TransactionManager
Throws:
NotSupportedException
SystemException

begin

public Transaction begin(long transactionTimeoutMilliseconds)
                  throws NotSupportedException,
                         SystemException
Specified by:
begin in interface ExtendedTransactionManager
Throws:
NotSupportedException
SystemException

suspend

public Transaction suspend()
                    throws SystemException
Specified by:
suspend in interface TransactionManager
Throws:
SystemException

resume

public void resume(Transaction tx)
            throws IllegalStateException,
                   InvalidTransactionException,
                   SystemException
Specified by:
resume in interface TransactionManager
Throws:
IllegalStateException
InvalidTransactionException
SystemException

setRollbackOnly

public void setRollbackOnly()
                     throws IllegalStateException,
                            SystemException
Specified by:
setRollbackOnly in interface TransactionManager
Throws:
IllegalStateException
SystemException

commit

public void commit()
            throws HeuristicMixedException,
                   HeuristicRollbackException,
                   IllegalStateException,
                   RollbackException,
                   SecurityException,
                   SystemException
Specified by:
commit in interface TransactionManager
Throws:
HeuristicMixedException
HeuristicRollbackException
IllegalStateException
RollbackException
SecurityException
SystemException

rollback

public void rollback()
              throws IllegalStateException,
                     SecurityException,
                     SystemException
Specified by:
rollback in interface TransactionManager
Throws:
IllegalStateException
SecurityException
SystemException

importXid

public Transaction importXid(Xid xid,
                             long transactionTimeoutMilliseconds)
                      throws XAException,
                             SystemException
Specified by:
importXid in interface XidImporter
Throws:
XAException
SystemException

commit

public void commit(Transaction tx,
                   boolean onePhase)
            throws XAException
Specified by:
commit in interface XidImporter
Throws:
XAException

forget

public void forget(Transaction tx)
            throws XAException
Specified by:
forget in interface XidImporter
Throws:
XAException

prepare

public int prepare(Transaction tx)
            throws XAException
Specified by:
prepare in interface XidImporter
Throws:
XAException

rollback

public void rollback(Transaction tx)
              throws XAException
Specified by:
rollback in interface XidImporter
Throws:
XAException

recoverResourceManager

protected void recoverResourceManager(ResourceManager resourceManager)

getExternalXids

public Map getExternalXids()
Specified by:
getExternalXids in interface ExtendedTransactionManager


Copyright © 2003-2007 Apache Software Foundation. All Rights Reserved.