geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject svn commit: r430508 [2/5] - in /geronimo/trunk: ./ applications/magicGball/magicGball-ear/src/plan/ applications/magicGball/src/plan/ configs/client-corba/src/plan/ configs/client-deployer/src/plan/ configs/client/src/plan/ configs/j2ee-corba/src/plan/...
Date Thu, 10 Aug 2006 19:56:58 GMT
Modified: geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/AdminObjectSource.java
URL: http://svn.apache.org/viewvc/geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/AdminObjectSource.java?rev=430508&r1=430507&r2=430508&view=diff
==============================================================================
--- geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/AdminObjectSource.java (original)
+++ geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/AdminObjectSource.java Thu Aug 10 12:56:47 2006
@@ -18,7 +18,7 @@
 package org.apache.geronimo.connector;
 
 /**
- * @version $Rev:$ $Date:$
+ * @version $Rev$ $Date$
  */
 public interface AdminObjectSource {
 

Modified: geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/ResourceAdapterModuleImpl.java
URL: http://svn.apache.org/viewvc/geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/ResourceAdapterModuleImpl.java?rev=430508&r1=430507&r2=430508&view=diff
==============================================================================
--- geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/ResourceAdapterModuleImpl.java (original)
+++ geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/ResourceAdapterModuleImpl.java Thu Aug 10 12:56:47 2006
@@ -29,7 +29,7 @@
 import org.apache.geronimo.management.geronimo.ResourceAdapterModule;
 
 /**
- * @version $Rev: 395155 $ $Date$
+ * @version $Rev$ $Date$
  */
 public class ResourceAdapterModuleImpl implements ResourceAdapterModule {
     private final J2EEServer server;

Modified: geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/ResourceAdapterWrapper.java
URL: http://svn.apache.org/viewvc/geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/ResourceAdapterWrapper.java?rev=430508&r1=430507&r2=430508&view=diff
==============================================================================
--- geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/ResourceAdapterWrapper.java (original)
+++ geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/ResourceAdapterWrapper.java Thu Aug 10 12:56:47 2006
@@ -17,8 +17,6 @@
 
 package org.apache.geronimo.connector;
 
-import org.apache.geronimo.connector.work.GeronimoWorkManager;
-
 import javax.resource.ResourceException;
 import javax.resource.spi.ActivationSpec;
 import javax.resource.spi.BootstrapContext;
@@ -52,18 +50,18 @@
         this.resourceAdapter = null;
     }
 
-    public ResourceAdapterWrapper(final String resourceAdapterClass,
-                                  final GeronimoWorkManager workManager,
-                                  ClassLoader cl) throws InstantiationException, IllegalAccessException, ClassNotFoundException {
+    public ResourceAdapterWrapper(String resourceAdapterClass,
+            BootstrapContext bootstrapContext,
+            ClassLoader cl) throws InstantiationException, IllegalAccessException, ClassNotFoundException {
         this.resourceAdapterClass = resourceAdapterClass;
-        this.bootstrapContext = new BootstrapContextImpl(workManager);
+        this.bootstrapContext = bootstrapContext;
         Class clazz = cl.loadClass(resourceAdapterClass);
         resourceAdapter = (ResourceAdapter) clazz.newInstance();
     }
     
-    public ResourceAdapterWrapper(ResourceAdapter resourceAdapter, final GeronimoWorkManager workManager) {
+    public ResourceAdapterWrapper(ResourceAdapter resourceAdapter, BootstrapContext bootstrapContext) {
         this.resourceAdapterClass = resourceAdapter.getClass().getName();
-        this.bootstrapContext = new BootstrapContextImpl(workManager);
+        this.bootstrapContext = bootstrapContext;
         this.resourceAdapter = resourceAdapter;
     }
 

Modified: geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/ResourceAdapterWrapperGBean.java
URL: http://svn.apache.org/viewvc/geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/ResourceAdapterWrapperGBean.java?rev=430508&r1=430507&r2=430508&view=diff
==============================================================================
--- geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/ResourceAdapterWrapperGBean.java (original)
+++ geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/ResourceAdapterWrapperGBean.java Thu Aug 10 12:56:47 2006
@@ -17,7 +17,6 @@
 
 package org.apache.geronimo.connector;
 
-import org.apache.geronimo.connector.work.GeronimoWorkManager;
 import org.apache.geronimo.gbean.DynamicGBean;
 import org.apache.geronimo.gbean.DynamicGBeanDelegate;
 import org.apache.geronimo.gbean.GBeanInfo;
@@ -28,6 +27,8 @@
 
 import javax.resource.spi.ResourceAdapter;
 import javax.resource.spi.ResourceAdapterAssociation;
+import javax.resource.spi.XATerminator;
+import javax.resource.spi.work.WorkManager;
 
 /**
  * 
@@ -43,8 +44,8 @@
         objectName = null;
     }
 
-    public ResourceAdapterWrapperGBean(final String resourceAdapterClass, final GeronimoWorkManager workManager, ClassLoader cl, String objectName) throws InstantiationException, IllegalAccessException, ClassNotFoundException {
-        super(resourceAdapterClass, workManager, cl);
+    public ResourceAdapterWrapperGBean(String resourceAdapterClass, WorkManager workManager, XATerminator xaTerminator, ClassLoader cl, String objectName) throws InstantiationException, IllegalAccessException, ClassNotFoundException {
+        super(resourceAdapterClass, new GeronimoBootstrapContext (workManager, xaTerminator), cl);
         delegate = new DynamicGBeanDelegate();
         delegate.addAll(resourceAdapter);
         this.objectName = objectName;
@@ -87,14 +88,15 @@
         infoBuilder.addAttribute("classLoader", ClassLoader.class, false);
         infoBuilder.addAttribute("objectName", String.class, false);
 
-        infoBuilder.addReference("WorkManager", GeronimoWorkManager.class, NameFactory.JCA_WORK_MANAGER);
+        infoBuilder.addReference("WorkManager", WorkManager.class, NameFactory.JCA_WORK_MANAGER);
+        infoBuilder.addReference("XATerminator", XATerminator.class, NameFactory.JCA_WORK_MANAGER);
 
         infoBuilder.addOperation("registerResourceAdapterAssociation", new Class[]{ResourceAdapterAssociation.class});
 
         infoBuilder.addInterface(ResourceAdapter.class);
         infoBuilder.addInterface(JCAResourceAdapter.class);
 
-        infoBuilder.setConstructor(new String[]{"resourceAdapterClass", "WorkManager", "classLoader", "objectName"});
+        infoBuilder.setConstructor(new String[]{"resourceAdapterClass", "WorkManager", "XATerminator", "classLoader", "objectName"});
 
         GBEAN_INFO = infoBuilder.getBeanInfo();
     }

Modified: geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/outbound/ConnectionFactorySource.java
URL: http://svn.apache.org/viewvc/geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/outbound/ConnectionFactorySource.java?rev=430508&r1=430507&r2=430508&view=diff
==============================================================================
--- geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/outbound/ConnectionFactorySource.java (original)
+++ geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/outbound/ConnectionFactorySource.java Thu Aug 10 12:56:47 2006
@@ -18,7 +18,7 @@
 package org.apache.geronimo.connector.outbound;
 
 /**
- * @version $Rev:$ $Date:$
+ * @version $Rev$ $Date$
  */
 public interface ConnectionFactorySource {
 

Modified: geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/outbound/GenericConnectionManager.java
URL: http://svn.apache.org/viewvc/geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/outbound/GenericConnectionManager.java?rev=430508&r1=430507&r2=430508&view=diff
==============================================================================
--- geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/outbound/GenericConnectionManager.java (original)
+++ geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/outbound/GenericConnectionManager.java Thu Aug 10 12:56:47 2006
@@ -17,11 +17,12 @@
 
 package org.apache.geronimo.connector.outbound;
 
+import javax.transaction.TransactionManager;
+
 import org.apache.geronimo.connector.outbound.connectionmanagerconfig.PartitionedPool;
 import org.apache.geronimo.connector.outbound.connectionmanagerconfig.PoolingSupport;
 import org.apache.geronimo.connector.outbound.connectionmanagerconfig.TransactionSupport;
 import org.apache.geronimo.connector.outbound.connectiontracking.ConnectionTracker;
-import org.apache.geronimo.transaction.context.TransactionContextManager;
 
 /**
  * GenericConnectionManager sets up a connection manager stack according to the
@@ -40,10 +41,10 @@
                                     PoolingSupport pooling,
                                     boolean containerManagedSecurity,
                                     ConnectionTracker connectionTracker,
-                                    TransactionContextManager transactionContextManager,
+                                    TransactionManager transactionManager,
                                     String objectName,
                                     ClassLoader classLoader) {
-        super(new InterceptorsImpl(transactionSupport, pooling, containerManagedSecurity, objectName, connectionTracker, transactionContextManager, classLoader));
+        super(new InterceptorsImpl(transactionSupport, pooling, containerManagedSecurity, objectName, connectionTracker, transactionManager, classLoader));
     }
 
     private static class InterceptorsImpl implements AbstractConnectionManager.Interceptors {
@@ -70,7 +71,7 @@
                                 boolean containerManagedSecurity,
                                 String objectName,
                                 ConnectionTracker connectionTracker,
-                                TransactionContextManager transactionContextManager,
+                                TransactionManager transactionManager,
                                 ClassLoader classLoader) {
             //check for consistency between attributes
             if (!containerManagedSecurity && pooling instanceof PartitionedPool && ((PartitionedPool) pooling).isPartitionBySubject()) {
@@ -84,7 +85,7 @@
             stack = transactionSupport.addXAResourceInsertionInterceptor(stack, objectName);
             stack = pooling.addPoolingInterceptors(stack);
             this.poolingSupport = pooling;
-            stack = transactionSupport.addTransactionInterceptors(stack, transactionContextManager);
+            stack = transactionSupport.addTransactionInterceptors(stack, transactionManager);
 
             if (containerManagedSecurity) {
                 stack = new SubjectInterceptor(stack);

Modified: geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/outbound/GenericConnectionManagerGBean.java
URL: http://svn.apache.org/viewvc/geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/outbound/GenericConnectionManagerGBean.java?rev=430508&r1=430507&r2=430508&view=diff
==============================================================================
--- geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/outbound/GenericConnectionManagerGBean.java (original)
+++ geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/outbound/GenericConnectionManagerGBean.java Thu Aug 10 12:56:47 2006
@@ -17,6 +17,8 @@
 package org.apache.geronimo.connector.outbound;
 
 import javax.resource.spi.ConnectionManager;
+import javax.transaction.TransactionManager;
+
 import org.apache.geronimo.connector.outbound.connectionmanagerconfig.PoolingSupport;
 import org.apache.geronimo.connector.outbound.connectionmanagerconfig.TransactionSupport;
 import org.apache.geronimo.connector.outbound.connectiontracking.ConnectionTracker;
@@ -24,7 +26,6 @@
 import org.apache.geronimo.gbean.GBeanInfoBuilder;
 import org.apache.geronimo.gbean.GBeanLifecycle;
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
-import org.apache.geronimo.transaction.context.TransactionContextManager;
 import org.apache.geronimo.kernel.Kernel;
 import org.apache.geronimo.kernel.proxy.ProxyManager;
 
@@ -43,11 +44,11 @@
                                          PoolingSupport pooling,
                                          boolean containerManagedSecurity,
                                          ConnectionTracker connectionTracker,
-                                         TransactionContextManager transactionContextManager,
+                                         TransactionManager transactionManager,
                                          String objectName,
                                          ClassLoader classLoader,
                                          Kernel kernel) {
-        super(transactionSupport, pooling, containerManagedSecurity, connectionTracker, transactionContextManager, objectName, classLoader);
+        super(transactionSupport, pooling, containerManagedSecurity, connectionTracker, transactionManager, objectName, classLoader);
         this.kernel = kernel;
     }
 
@@ -75,7 +76,7 @@
         infoBuilder.addAttribute("kernel", Kernel.class, false);
 
         infoBuilder.addReference("ConnectionTracker", ConnectionTracker.class, NameFactory.JCA_CONNECTION_TRACKER);
-        infoBuilder.addReference("TransactionContextManager", TransactionContextManager.class, NameFactory.TRANSACTION_CONTEXT_MANAGER);
+        infoBuilder.addReference("TransactionManager", TransactionManager.class, NameFactory.TRANSACTION_MANAGER);
 
 
         infoBuilder.setConstructor(new String[]{
@@ -83,7 +84,7 @@
             "pooling",
             "containerManagedSecurity",
             "ConnectionTracker",
-            "TransactionContextManager",
+            "TransactionManager",
             "objectName",
             "classLoader",
             "kernel"

Modified: geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/outbound/TransactionCachingInterceptor.java
URL: http://svn.apache.org/viewvc/geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/outbound/TransactionCachingInterceptor.java?rev=430508&r1=430507&r2=430508&view=diff
==============================================================================
--- geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/outbound/TransactionCachingInterceptor.java (original)
+++ geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/outbound/TransactionCachingInterceptor.java Thu Aug 10 12:56:47 2006
@@ -22,10 +22,11 @@
 import java.util.Iterator;
 import java.util.Set;
 import javax.resource.ResourceException;
+import javax.transaction.Transaction;
+import javax.transaction.TransactionManager;
 
-import org.apache.geronimo.transaction.ConnectionReleaser;
-import org.apache.geronimo.transaction.context.TransactionContext;
-import org.apache.geronimo.transaction.context.TransactionContextManager;
+import org.apache.geronimo.connector.ConnectorTransactionContext;
+import org.apache.geronimo.connector.ConnectionReleaser;
 
 /**
  * TransactionCachingInterceptor.java
@@ -50,22 +51,25 @@
 public class TransactionCachingInterceptor implements ConnectionInterceptor, ConnectionReleaser {
 
     private final ConnectionInterceptor next;
-    private final TransactionContextManager transactionContextManager;
+    private final TransactionManager transactionManager;
 
-    public TransactionCachingInterceptor(ConnectionInterceptor next, TransactionContextManager transactionContextManager) {
+    public TransactionCachingInterceptor(ConnectionInterceptor next, TransactionManager transactionManager) {
         this.next = next;
-        this.transactionContextManager = transactionContextManager;
+        this.transactionManager = transactionManager;
     }
 
     public void getConnection(ConnectionInfo connectionInfo) throws ResourceException {
         //There can be an inactive transaction context when a connection is requested in
         //Synchronization.afterCompletion().
-        TransactionContext transactionContext = transactionContextManager.getContext();
-        if (transactionContext != null && transactionContext.isInheritable() && transactionContext.isActive()) {
-            ManagedConnectionInfos managedConnectionInfos = (ManagedConnectionInfos) transactionContext.getManagedConnectionInfo(this);
+
+        // get the current transation and status... if there is a problem just assume there is no transaction present
+        Transaction transaction = TxUtil.getTransactionIfActive(transactionManager);
+        if (transaction != null) {
+            ConnectorTransactionContext connectorTransactionContext = ConnectorTransactionContext.get(transaction);
+            ManagedConnectionInfos managedConnectionInfos = (ManagedConnectionInfos) connectorTransactionContext.getManagedConnectionInfo(this);
             if (managedConnectionInfos == null) {
                 managedConnectionInfos = new ManagedConnectionInfos();
-                transactionContext.setManagedConnectionInfo(this, managedConnectionInfos);
+                connectorTransactionContext.setManagedConnectionInfo(this, managedConnectionInfos);
             }
             if (connectionInfo.isUnshareable()) {
                 if (!managedConnectionInfos.containsUnshared(connectionInfo.getManagedConnectionInfo())) {
@@ -94,8 +98,7 @@
             return;
         }
 
-        TransactionContext transactionContext = transactionContextManager.getContext();
-        if (transactionContext != null && transactionContext.isInheritable() && transactionContext.isActive()) {
+        if (TxUtil.isTransactionActive(transactionManager)) {
             return;
         }
         internalReturn(connectionInfo, connectionReturnAction);
@@ -112,7 +115,7 @@
     public void destroy() {
         next.destroy();
     }
-    
+
     public void afterCompletion(Object stuff) {
         ManagedConnectionInfos managedConnectionInfos = (ManagedConnectionInfos) stuff;
         ManagedConnectionInfo sharedMCI = managedConnectionInfos.getShared();

Modified: geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/outbound/TransactionEnlistingInterceptor.java
URL: http://svn.apache.org/viewvc/geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/outbound/TransactionEnlistingInterceptor.java?rev=430508&r1=430507&r2=430508&view=diff
==============================================================================
--- geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/outbound/TransactionEnlistingInterceptor.java (original)
+++ geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/outbound/TransactionEnlistingInterceptor.java Thu Aug 10 12:56:47 2006
@@ -20,11 +20,10 @@
 import javax.resource.ResourceException;
 import javax.transaction.RollbackException;
 import javax.transaction.SystemException;
+import javax.transaction.Transaction;
+import javax.transaction.TransactionManager;
 import javax.transaction.xa.XAResource;
 
-import org.apache.geronimo.transaction.context.TransactionContext;
-import org.apache.geronimo.transaction.context.TransactionContextManager;
-
 /**
  * TransactionEnlistingInterceptor.java
  * <p/>
@@ -36,21 +35,23 @@
 public class TransactionEnlistingInterceptor implements ConnectionInterceptor {
 
     private final ConnectionInterceptor next;
-    private final TransactionContextManager transactionContextManager;
+    private final TransactionManager transactionManager;
 
-    public TransactionEnlistingInterceptor(ConnectionInterceptor next, TransactionContextManager transactionContextManager) {
+    public TransactionEnlistingInterceptor(ConnectionInterceptor next, TransactionManager transactionManager) {
         this.next = next;
-        this.transactionContextManager = transactionContextManager;
+        this.transactionManager = transactionManager;
     }
 
     public void getConnection(ConnectionInfo connectionInfo) throws ResourceException {
         next.getConnection(connectionInfo);
         try {
             ManagedConnectionInfo mci = connectionInfo.getManagedConnectionInfo();
-            TransactionContext transactionContext = transactionContextManager.getContext();
-            if (transactionContext != null && transactionContext.isInheritable() && transactionContext.isActive()) {
+
+            // get the current transation and status... if there is a problem just assume there is no transaction present
+            Transaction transaction = TxUtil.getTransactionIfActive(transactionManager);
+            if (transaction != null) {
                 XAResource xares = mci.getXAResource();
-                transactionContext.enlistResource(xares);
+                transaction.enlistResource(xares);
             }
         } catch (SystemException e) {
             returnConnection(connectionInfo, ConnectionReturnAction.DESTROY);
@@ -78,10 +79,10 @@
                                  ConnectionReturnAction connectionReturnAction) {
         try {
             ManagedConnectionInfo mci = connectionInfo.getManagedConnectionInfo();
-            TransactionContext transactionContext = transactionContextManager.getContext();
-            if (transactionContext != null && transactionContext.isInheritable() && transactionContext.isActive()) {
+            Transaction transaction = TxUtil.getTransactionIfActive(transactionManager);
+            if (transaction != null) {
                 XAResource xares = mci.getXAResource();
-                transactionContext.delistResource(xares, XAResource.TMSUSPEND);
+                transaction.delistResource(xares, XAResource.TMSUSPEND);
             }
 
         } catch (SystemException e) {
@@ -97,5 +98,5 @@
     public void destroy() {
         next.destroy();
     }
-    
+
 }

Modified: geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/outbound/connectionmanagerconfig/LocalTransactions.java
URL: http://svn.apache.org/viewvc/geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/outbound/connectionmanagerconfig/LocalTransactions.java?rev=430508&r1=430507&r2=430508&view=diff
==============================================================================
--- geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/outbound/connectionmanagerconfig/LocalTransactions.java (original)
+++ geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/outbound/connectionmanagerconfig/LocalTransactions.java Thu Aug 10 12:56:47 2006
@@ -17,11 +17,12 @@
 
 package org.apache.geronimo.connector.outbound.connectionmanagerconfig;
 
+import javax.transaction.TransactionManager;
+
 import org.apache.geronimo.connector.outbound.ConnectionInterceptor;
 import org.apache.geronimo.connector.outbound.LocalXAResourceInsertionInterceptor;
 import org.apache.geronimo.connector.outbound.TransactionCachingInterceptor;
 import org.apache.geronimo.connector.outbound.TransactionEnlistingInterceptor;
-import org.apache.geronimo.transaction.context.TransactionContextManager;
 
 /**
  *
@@ -39,8 +40,8 @@
         return new LocalXAResourceInsertionInterceptor(stack, name);
     }
 
-    public ConnectionInterceptor addTransactionInterceptors(ConnectionInterceptor stack, TransactionContextManager transactionContextManager) {
-        stack = new TransactionEnlistingInterceptor(stack, transactionContextManager);
-        return new TransactionCachingInterceptor(stack, transactionContextManager);
+    public ConnectionInterceptor addTransactionInterceptors(ConnectionInterceptor stack, TransactionManager transactionManager) {
+        stack = new TransactionEnlistingInterceptor(stack, transactionManager);
+        return new TransactionCachingInterceptor(stack, transactionManager);
     }
 }

Modified: geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/outbound/connectionmanagerconfig/NoTransactions.java
URL: http://svn.apache.org/viewvc/geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/outbound/connectionmanagerconfig/NoTransactions.java?rev=430508&r1=430507&r2=430508&view=diff
==============================================================================
--- geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/outbound/connectionmanagerconfig/NoTransactions.java (original)
+++ geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/outbound/connectionmanagerconfig/NoTransactions.java Thu Aug 10 12:56:47 2006
@@ -17,8 +17,9 @@
 
 package org.apache.geronimo.connector.outbound.connectionmanagerconfig;
 
+import javax.transaction.TransactionManager;
+
 import org.apache.geronimo.connector.outbound.ConnectionInterceptor;
-import org.apache.geronimo.transaction.context.TransactionContextManager;
 
 /**
  *
@@ -36,7 +37,7 @@
         return stack;
     }
 
-    public ConnectionInterceptor addTransactionInterceptors(ConnectionInterceptor stack, TransactionContextManager transactionContextManager) {
+    public ConnectionInterceptor addTransactionInterceptors(ConnectionInterceptor stack, TransactionManager transactionManager) {
         return stack;
     }
 }

Modified: geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/outbound/connectionmanagerconfig/TransactionLog.java
URL: http://svn.apache.org/viewvc/geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/outbound/connectionmanagerconfig/TransactionLog.java?rev=430508&r1=430507&r2=430508&view=diff
==============================================================================
--- geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/outbound/connectionmanagerconfig/TransactionLog.java (original)
+++ geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/outbound/connectionmanagerconfig/TransactionLog.java Thu Aug 10 12:56:47 2006
@@ -17,11 +17,12 @@
 
 package org.apache.geronimo.connector.outbound.connectionmanagerconfig;
 
+import javax.transaction.TransactionManager;
+
 import org.apache.geronimo.connector.outbound.ConnectionInterceptor;
 import org.apache.geronimo.connector.outbound.TransactionCachingInterceptor;
 import org.apache.geronimo.connector.outbound.TransactionEnlistingInterceptor;
 import org.apache.geronimo.connector.outbound.transactionlog.LogXAResourceInsertionInterceptor;
-import org.apache.geronimo.transaction.context.TransactionContextManager;
 
 /**
  *
@@ -40,8 +41,8 @@
         return new LogXAResourceInsertionInterceptor(stack, name);
     }
 
-    public ConnectionInterceptor addTransactionInterceptors(ConnectionInterceptor stack, TransactionContextManager transactionContextManager) {
-        stack = new TransactionEnlistingInterceptor(stack, transactionContextManager);
-        return new TransactionCachingInterceptor(stack, transactionContextManager);
+    public ConnectionInterceptor addTransactionInterceptors(ConnectionInterceptor stack, TransactionManager transactionManager) {
+        stack = new TransactionEnlistingInterceptor(stack, transactionManager);
+        return new TransactionCachingInterceptor(stack, transactionManager);
     }
 }

Modified: geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/outbound/connectionmanagerconfig/TransactionSupport.java
URL: http://svn.apache.org/viewvc/geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/outbound/connectionmanagerconfig/TransactionSupport.java?rev=430508&r1=430507&r2=430508&view=diff
==============================================================================
--- geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/outbound/connectionmanagerconfig/TransactionSupport.java (original)
+++ geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/outbound/connectionmanagerconfig/TransactionSupport.java Thu Aug 10 12:56:47 2006
@@ -19,8 +19,9 @@
 
 import java.io.Serializable;
 
+import javax.transaction.TransactionManager;
+
 import org.apache.geronimo.connector.outbound.ConnectionInterceptor;
-import org.apache.geronimo.transaction.context.TransactionContextManager;
 
 /**
  *
@@ -30,6 +31,6 @@
  * */
 public abstract class TransactionSupport implements Serializable {
     public abstract ConnectionInterceptor addXAResourceInsertionInterceptor(ConnectionInterceptor stack, String name);
-    public abstract ConnectionInterceptor addTransactionInterceptors(ConnectionInterceptor stack, TransactionContextManager transactionContextManager);
+    public abstract ConnectionInterceptor addTransactionInterceptors(ConnectionInterceptor stack, TransactionManager transactionManager);
 
 }

Modified: geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/outbound/connectionmanagerconfig/XATransactions.java
URL: http://svn.apache.org/viewvc/geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/outbound/connectionmanagerconfig/XATransactions.java?rev=430508&r1=430507&r2=430508&view=diff
==============================================================================
--- geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/outbound/connectionmanagerconfig/XATransactions.java (original)
+++ geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/outbound/connectionmanagerconfig/XATransactions.java Thu Aug 10 12:56:47 2006
@@ -17,12 +17,13 @@
 
 package org.apache.geronimo.connector.outbound.connectionmanagerconfig;
 
+import javax.transaction.TransactionManager;
+
 import org.apache.geronimo.connector.outbound.ConnectionInterceptor;
 import org.apache.geronimo.connector.outbound.ThreadLocalCachingConnectionInterceptor;
 import org.apache.geronimo.connector.outbound.TransactionCachingInterceptor;
 import org.apache.geronimo.connector.outbound.TransactionEnlistingInterceptor;
 import org.apache.geronimo.connector.outbound.XAResourceInsertionInterceptor;
-import org.apache.geronimo.transaction.context.TransactionContextManager;
 
 /**
  *
@@ -59,15 +60,15 @@
         return new XAResourceInsertionInterceptor(stack, name);
     }
 
-    public ConnectionInterceptor addTransactionInterceptors(ConnectionInterceptor stack, TransactionContextManager transactionContextManager) {
+    public ConnectionInterceptor addTransactionInterceptors(ConnectionInterceptor stack, TransactionManager transactionManager) {
         //experimental thread local caching
         if (isUseThreadCaching()) {
             //useMatching should be configurable
             stack = new ThreadLocalCachingConnectionInterceptor(stack, false);
         }
-        stack = new TransactionEnlistingInterceptor(stack, transactionContextManager);
+        stack = new TransactionEnlistingInterceptor(stack, transactionManager);
         if (isUseTransactionCaching()) {
-            stack = new TransactionCachingInterceptor(stack, transactionContextManager);
+            stack = new TransactionCachingInterceptor(stack, transactionManager);
         }
         return stack;
     }

Modified: geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/outbound/connectiontracking/ConnectionTrackingCoordinator.java
URL: http://svn.apache.org/viewvc/geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/outbound/connectiontracking/ConnectionTrackingCoordinator.java?rev=430508&r1=430507&r2=430508&view=diff
==============================================================================
--- geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/outbound/connectiontracking/ConnectionTrackingCoordinator.java (original)
+++ geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/outbound/connectiontracking/ConnectionTrackingCoordinator.java Thu Aug 10 12:56:47 2006
@@ -22,14 +22,11 @@
 import java.util.Iterator;
 import java.util.Map;
 import java.util.Set;
-
 import javax.resource.ResourceException;
 
 import org.apache.geronimo.connector.outbound.ConnectionInfo;
 import org.apache.geronimo.connector.outbound.ConnectionTrackingInterceptor;
 import org.apache.geronimo.connector.outbound.ManagedConnectionInfo;
-import org.apache.geronimo.transaction.InstanceContext;
-import org.apache.geronimo.transaction.TrackedConnectionAssociator;
 
 /**
  * ConnectionTrackingCoordinator tracks connections that are in use by
@@ -51,16 +48,16 @@
 
     private final ThreadLocal currentInstanceContexts = new ThreadLocal();
 
-    public InstanceContext enter(InstanceContext newInstanceContext)
+    public ConnectorInstanceContext enter(ConnectorInstanceContext newConnectorInstanceContext)
             throws ResourceException {
-        InstanceContext oldInstanceContext = (InstanceContext) currentInstanceContexts.get();
-        currentInstanceContexts.set(newInstanceContext);
-        notifyConnections(newInstanceContext);
-        return oldInstanceContext;
+        ConnectorInstanceContext oldConnectorInstanceContext = (ConnectorInstanceContext) currentInstanceContexts.get();
+        currentInstanceContexts.set(newConnectorInstanceContext);
+        notifyConnections(newConnectorInstanceContext);
+        return oldConnectorInstanceContext;
     }
 
-    private void notifyConnections(InstanceContext oldInstanceContext) throws ResourceException {
-        Map connectionManagerToManagedConnectionInfoMap = oldInstanceContext.getConnectionManagerMap();
+    private void notifyConnections(ConnectorInstanceContext oldConnectorInstanceContext) throws ResourceException {
+        Map connectionManagerToManagedConnectionInfoMap = oldConnectorInstanceContext.getConnectionManagerMap();
         for (Iterator i = connectionManagerToManagedConnectionInfoMap.entrySet().iterator(); i.hasNext();) {
             Map.Entry entry = (Map.Entry) i.next();
             ConnectionTrackingInterceptor mcci =
@@ -71,14 +68,17 @@
     }
 
     public void newTransaction() throws ResourceException {
-        InstanceContext oldInstanceContext = (InstanceContext) currentInstanceContexts.get();
-        notifyConnections(oldInstanceContext);
+        ConnectorInstanceContext oldConnectorInstanceContext = (ConnectorInstanceContext) currentInstanceContexts.get();
+        if (oldConnectorInstanceContext == null) {
+            return;
+        }
+        notifyConnections(oldConnectorInstanceContext);
     }
 
-    public void exit(InstanceContext reenteringInstanceContext)
+    public void exit(ConnectorInstanceContext reenteringConnectorInstanceContext)
             throws ResourceException {
-        InstanceContext oldInstanceContext = (InstanceContext) currentInstanceContexts.get();
-        Map resources = oldInstanceContext.getConnectionManagerMap();
+        ConnectorInstanceContext oldConnectorInstanceContext = (ConnectorInstanceContext) currentInstanceContexts.get();
+        Map resources = oldConnectorInstanceContext.getConnectionManagerMap();
         for (Iterator i = resources.entrySet().iterator(); i.hasNext();) {
             Map.Entry entry = (Map.Entry) i.next();
             ConnectionTrackingInterceptor mcci =
@@ -89,18 +89,18 @@
                 i.remove();
             }
         }
-        currentInstanceContexts.set(reenteringInstanceContext);
+        currentInstanceContexts.set(reenteringConnectorInstanceContext);
     }
 
 
     public void handleObtained(
             ConnectionTrackingInterceptor connectionTrackingInterceptor,
             ConnectionInfo connectionInfo) {
-        InstanceContext instanceContext = (InstanceContext) currentInstanceContexts.get();
-        if (instanceContext == null) {
+        ConnectorInstanceContext connectorInstanceContext = (ConnectorInstanceContext) currentInstanceContexts.get();
+        if (connectorInstanceContext == null) {
             return;
         }
-        Map resources = instanceContext.getConnectionManagerMap();
+        Map resources = connectorInstanceContext.getConnectionManagerMap();
         Set infos = (Set) resources.get(connectionTrackingInterceptor);
         if (infos == null) {
             infos = new HashSet();
@@ -112,11 +112,11 @@
     public void handleReleased(
             ConnectionTrackingInterceptor connectionTrackingInterceptor,
             ConnectionInfo connectionInfo) {
-        InstanceContext instanceContext = (InstanceContext) currentInstanceContexts.get();
-        if (instanceContext == null) {
+        ConnectorInstanceContext connectorInstanceContext = (ConnectorInstanceContext) currentInstanceContexts.get();
+        if (connectorInstanceContext == null) {
             return;
         }
-        Map resources = instanceContext.getConnectionManagerMap();
+        Map resources = connectorInstanceContext.getConnectionManagerMap();
         Set infos = (Set) resources.get(connectionTrackingInterceptor);
         if (connectionInfo.getConnectionHandle() == null) {
             //destroy was called as a result of an error
@@ -129,12 +129,12 @@
     }
 
     public void setEnvironment(ConnectionInfo connectionInfo, String key) {
-        InstanceContext currentInstanceContext = (InstanceContext) currentInstanceContexts.get();
-        if (currentInstanceContext != null) {
-            Set unshareableResources = currentInstanceContext.getUnshareableResources();
+        ConnectorInstanceContext currentConnectorInstanceContext = (ConnectorInstanceContext) currentInstanceContexts.get();
+        if (currentConnectorInstanceContext != null) {
+            Set unshareableResources = currentConnectorInstanceContext.getUnshareableResources();
             boolean unshareable = unshareableResources.contains(key);
             connectionInfo.setUnshareable(unshareable);
-            Set applicationManagedSecurityResources = currentInstanceContext.getApplicationManagedSecurityResources();
+            Set applicationManagedSecurityResources = currentConnectorInstanceContext.getApplicationManagedSecurityResources();
             boolean applicationManagedSecurity = applicationManagedSecurityResources.contains(key);
             connectionInfo.setApplicationManagedSecurity(applicationManagedSecurity);
         }

Modified: geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/outbound/connectiontracking/ConnectionTrackingCoordinatorGBean.java
URL: http://svn.apache.org/viewvc/geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/outbound/connectiontracking/ConnectionTrackingCoordinatorGBean.java?rev=430508&r1=430507&r2=430508&view=diff
==============================================================================
--- geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/outbound/connectiontracking/ConnectionTrackingCoordinatorGBean.java (original)
+++ geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/outbound/connectiontracking/ConnectionTrackingCoordinatorGBean.java Thu Aug 10 12:56:47 2006
@@ -19,21 +19,46 @@
 
 import org.apache.geronimo.gbean.GBeanInfo;
 import org.apache.geronimo.gbean.GBeanInfoBuilder;
+import org.apache.geronimo.gbean.GBeanLifecycle;
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
-import org.apache.geronimo.transaction.TrackedConnectionAssociator;
+import org.apache.geronimo.transaction.manager.MonitorableTransactionManager;
 
 /**
  * 
  * @version $Revision$
  */
-public class ConnectionTrackingCoordinatorGBean {
-    
+public class ConnectionTrackingCoordinatorGBean extends ConnectionTrackingCoordinator implements GBeanLifecycle {
+    private final MonitorableTransactionManager monitorableTm;
+    private final GeronimoTransactionListener listener;
+
+    public ConnectionTrackingCoordinatorGBean(MonitorableTransactionManager monitorableTm) {
+        this.monitorableTm = monitorableTm;
+        listener = new GeronimoTransactionListener(this);
+    }
+
+    public void doStart() throws Exception {
+        monitorableTm.addTransactionAssociationListener(listener);
+    }
+
+    public void doStop() throws Exception {
+        monitorableTm.removeTransactionAssociationListener(listener);
+    }
+
+    public void doFail() {
+        monitorableTm.removeTransactionAssociationListener(listener);
+    }
+
     public final static GBeanInfo GBEAN_INFO;
 
     static {
-        GBeanInfoBuilder infoFactory = GBeanInfoBuilder.createStatic(ConnectionTrackingCoordinatorGBean.class, ConnectionTrackingCoordinator.class, NameFactory.JCA_CONNECTION_TRACKER);
+        GBeanInfoBuilder infoFactory = GBeanInfoBuilder.createStatic(ConnectionTrackingCoordinatorGBean.class, NameFactory.JCA_CONNECTION_TRACKER);
+
+        infoFactory.addReference("TransactionManager", MonitorableTransactionManager.class, NameFactory.TRANSACTION_MANAGER);
+
         infoFactory.addInterface(TrackedConnectionAssociator.class);
         infoFactory.addInterface(ConnectionTracker.class);
+
+        infoFactory.setConstructor(new String[] {"TransactionManager"});
         GBEAN_INFO = infoFactory.getBeanInfo();
     }
 

Modified: geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/work/GeronimoWorkManager.java
URL: http://svn.apache.org/viewvc/geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/work/GeronimoWorkManager.java?rev=430508&r1=430507&r2=430508&view=diff
==============================================================================
--- geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/work/GeronimoWorkManager.java (original)
+++ geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/work/GeronimoWorkManager.java Thu Aug 10 12:56:47 2006
@@ -17,19 +17,19 @@
 
 package org.apache.geronimo.connector.work;
 
-import javax.resource.spi.XATerminator;
 import javax.resource.spi.work.ExecutionContext;
 import javax.resource.spi.work.Work;
 import javax.resource.spi.work.WorkCompletedException;
 import javax.resource.spi.work.WorkException;
 import javax.resource.spi.work.WorkListener;
 import javax.resource.spi.work.WorkManager;
+
+import EDU.oswego.cs.dl.util.concurrent.Executor;
 import org.apache.geronimo.connector.work.pool.ScheduleWorkExecutor;
 import org.apache.geronimo.connector.work.pool.StartWorkExecutor;
 import org.apache.geronimo.connector.work.pool.SyncWorkExecutor;
 import org.apache.geronimo.connector.work.pool.WorkExecutor;
-import org.apache.geronimo.pool.GeronimoExecutor;
-import org.apache.geronimo.transaction.context.TransactionContextManager;
+import org.apache.geronimo.transaction.manager.XAWork;
 
 /**
  * WorkManager implementation which uses under the cover three WorkExecutorPool
@@ -49,21 +49,21 @@
      * Pool of threads used by this WorkManager in order to process
      * the Work instances submitted via the doWork methods.
      */
-    private GeronimoExecutor syncWorkExecutorPool;
+    private Executor syncWorkExecutorPool;
 
     /**
      * Pool of threads used by this WorkManager in order to process
      * the Work instances submitted via the startWork methods.
      */
-    private GeronimoExecutor startWorkExecutorPool;
+    private Executor startWorkExecutorPool;
 
     /**
      * Pool of threads used by this WorkManager in order to process
      * the Work instances submitted via the scheduleWork methods.
      */
-    private GeronimoExecutor scheduledWorkExecutorPool;
+    private Executor scheduledWorkExecutorPool;
 
-    private final TransactionContextManager transactionContextManager;
+    private final XAWork transactionManager;
 
     private final WorkExecutor scheduleWorkExecutor = new ScheduleWorkExecutor();
     private final WorkExecutor startWorkExecutor = new StartWorkExecutor();
@@ -76,11 +76,11 @@
         this(null, null, null, null);
     }
 
-    public GeronimoWorkManager(GeronimoExecutor sync, GeronimoExecutor start, GeronimoExecutor sched, TransactionContextManager transactionContextManager) {
+    public GeronimoWorkManager(Executor sync, Executor start, Executor sched, XAWork xaWork) {
         syncWorkExecutorPool = sync;
         startWorkExecutorPool = start;
         scheduledWorkExecutorPool = sched;
-        this.transactionContextManager = transactionContextManager;
+        this.transactionManager = xaWork;
     }
 
     public void doStart() throws Exception {
@@ -97,19 +97,15 @@
         }
     }
 
-    public XATerminator getXATerminator() {
-        return transactionContextManager;
-    }
-
-    public GeronimoExecutor getSyncWorkExecutorPool() {
+    public Executor getSyncWorkExecutorPool() {
         return syncWorkExecutorPool;
     }
 
-    public GeronimoExecutor getStartWorkExecutorPool() {
+    public Executor getStartWorkExecutorPool() {
         return startWorkExecutorPool;
     }
 
-    public GeronimoExecutor getScheduledWorkExecutorPool() {
+    public Executor getScheduledWorkExecutorPool() {
         return scheduledWorkExecutorPool;
     }
 
@@ -117,7 +113,7 @@
     * @see javax.resource.spi.work.WorkManager#doWork(javax.resource.spi.work.Work)
     */
     public void doWork(Work work) throws WorkException {
-        executeWork(new WorkerContext(work, transactionContextManager), syncWorkExecutor, syncWorkExecutorPool);
+        executeWork(new WorkerContext(work, transactionManager), syncWorkExecutor, syncWorkExecutorPool);
     }
 
     /* (non-Javadoc)
@@ -130,7 +126,7 @@
             WorkListener workListener)
             throws WorkException {
         WorkerContext workWrapper =
-                new WorkerContext(work, startTimeout, execContext, transactionContextManager, workListener);
+                new WorkerContext(work, startTimeout, execContext, transactionManager, workListener);
         workWrapper.setThreadPriority(Thread.currentThread().getPriority());
         executeWork(workWrapper, syncWorkExecutor, syncWorkExecutorPool);
     }
@@ -139,7 +135,7 @@
      * @see javax.resource.spi.work.WorkManager#startWork(javax.resource.spi.work.Work)
      */
     public long startWork(Work work) throws WorkException {
-        WorkerContext workWrapper = new WorkerContext(work, transactionContextManager);
+        WorkerContext workWrapper = new WorkerContext(work, transactionManager);
         workWrapper.setThreadPriority(Thread.currentThread().getPriority());
         executeWork(workWrapper, startWorkExecutor, startWorkExecutorPool);
         return System.currentTimeMillis() - workWrapper.getAcceptedTime();
@@ -155,7 +151,7 @@
             WorkListener workListener)
             throws WorkException {
         WorkerContext workWrapper =
-                new WorkerContext(work, startTimeout, execContext, transactionContextManager, workListener);
+                new WorkerContext(work, startTimeout, execContext, transactionManager, workListener);
         workWrapper.setThreadPriority(Thread.currentThread().getPriority());
         executeWork(workWrapper, startWorkExecutor, startWorkExecutorPool);
         return System.currentTimeMillis() - workWrapper.getAcceptedTime();
@@ -165,7 +161,7 @@
      * @see javax.resource.spi.work.WorkManager#scheduleWork(javax.resource.spi.work.Work)
      */
     public void scheduleWork(Work work) throws WorkException {
-        WorkerContext workWrapper = new WorkerContext(work, transactionContextManager);
+        WorkerContext workWrapper = new WorkerContext(work, transactionManager);
         workWrapper.setThreadPriority(Thread.currentThread().getPriority());
         executeWork(workWrapper, scheduleWorkExecutor, scheduledWorkExecutorPool);
     }
@@ -180,7 +176,7 @@
             WorkListener workListener)
             throws WorkException {
         WorkerContext workWrapper =
-                new WorkerContext(work, startTimeout, execContext, transactionContextManager, workListener);
+                new WorkerContext(work, startTimeout, execContext, transactionManager, workListener);
         workWrapper.setThreadPriority(Thread.currentThread().getPriority());
         executeWork(workWrapper, scheduleWorkExecutor, scheduledWorkExecutorPool);
     }
@@ -193,7 +189,7 @@
      * @exception WorkException Indicates that the Work execution has been
      * unsuccessful.
      */
-    private void executeWork(WorkerContext work, WorkExecutor workExecutor, GeronimoExecutor pooledExecutor) throws WorkException {
+    private void executeWork(WorkerContext work, WorkExecutor workExecutor, Executor pooledExecutor) throws WorkException {
         work.workAccepted(this);
         try {
             workExecutor.doExecute(work, pooledExecutor);

Modified: geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/work/GeronimoWorkManagerGBean.java
URL: http://svn.apache.org/viewvc/geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/work/GeronimoWorkManagerGBean.java?rev=430508&r1=430507&r2=430508&view=diff
==============================================================================
--- geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/work/GeronimoWorkManagerGBean.java (original)
+++ geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/work/GeronimoWorkManagerGBean.java Thu Aug 10 12:56:47 2006
@@ -21,8 +21,8 @@
 import org.apache.geronimo.gbean.GBeanInfoBuilder;
 import org.apache.geronimo.gbean.GBeanLifecycle;
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
-import org.apache.geronimo.pool.GeronimoExecutor;
-import org.apache.geronimo.transaction.context.TransactionContextManager;
+import org.apache.geronimo.transaction.manager.XAWork;
+import EDU.oswego.cs.dl.util.concurrent.Executor;
 
 /**
  * 
@@ -33,8 +33,8 @@
     public GeronimoWorkManagerGBean() {
     }
 
-    public GeronimoWorkManagerGBean(GeronimoExecutor sync, GeronimoExecutor start, GeronimoExecutor sched, TransactionContextManager transactionContextManager) {
-        super(sync, start, sched, transactionContextManager);
+    public GeronimoWorkManagerGBean(Executor sync, Executor start, Executor sched, XAWork xaWork) {
+        super(sync, start, sched, xaWork);
     }
 
     public static final GBeanInfo GBEAN_INFO;
@@ -43,19 +43,17 @@
         GBeanInfoBuilder infoFactory = GBeanInfoBuilder.createStatic(GeronimoWorkManagerGBean.class, NameFactory.JCA_WORK_MANAGER);
         infoFactory.addInterface(GeronimoWorkManager.class);
 
-        infoFactory.addReference("SyncPool", GeronimoExecutor.class, NameFactory.GERONIMO_SERVICE);
-        infoFactory.addReference("StartPool", GeronimoExecutor.class, NameFactory.GERONIMO_SERVICE);
-        infoFactory.addReference("ScheduledPool", GeronimoExecutor.class, NameFactory.GERONIMO_SERVICE);
+        infoFactory.addReference("SyncPool", Executor.class, NameFactory.GERONIMO_SERVICE);
+        infoFactory.addReference("StartPool", Executor.class, NameFactory.GERONIMO_SERVICE);
+        infoFactory.addReference("ScheduledPool", Executor.class, NameFactory.GERONIMO_SERVICE);
 
-        infoFactory.addOperation("getXATerminator");
-
-        infoFactory.addReference("TransactionContextManager", TransactionContextManager.class, NameFactory.TRANSACTION_CONTEXT_MANAGER);
+        infoFactory.addReference("TransactionManager", XAWork.class, NameFactory.TRANSACTION_MANAGER);
 
         infoFactory.setConstructor(new String[]{
             "SyncPool",
             "StartPool",
             "ScheduledPool",
-            "TransactionContextManager"});
+            "TransactionManager"});
 
         GBEAN_INFO = infoFactory.getBeanInfo();
     }

Modified: geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/work/WorkerContext.java
URL: http://svn.apache.org/viewvc/geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/work/WorkerContext.java?rev=430508&r1=430507&r2=430508&view=diff
==============================================================================
--- geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/work/WorkerContext.java (original)
+++ geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/work/WorkerContext.java Thu Aug 10 12:56:47 2006
@@ -33,9 +33,8 @@
 import EDU.oswego.cs.dl.util.concurrent.Latch;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.apache.geronimo.transaction.context.TransactionContextManager;
-import org.apache.geronimo.transaction.context.TransactionContext;
-import org.apache.geronimo.transaction.ImportedTransactionActiveException;
+import org.apache.geronimo.transaction.manager.ImportedTransactionActiveException;
+import org.apache.geronimo.transaction.manager.XAWork;
 
 /**
  * Work wrapper providing an execution context to a Work instance.
@@ -97,7 +96,7 @@
      */
     private final ExecutionContext executionContext;
 
-    private final TransactionContextManager transactionContextManager;
+    private final XAWork xaWork;
 
     /**
      * Listener to be notified during the life-cycle of the work treatment.
@@ -123,12 +122,12 @@
      * Create a WorkWrapper.
      *
      * @param work                      Work to be wrapped.
-     * @param transactionContextManager
+     * @param xaWork
      */
-    public WorkerContext(Work work, TransactionContextManager transactionContextManager) {
+    public WorkerContext(Work work, XAWork xaWork) {
         adaptee = work;
         executionContext = null;
-        this.transactionContextManager = transactionContextManager;
+        this.xaWork = xaWork;
     }
 
     /**
@@ -142,14 +141,15 @@
      * @param workListener  an object which would be notified when the various
      *                      Work processing events (work accepted, work rejected, work started,
      */
-    public WorkerContext(Work aWork, long aStartTimeout,
-                         ExecutionContext execContext,
-                         TransactionContextManager transactionContextManager,
-                         WorkListener workListener) {
+    public WorkerContext(Work aWork,
+            long aStartTimeout,
+            ExecutionContext execContext,
+            XAWork xaWork,
+            WorkListener workListener) {
         adaptee = aWork;
         startTimeOut = aStartTimeout;
         executionContext = execContext;
-        this.transactionContextManager = transactionContextManager;
+        this.xaWork = xaWork;
         if (null != workListener) {
             this.workListener = workListener;
         }
@@ -286,22 +286,12 @@
         //and ignore/replace whatever is associated with the current thread.
         try {
             if (executionContext == null || executionContext.getXid() == null) {
-                TransactionContext context = transactionContextManager.newUnspecifiedTransactionContext();
-                try {
-                    adaptee.run();
-                } finally {
-                    TransactionContext returningContext = transactionContextManager.getContext();
-                    transactionContextManager.setContext(null);
-                    if (context != returningContext) {
-                        throw new WorkCompletedException("Wrong TransactionContext on return from work done");
-                    }
-                }
-                //TODO should we commit the txContext to flush any leftover state???
+                adaptee.run();
             } else {
                 try {
                     long transactionTimeout = executionContext.getTransactionTimeout();
                     //translate -1 value to 0 to indicate default transaction timeout.
-                    transactionContextManager.begin(executionContext.getXid(), transactionTimeout == -1 ? 0 : transactionTimeout);
+                    xaWork.begin(executionContext.getXid(), transactionTimeout < 0 ? 0 : transactionTimeout);
                 } catch (XAException e) {
                     throw new WorkCompletedException("Transaction import failed for xid " + executionContext.getXid(), WorkCompletedException.TX_RECREATE_FAILED).initCause(e);
                 } catch (InvalidTransactionException e) {
@@ -314,7 +304,7 @@
                 try {
                     adaptee.run();
                 } finally {
-                    transactionContextManager.end(executionContext.getXid());
+                    xaWork.end(executionContext.getXid());
                 }
 
             }

Modified: geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/work/pool/ScheduleWorkExecutor.java
URL: http://svn.apache.org/viewvc/geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/work/pool/ScheduleWorkExecutor.java?rev=430508&r1=430507&r2=430508&view=diff
==============================================================================
--- geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/work/pool/ScheduleWorkExecutor.java (original)
+++ geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/work/pool/ScheduleWorkExecutor.java Thu Aug 10 12:56:47 2006
@@ -18,8 +18,9 @@
 package org.apache.geronimo.connector.work.pool;
 
 import javax.resource.spi.work.WorkException;
+
+import EDU.oswego.cs.dl.util.concurrent.Executor;
 import org.apache.geronimo.connector.work.WorkerContext;
-import org.apache.geronimo.pool.GeronimoExecutor;
 
 /**
  *
@@ -29,8 +30,8 @@
  * */
 public class ScheduleWorkExecutor implements WorkExecutor {
 
-    public void doExecute(WorkerContext work, GeronimoExecutor executor)
+    public void doExecute(WorkerContext work, Executor executor)
             throws WorkException, InterruptedException {
-        executor.execute("A J2EE Connector", work);
+        executor.execute(new NamedRunnable("A J2EE Connector", work));
     }
 }

Modified: geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/work/pool/StartWorkExecutor.java
URL: http://svn.apache.org/viewvc/geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/work/pool/StartWorkExecutor.java?rev=430508&r1=430507&r2=430508&view=diff
==============================================================================
--- geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/work/pool/StartWorkExecutor.java (original)
+++ geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/work/pool/StartWorkExecutor.java Thu Aug 10 12:56:47 2006
@@ -19,6 +19,7 @@
 
 import javax.resource.spi.work.WorkException;
 import EDU.oswego.cs.dl.util.concurrent.Latch;
+import EDU.oswego.cs.dl.util.concurrent.Executor;
 import org.apache.geronimo.connector.work.WorkerContext;
 import org.apache.geronimo.pool.GeronimoExecutor;
 
@@ -30,10 +31,10 @@
  * */
 public class StartWorkExecutor implements WorkExecutor {
 
-    public void doExecute(WorkerContext work, GeronimoExecutor executor)
+    public void doExecute(WorkerContext work, Executor executor)
             throws WorkException, InterruptedException {
         Latch latch = work.provideStartLatch();
-        executor.execute("A J2EE Connector", work);
+        executor.execute(new NamedRunnable("A J2EE Connector", work));
         latch.acquire();
     }
 }

Modified: geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/work/pool/SyncWorkExecutor.java
URL: http://svn.apache.org/viewvc/geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/work/pool/SyncWorkExecutor.java?rev=430508&r1=430507&r2=430508&view=diff
==============================================================================
--- geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/work/pool/SyncWorkExecutor.java (original)
+++ geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/work/pool/SyncWorkExecutor.java Thu Aug 10 12:56:47 2006
@@ -19,6 +19,7 @@
 
 import javax.resource.spi.work.WorkException;
 import EDU.oswego.cs.dl.util.concurrent.Latch;
+import EDU.oswego.cs.dl.util.concurrent.Executor;
 import org.apache.geronimo.connector.work.WorkerContext;
 import org.apache.geronimo.pool.GeronimoExecutor;
 
@@ -30,10 +31,11 @@
  * */
 public class SyncWorkExecutor implements WorkExecutor {
 
-    public void doExecute(WorkerContext work, GeronimoExecutor executor)
+    public void doExecute(WorkerContext work, Executor executor)
             throws WorkException, InterruptedException {
         Latch latch = work.provideEndLatch();
-        executor.execute("A J2EE Connector", work);
+        executor.execute(new NamedRunnable("A J2EE Connector", work));
         latch.acquire();
     }
+
 }

Modified: geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/work/pool/WorkExecutor.java
URL: http://svn.apache.org/viewvc/geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/work/pool/WorkExecutor.java?rev=430508&r1=430507&r2=430508&view=diff
==============================================================================
--- geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/work/pool/WorkExecutor.java (original)
+++ geronimo/trunk/modules/connector/src/java/org/apache/geronimo/connector/work/pool/WorkExecutor.java Thu Aug 10 12:56:47 2006
@@ -1,8 +1,9 @@
 package org.apache.geronimo.connector.work.pool;
 
 import javax.resource.spi.work.WorkException;
+
+import EDU.oswego.cs.dl.util.concurrent.Executor;
 import org.apache.geronimo.connector.work.WorkerContext;
-import org.apache.geronimo.pool.GeronimoExecutor;
 
 /**
  *
@@ -23,7 +24,7 @@
      * @throws InterruptedException Indicates that the thread in charge of the
      * execution of the specified work has been interrupted.
      */
-     void doExecute(WorkerContext work, GeronimoExecutor executor)
+     void doExecute(WorkerContext work, Executor executor)
             throws WorkException, InterruptedException;
 
 

Modified: geronimo/trunk/modules/connector/src/test/org/apache/geronimo/connector/AdminObjectWrapperTest.java
URL: http://svn.apache.org/viewvc/geronimo/trunk/modules/connector/src/test/org/apache/geronimo/connector/AdminObjectWrapperTest.java?rev=430508&r1=430507&r2=430508&view=diff
==============================================================================
--- geronimo/trunk/modules/connector/src/test/org/apache/geronimo/connector/AdminObjectWrapperTest.java (original)
+++ geronimo/trunk/modules/connector/src/test/org/apache/geronimo/connector/AdminObjectWrapperTest.java Thu Aug 10 12:56:47 2006
@@ -38,7 +38,7 @@
 import org.apache.geronimo.kernel.repository.Artifact;
 
 /**
- * @version $Rev: 386505 $ $Date$
+ * @version $Rev$ $Date$
  */
 public class AdminObjectWrapperTest extends TestCase {
 

Modified: geronimo/trunk/modules/connector/src/test/org/apache/geronimo/connector/BootstrapContextTest.java
URL: http://svn.apache.org/viewvc/geronimo/trunk/modules/connector/src/test/org/apache/geronimo/connector/BootstrapContextTest.java?rev=430508&r1=430507&r2=430508&view=diff
==============================================================================
--- geronimo/trunk/modules/connector/src/test/org/apache/geronimo/connector/BootstrapContextTest.java (original)
+++ geronimo/trunk/modules/connector/src/test/org/apache/geronimo/connector/BootstrapContextTest.java Thu Aug 10 12:56:47 2006
@@ -23,11 +23,11 @@
 
 import junit.framework.TestCase;
 import org.apache.geronimo.connector.work.GeronimoWorkManager;
-import org.apache.geronimo.transaction.context.TransactionContextManager;
 import org.apache.geronimo.pool.ThreadPool;
+import org.apache.geronimo.transaction.manager.GeronimoTransactionManager;
 
 /**
- * Unit tests for {@link BootstrapContextImpl}
+ * Unit tests for {@link GeronimoBootstrapContext}
  * @version $Rev$ $Date$
  */
 public class BootstrapContextTest extends TestCase {
@@ -40,10 +40,10 @@
     /**
      * Tests get and set work manager
      */
-    public void testGetSetWorkManager() {
-        TransactionContextManager transactionContextManager = new TransactionContextManager();
-        GeronimoWorkManager manager = new GeronimoWorkManager(pool, pool, pool, transactionContextManager);
-        BootstrapContextImpl context = new BootstrapContextImpl(manager);
+    public void testGetSetWorkManager() throws Exception {
+        GeronimoTransactionManager transactionManager = new GeronimoTransactionManager();
+        GeronimoWorkManager manager = new GeronimoWorkManager(pool, pool, pool, transactionManager);
+        GeronimoBootstrapContext context = new GeronimoBootstrapContext(manager, transactionManager);
         WorkManager wm = context.getWorkManager();
 
         assertSame("Make sure it is the same object", manager, wm);
@@ -52,20 +52,20 @@
     /**
      * Tests get and set XATerminator
      */
-    public void testGetSetXATerminator() {
-        TransactionContextManager transactionContextManager = new TransactionContextManager();
-        GeronimoWorkManager manager = new GeronimoWorkManager(pool, pool, pool, transactionContextManager);
-        BootstrapContextImpl context = new BootstrapContextImpl(manager);
+    public void testGetSetXATerminator() throws Exception {
+        GeronimoTransactionManager transactionManager = new GeronimoTransactionManager();
+        GeronimoWorkManager manager = new GeronimoWorkManager(pool, pool, pool, transactionManager);
+        GeronimoBootstrapContext context = new GeronimoBootstrapContext(manager, transactionManager);
         XATerminator xat = context.getXATerminator();
 
-        assertSame("Make sure it is the same object", transactionContextManager, xat);
+        assertSame("Make sure it is the same object", transactionManager, xat);
     }
 
     /**
      * Tests getTimer
      */
     public void testGetTimer() throws Exception {
-        BootstrapContextImpl context = new BootstrapContextImpl(null);
+        GeronimoBootstrapContext context = new GeronimoBootstrapContext(null, null);
         Timer t = context.createTimer();
         assertNotNull("Object is not null", t);
     }

Modified: geronimo/trunk/modules/connector/src/test/org/apache/geronimo/connector/outbound/ConnectionManagerStressTest.java
URL: http://svn.apache.org/viewvc/geronimo/trunk/modules/connector/src/test/org/apache/geronimo/connector/outbound/ConnectionManagerStressTest.java?rev=430508&r1=430507&r2=430508&view=diff
==============================================================================
--- geronimo/trunk/modules/connector/src/test/org/apache/geronimo/connector/outbound/ConnectionManagerStressTest.java (original)
+++ geronimo/trunk/modules/connector/src/test/org/apache/geronimo/connector/outbound/ConnectionManagerStressTest.java Thu Aug 10 12:56:47 2006
@@ -19,7 +19,7 @@
 
 import java.util.HashSet;
 
-import org.apache.geronimo.transaction.DefaultInstanceContext;
+import org.apache.geronimo.connector.outbound.connectiontracking.ConnectorInstanceContextImpl;
 import org.apache.commons.logging.LogFactory;
 import org.apache.commons.logging.Log;
 
@@ -46,9 +46,8 @@
     private Exception e = null;
 
     public void testNoTransactionCallOneThread() throws Throwable {
-        transactionContextManager.newUnspecifiedTransactionContext();
         for (int i = 0; i < repeatCount; i++) {
-            defaultComponentInterceptor.invoke(defaultComponentContext);
+            defaultComponentInterceptor.invoke(connectorInstanceContext);
         }
     }
 
@@ -58,7 +57,6 @@
         for (int t = 0; t < threadCount; t++) {
             new Thread() {
                 public void run() {
-                    transactionContextManager.newUnspecifiedTransactionContext();
                     long localStartTime = 0;
                     int localSlowCount = 0;
                     try {
@@ -73,7 +71,7 @@
                         for (int i = 0; i < repeatCount; i++) {
                             try {
                                 long start = System.currentTimeMillis();
-                                defaultComponentInterceptor.invoke(new DefaultInstanceContext(new HashSet(), new HashSet()));
+                                defaultComponentInterceptor.invoke(new ConnectorInstanceContextImpl(new HashSet(), new HashSet()));
                                 long duration = System.currentTimeMillis() - start;
                                 if (duration > 100) {
                                     localSlowCount++;

Modified: geronimo/trunk/modules/connector/src/test/org/apache/geronimo/connector/outbound/ConnectionManagerTest.java
URL: http://svn.apache.org/viewvc/geronimo/trunk/modules/connector/src/test/org/apache/geronimo/connector/outbound/ConnectionManagerTest.java?rev=430508&r1=430507&r2=430508&view=diff
==============================================================================
--- geronimo/trunk/modules/connector/src/test/org/apache/geronimo/connector/outbound/ConnectionManagerTest.java (original)
+++ geronimo/trunk/modules/connector/src/test/org/apache/geronimo/connector/outbound/ConnectionManagerTest.java Thu Aug 10 12:56:47 2006
@@ -20,9 +20,8 @@
 import org.apache.geronimo.connector.mock.MockConnection;
 import org.apache.geronimo.connector.mock.MockXAResource;
 import org.apache.geronimo.connector.outbound.connectiontracking.DefaultInterceptor;
-import org.apache.geronimo.transaction.InstanceContext;
-import org.apache.geronimo.transaction.context.TransactionContext;
-import org.apache.geronimo.transaction.context.UserTransactionImpl;
+import org.apache.geronimo.connector.outbound.connectiontracking.ConnectorInstanceContext;
+import org.apache.geronimo.transaction.GeronimoUserTransaction;
 
 /**
  *
@@ -34,40 +33,39 @@
 
 
     public void testSingleTransactionCall() throws Throwable {
-        TransactionContext transactionContext = transactionContextManager.newContainerTransactionContext();
-        defaultComponentInterceptor.invoke(defaultComponentContext);
+        transactionManager.begin();
+        defaultComponentInterceptor.invoke(connectorInstanceContext);
         MockXAResource mockXAResource = (MockXAResource) mockManagedConnection.getXAResource();
         assertEquals("XAResource should know one xid", 1, mockXAResource.getKnownXids().size());
         assertNull("Should not be committed", mockXAResource.getCommitted());
-        transactionContext.commit();
+        transactionManager.commit();
         assertNotNull("Should be committed", mockXAResource.getCommitted());
     }
 
     public void testNoTransactionCall() throws Throwable {
-        transactionContextManager.newUnspecifiedTransactionContext();
-        defaultComponentInterceptor.invoke(defaultComponentContext);
+        defaultComponentInterceptor.invoke(connectorInstanceContext);
         MockXAResource mockXAResource = (MockXAResource) mockManagedConnection.getXAResource();
         assertEquals("XAResource should know 0 xid", 0, mockXAResource.getKnownXids().size());
         assertNull("Should not be committed", mockXAResource.getCommitted());
     }
 
     public void testOneTransactionTwoCalls() throws Throwable {
-        TransactionContext transactionContext = transactionContextManager.newContainerTransactionContext();
-        defaultComponentInterceptor.invoke(defaultComponentContext);
+        transactionManager.begin();
+        defaultComponentInterceptor.invoke(connectorInstanceContext);
         MockXAResource mockXAResource = (MockXAResource) mockManagedConnection.getXAResource();
         assertEquals("XAResource should know one xid", 1, mockXAResource.getKnownXids().size());
         assertNull("Should not be committed", mockXAResource.getCommitted());
-        defaultComponentInterceptor.invoke(defaultComponentContext);
+        defaultComponentInterceptor.invoke(connectorInstanceContext);
         assertEquals("Expected same XAResource", mockXAResource, mockManagedConnection.getXAResource());
         assertEquals("XAResource should know one xid", 1, mockXAResource.getKnownXids().size());
         assertNull("Should not be committed", mockXAResource.getCommitted());
-        transactionContext.commit();
+        transactionManager.commit();
         assertNotNull("Should be committed", mockXAResource.getCommitted());
     }
 
     public void testUserTransactionEnlistingExistingConnections() throws Throwable {
         mockComponent = new DefaultInterceptor() {
-            public Object invoke(InstanceContext newInstanceContext) throws Throwable {
+            public Object invoke(ConnectorInstanceContext newConnectorInstanceContext) throws Throwable {
                 MockConnection mockConnection = (MockConnection) connectionFactory.getConnection();
                 mockManagedConnection = mockConnection.getManagedConnection();
                 userTransaction.begin();
@@ -80,11 +78,8 @@
                 return null;
             }
         };
-        transactionContextManager.newUnspecifiedTransactionContext();
-        userTransaction = new UserTransactionImpl();
-        userTransaction.setUp(transactionContextManager, connectionTrackingCoordinator);
-        userTransaction.setOnline(true);
-        defaultComponentInterceptor.invoke(defaultComponentContext);
+        userTransaction = new GeronimoUserTransaction(transactionManager);
+        defaultComponentInterceptor.invoke(connectorInstanceContext);
         MockXAResource mockXAResource = (MockXAResource) mockManagedConnection.getXAResource();
         assertEquals("XAResource should know 1 xid", 1, mockXAResource.getKnownXids().size());
         assertNotNull("Should be committed", mockXAResource.getCommitted());
@@ -100,7 +95,7 @@
     public void testUnshareableConnections() throws Throwable {
         unshareableResources.add(name);
         mockComponent = new DefaultInterceptor() {
-            public Object invoke(InstanceContext newInstanceContext) throws Throwable {
+            public Object invoke(ConnectorInstanceContext newConnectorInstanceContext) throws Throwable {
                 MockConnection mockConnection1 = (MockConnection) connectionFactory.getConnection();
                 mockManagedConnection = mockConnection1.getManagedConnection();
                 MockConnection mockConnection2 = (MockConnection) connectionFactory.getConnection();
@@ -116,12 +111,12 @@
             }
 
         };
-        TransactionContext transactionContext = transactionContextManager.newContainerTransactionContext();
-        defaultComponentInterceptor.invoke(defaultComponentContext);
+        transactionManager.begin();
+        defaultComponentInterceptor.invoke(connectorInstanceContext);
         MockXAResource mockXAResource = (MockXAResource) mockManagedConnection.getXAResource();
         assertEquals("XAResource should know one xid", 1, mockXAResource.getKnownXids().size());
         assertNull("Should not be committed", mockXAResource.getCommitted());
-        transactionContext.commit();
+        transactionManager.commit();
         assertNotNull("Should be committed", mockXAResource.getCommitted());
     }
 }

Modified: geronimo/trunk/modules/connector/src/test/org/apache/geronimo/connector/outbound/ConnectionManagerTestUtils.java
URL: http://svn.apache.org/viewvc/geronimo/trunk/modules/connector/src/test/org/apache/geronimo/connector/outbound/ConnectionManagerTestUtils.java?rev=430508&r1=430507&r2=430508&view=diff
==============================================================================
--- geronimo/trunk/modules/connector/src/test/org/apache/geronimo/connector/outbound/ConnectionManagerTestUtils.java (original)
+++ geronimo/trunk/modules/connector/src/test/org/apache/geronimo/connector/outbound/ConnectionManagerTestUtils.java Thu Aug 10 12:56:47 2006
@@ -20,6 +20,8 @@
 import java.util.HashSet;
 import java.util.Set;
 import javax.security.auth.Subject;
+import javax.transaction.TransactionManager;
+import javax.transaction.UserTransaction;
 
 import junit.framework.TestCase;
 import org.apache.geronimo.connector.mock.MockConnection;
@@ -34,12 +36,10 @@
 import org.apache.geronimo.connector.outbound.connectiontracking.DefaultComponentInterceptor;
 import org.apache.geronimo.connector.outbound.connectiontracking.DefaultInterceptor;
 import org.apache.geronimo.security.ContextManager;
-import org.apache.geronimo.transaction.DefaultInstanceContext;
-import org.apache.geronimo.transaction.InstanceContext;
-import org.apache.geronimo.transaction.context.TransactionContextManager;
-import org.apache.geronimo.transaction.context.UserTransactionImpl;
+import org.apache.geronimo.connector.outbound.connectiontracking.ConnectorInstanceContextImpl;
+import org.apache.geronimo.connector.outbound.connectiontracking.ConnectorInstanceContext;
+import org.apache.geronimo.connector.outbound.connectiontracking.GeronimoTransactionListener;
 import org.apache.geronimo.transaction.manager.TransactionManagerImpl;
-import org.apache.geronimo.transaction.manager.XidFactoryImpl;
 
 /**
  *
@@ -64,23 +64,23 @@
     protected String name = "testCF";
     //dependencies
     protected ConnectionTrackingCoordinator connectionTrackingCoordinator;
-    protected TransactionContextManager transactionContextManager;
+    protected TransactionManager transactionManager;
     protected AbstractConnectionManager connectionManagerDeployment;
     protected MockConnectionFactory connectionFactory;
     protected MockManagedConnectionFactory mockManagedConnectionFactory;
-    protected DefaultInstanceContext defaultComponentContext;
+    protected ConnectorInstanceContextImpl connectorInstanceContext;
     protected DefaultComponentInterceptor defaultComponentInterceptor;
     protected Set unshareableResources = new HashSet();
     protected Set applicationManagedSecurityResources = new HashSet();
     protected MockManagedConnection mockManagedConnection;
     protected Subject subject;
-    protected UserTransactionImpl userTransaction;
+    protected UserTransaction userTransaction;
     protected TransactionSupport transactionSupport = new XATransactions(useTransactionCaching, useThreadCaching);
     protected PoolingSupport poolingSupport = new PartitionedPool(maxSize, minSize, blockingTimeout, idleTimeoutMinutes, matchOne, matchAll, selectOneNoMatch, useConnectionRequestInfo, useSubject);
     protected boolean containerManagedSecurity = true;
 
     protected DefaultInterceptor mockComponent = new DefaultInterceptor() {
-        public Object invoke(InstanceContext newInstanceContext) throws Throwable {
+        public Object invoke(ConnectorInstanceContext newConnectorInstanceContext) throws Throwable {
             MockConnection mockConnection = (MockConnection) connectionFactory.getConnection();
             mockManagedConnection = mockConnection.getManagedConnection();
             mockConnection.close();
@@ -90,10 +90,12 @@
     private ClassLoader classLoader = this.getClass().getClassLoader();
 
     protected void setUp() throws Exception {
+        TransactionManagerImpl transactionManager = new TransactionManagerImpl();
+        this.transactionManager = transactionManager;
+
         connectionTrackingCoordinator = new ConnectionTrackingCoordinator();
-        TransactionManagerImpl transactionManager = new TransactionManagerImpl(10 * 1000,
-                new XidFactoryImpl("WHAT DO WE CALL IT?".getBytes()), null, null);
-        transactionContextManager = new TransactionContextManager(transactionManager, transactionManager);
+        transactionManager.addTransactionAssociationListener(new GeronimoTransactionListener(connectionTrackingCoordinator));
+        
         mockManagedConnectionFactory = new MockManagedConnectionFactory();
         subject = new Subject();
         ContextManager.setCurrentCaller(subject);
@@ -102,24 +104,24 @@
                 poolingSupport,
                 containerManagedSecurity,
                 connectionTrackingCoordinator,
-                transactionContextManager,
+                this.transactionManager,
                 name,
                 classLoader);
         connectionFactory = (MockConnectionFactory) connectionManagerDeployment.createConnectionFactory(mockManagedConnectionFactory);
-        defaultComponentContext = new DefaultInstanceContext(unshareableResources, applicationManagedSecurityResources);
-        defaultComponentInterceptor = new DefaultComponentInterceptor(this, connectionTrackingCoordinator, transactionContextManager);
+        connectorInstanceContext = new ConnectorInstanceContextImpl(unshareableResources, applicationManagedSecurityResources);
+        defaultComponentInterceptor = new DefaultComponentInterceptor(this, connectionTrackingCoordinator);
     }
 
     protected void tearDown() throws Exception {
         connectionTrackingCoordinator = null;
-        transactionContextManager = null;
+        transactionManager = null;
         mockManagedConnectionFactory = null;
         connectionManagerDeployment = null;
         connectionFactory = null;
-        defaultComponentContext = null;
+        connectorInstanceContext = null;
     }
 
-    public Object invoke(InstanceContext newInstanceContext) throws Throwable {
-        return mockComponent.invoke(newInstanceContext);
+    public Object invoke(ConnectorInstanceContext newConnectorInstanceContext) throws Throwable {
+        return mockComponent.invoke(newConnectorInstanceContext);
     }
 }

Modified: geronimo/trunk/modules/connector/src/test/org/apache/geronimo/connector/outbound/ManagedConnectionFactoryWrapperTest.java
URL: http://svn.apache.org/viewvc/geronimo/trunk/modules/connector/src/test/org/apache/geronimo/connector/outbound/ManagedConnectionFactoryWrapperTest.java?rev=430508&r1=430507&r2=430508&view=diff
==============================================================================
--- geronimo/trunk/modules/connector/src/test/org/apache/geronimo/connector/outbound/ManagedConnectionFactoryWrapperTest.java (original)
+++ geronimo/trunk/modules/connector/src/test/org/apache/geronimo/connector/outbound/ManagedConnectionFactoryWrapperTest.java Thu Aug 10 12:56:47 2006
@@ -44,7 +44,7 @@
 import org.apache.geronimo.kernel.repository.Artifact;
 
 /**
- * @version $Rev: 386505 $ $Date$
+ * @version $Rev$ $Date$
  */
 public class ManagedConnectionFactoryWrapperTest extends TestCase {
 

Modified: geronimo/trunk/modules/connector/src/test/org/apache/geronimo/connector/outbound/PoolResizeTest.java
URL: http://svn.apache.org/viewvc/geronimo/trunk/modules/connector/src/test/org/apache/geronimo/connector/outbound/PoolResizeTest.java?rev=430508&r1=430507&r2=430508&view=diff
==============================================================================
--- geronimo/trunk/modules/connector/src/test/org/apache/geronimo/connector/outbound/PoolResizeTest.java (original)
+++ geronimo/trunk/modules/connector/src/test/org/apache/geronimo/connector/outbound/PoolResizeTest.java Thu Aug 10 12:56:47 2006
@@ -19,7 +19,7 @@
 import junit.framework.TestCase;
 
 /**
- * @version $Rev:  $ $Date$
+ * @version $Rev$ $Date$
  */
 public class PoolResizeTest extends TestCase {
 



Mime
View raw message