geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: rev 55475 - geronimo/trunk/modules/transaction/src/java/org/apache/geronimo/transaction
Date Mon, 25 Oct 2004 03:21:31 GMT
Author: djencks
Date: Sun Oct 24 20:21:30 2004
New Revision: 55475

Removed:
   geronimo/trunk/modules/transaction/src/java/org/apache/geronimo/transaction/TransactionProxy.java
Modified:
   geronimo/trunk/modules/transaction/src/java/org/apache/geronimo/transaction/GeronimoTransactionManager.java
   geronimo/trunk/modules/transaction/src/java/org/apache/geronimo/transaction/TransactionManagerProxy.java
Log:
Make sure the txmanager proxy exposes ExtendedTransactionManager. Remove TransactionProxy.
Work around bug in GBeanInfoFactory

Modified: geronimo/trunk/modules/transaction/src/java/org/apache/geronimo/transaction/GeronimoTransactionManager.java
==============================================================================
--- geronimo/trunk/modules/transaction/src/java/org/apache/geronimo/transaction/GeronimoTransactionManager.java
(original)
+++ geronimo/trunk/modules/transaction/src/java/org/apache/geronimo/transaction/GeronimoTransactionManager.java
Sun Oct 24 20:21:30 2004
@@ -71,6 +71,7 @@
         infoFactory.addReference("ResourceManagers", ResourceManager.class);
 
         infoFactory.addInterface(TransactionManager.class);
+        infoFactory.addInterface(ExtendedTransactionManager.class);
         infoFactory.addInterface(XidImporter.class);
 
         infoFactory.setConstructor(new String[]{"defaultTransactionTimeoutSeconds", "TransactionLog",
"ResourceManagers"});

Modified: geronimo/trunk/modules/transaction/src/java/org/apache/geronimo/transaction/TransactionManagerProxy.java
==============================================================================
--- geronimo/trunk/modules/transaction/src/java/org/apache/geronimo/transaction/TransactionManagerProxy.java
(original)
+++ geronimo/trunk/modules/transaction/src/java/org/apache/geronimo/transaction/TransactionManagerProxy.java
Sun Oct 24 20:21:30 2004
@@ -31,7 +31,6 @@
 import javax.transaction.Status;
 import javax.transaction.SystemException;
 import javax.transaction.Transaction;
-import javax.transaction.TransactionManager;
 import javax.transaction.xa.XAException;
 import javax.transaction.xa.Xid;
 
@@ -151,7 +150,7 @@
     }
 
     public Transaction begin(long transactionTimeoutMilliseconds) throws NotSupportedException,
SystemException {
-        Transaction tx = new TransactionProxy(delegate.begin(transactionTimeoutMilliseconds));
+        Transaction tx = delegate.begin(transactionTimeoutMilliseconds);
         threadTx.set(tx);
         return tx;
     }
@@ -179,9 +178,6 @@
         if (threadTx.get() != null) {
             throw new IllegalStateException("Transaction already associated with current
thread");
         }
-        if (tx instanceof TransactionProxy == false) {
-            throw new InvalidTransactionException("Cannot resume foreign transaction: " +
tx);
-        }
         threadTx.set(tx);
     }
 
@@ -221,29 +217,25 @@
     //XidImporter implementation. Wrap and unwrap TransactionProxy.
     //the importer functions should not affect the thread context.
     public Transaction importXid(Xid xid, long transactionTimeoutMillis) throws XAException,
SystemException {
-//        if (threadTx.get() != null) {
-//            throw new XAException("Transaction already associated with current thread");
-//        }
-        TransactionProxy transactionProxy = new TransactionProxy(importer.importXid(xid,
transactionTimeoutMillis));
-//        threadTx.set(transactionProxy);
-        return transactionProxy;
+        Transaction tx = importer.importXid(xid, transactionTimeoutMillis);
+        return tx;
     }
 
     //TODO how do these relate to threadTx???? probably not at all...
     public void commit(Transaction tx, boolean onePhase) throws XAException {
-        importer.commit(((TransactionProxy) tx).getDelegate(), onePhase);
+        importer.commit(tx, onePhase);
     }
 
     public void forget(Transaction tx) throws XAException {
-        importer.forget(((TransactionProxy) tx).getDelegate());
+        importer.forget(tx);
     }
 
     public int prepare(Transaction tx) throws XAException {
-        return importer.prepare(((TransactionProxy) tx).getDelegate());
+        return importer.prepare(tx);
     }
 
     public void rollback(Transaction tx) throws XAException {
-        importer.rollback(((TransactionProxy) tx).getDelegate());
+        importer.rollback(tx);
     }
 
     //Recovery implementation
@@ -279,7 +271,7 @@
         for (Iterator iterator = internal.entrySet().iterator(); iterator.hasNext();) {
             Map.Entry entry = (Map.Entry) iterator.next();
             Transaction tx = (Transaction) entry.getValue();
-            external.put(entry.getKey(), new TransactionProxy(tx));
+            external.put(entry.getKey(), tx);
         }
         return external;
     }
@@ -294,7 +286,7 @@
         infoFactory.addReference("recovery", Recovery.class);
         infoFactory.addReference("resourceManagers", ResourceManager.class);
 
-        infoFactory.addInterface(TransactionManager.class);
+        infoFactory.addInterface(ExtendedTransactionManager.class);
         infoFactory.addInterface(XidImporter.class);
 
         infoFactory.setConstructor(new String[]{"delegate", "xidImporter", "recovery", "resourceManagers"});

Mime
View raw message