org.apache.geronimo.transaction
Class TransactionManagerProxy

java.lang.Object
  extended byorg.apache.geronimo.transaction.TransactionManagerProxy
All Implemented Interfaces:
org.apache.geronimo.gbean.GBeanLifecycle, TransactionManager, javax.resource.spi.XATerminator, XAWork
Direct Known Subclasses:
GeronimoTransactionManager

public class TransactionManagerProxy
extends Object
implements TransactionManager, javax.resource.spi.XATerminator, XAWork, org.apache.geronimo.gbean.GBeanLifecycle

A wrapper for a TransactionManager that wraps all Transactions in a TransactionProxy so that we can add addition metadata to the Transaction. Only begin (and setTransactionTimeout) are delegated to the wrapped TransactionManager; all other operations are delegated to the wrapped Transaction.

Version:
$Revision: 1.12 $ $Date: 2004/07/18 22:02:01 $

Nested Class Summary
static class TransactionManagerProxy.ConstructorParams
           
 
Field Summary
static org.apache.geronimo.gbean.GBeanInfo GBEAN_INFO
           
 
Constructor Summary
TransactionManagerProxy(TransactionManagerProxy.ConstructorParams params)
           
TransactionManagerProxy(TransactionManager delegate, XidImporter importer, Recovery recovery, Collection resourceManagers)
          Constructor taking the TransactionManager to wrap.
 
Method Summary
 void begin()
           
 void begin(Xid xid, long txTimeoutMillis)
           
 void commit()
           
 void commit(Xid xid, boolean onePhase)
           
 void doFail()
           
 void doStart()
           
 void doStop()
           
 void end(Xid xid)
           
 void forget(Xid xid)
           
static org.apache.geronimo.gbean.GBeanInfo getGBeanInfo()
           
 int getStatus()
           
 Transaction getTransaction()
           
 int prepare(Xid xid)
           
 Xid[] recover(int flag)
           
 void resume(Transaction tx)
           
 void rollback()
           
 void rollback(Xid xid)
           
 void setRollbackOnly()
           
 void setTransactionTimeout(int timeout)
           
 Transaction suspend()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

GBEAN_INFO

public static final org.apache.geronimo.gbean.GBeanInfo GBEAN_INFO
Constructor Detail

TransactionManagerProxy

public TransactionManagerProxy(TransactionManager delegate,
                               XidImporter importer,
                               Recovery recovery,
                               Collection resourceManagers)
Constructor taking the TransactionManager to wrap.

Parameters:
delegate - the TransactionManager that should be wrapped

TransactionManagerProxy

public TransactionManagerProxy(TransactionManagerProxy.ConstructorParams params)
Method Detail

doStart

public void doStart()
             throws org.apache.geronimo.gbean.WaitingException,
                    Exception
Specified by:
doStart in interface org.apache.geronimo.gbean.GBeanLifecycle
Throws:
org.apache.geronimo.gbean.WaitingException
Exception

doStop

public void doStop()
            throws org.apache.geronimo.gbean.WaitingException,
                   Exception
Specified by:
doStop in interface org.apache.geronimo.gbean.GBeanLifecycle
Throws:
org.apache.geronimo.gbean.WaitingException
Exception

doFail

public void doFail()
Specified by:
doFail in interface org.apache.geronimo.gbean.GBeanLifecycle

setTransactionTimeout

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

begin

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

getStatus

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

getTransaction

public Transaction getTransaction()
                           throws SystemException
Specified by:
getTransaction in interface TransactionManager
Throws:
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

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

setRollbackOnly

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

commit

public void commit(Xid xid,
                   boolean onePhase)
            throws XAException
Specified by:
commit in interface javax.resource.spi.XATerminator
Throws:
XAException
See Also:
XATerminator.commit(javax.transaction.xa.Xid, boolean)

forget

public void forget(Xid xid)
            throws XAException
Specified by:
forget in interface javax.resource.spi.XATerminator
Throws:
XAException
See Also:
XATerminator.forget(javax.transaction.xa.Xid)

prepare

public int prepare(Xid xid)
            throws XAException
Specified by:
prepare in interface javax.resource.spi.XATerminator
Throws:
XAException
See Also:
XATerminator.prepare(javax.transaction.xa.Xid)

recover

public Xid[] recover(int flag)
              throws XAException
Specified by:
recover in interface javax.resource.spi.XATerminator
Throws:
XAException
See Also:
XATerminator.recover(int)

rollback

public void rollback(Xid xid)
              throws XAException
Specified by:
rollback in interface javax.resource.spi.XATerminator
Throws:
XAException
See Also:
XATerminator.rollback(javax.transaction.xa.Xid)

begin

public void begin(Xid xid,
                  long txTimeoutMillis)
           throws XAException,
                  InvalidTransactionException,
                  SystemException
Specified by:
begin in interface XAWork
Throws:
XAException
InvalidTransactionException
SystemException

end

public void end(Xid xid)
         throws XAException,
                SystemException
Specified by:
end in interface XAWork
Throws:
XAException
SystemException

getGBeanInfo

public static org.apache.geronimo.gbean.GBeanInfo getGBeanInfo()


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