geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject svn commit: r233563 - in /geronimo/trunk: configs/j2ee-server/src/plan/ modules/assembly/src/plan/ modules/connector-builder/src/test-data/connector_1_5/ modules/connector-builder/src/test-data/data/ modules/jetty-builder/src/test/org/apache/geronimo/j...
Date Fri, 19 Aug 2005 21:28:41 GMT
Author: chirino
Date: Fri Aug 19 14:28:25 2005
New Revision: 233563

URL: http://svn.apache.org/viewcvs?rev=233563&view=rev
Log:
Decoupled the GBean kernel dependencies from the transaction module by refactoring out new
*GBean classes.

Added:
    geronimo/trunk/modules/transaction/src/java/org/apache/geronimo/transaction/context/TransactionContextManagerGBean.java
    geronimo/trunk/modules/transaction/src/java/org/apache/geronimo/transaction/manager/TransactionManagerImplGBean.java
    geronimo/trunk/modules/transaction/src/java/org/apache/geronimo/transaction/manager/XidFactoryImplGBean.java
Modified:
    geronimo/trunk/configs/j2ee-server/src/plan/plan.xml
    geronimo/trunk/modules/assembly/src/plan/j2ee-client-plan.xml
    geronimo/trunk/modules/assembly/src/plan/j2ee-server-plan.xml
    geronimo/trunk/modules/connector-builder/src/test-data/connector_1_5/geronimo-ra.xml
    geronimo/trunk/modules/connector-builder/src/test-data/data/external-application-plan.xml
    geronimo/trunk/modules/jetty-builder/src/test/org/apache/geronimo/jetty/deployment/JettyModuleBuilderTest.java
    geronimo/trunk/modules/jetty/src/test/org/apache/geronimo/jetty/AbstractWebModuleTest.java
    geronimo/trunk/modules/tomcat-builder/src/test/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilderTest.java
    geronimo/trunk/modules/tomcat/src/test/org/apache/geronimo/tomcat/AbstractWebModuleTest.java
    geronimo/trunk/modules/transaction/src/java/org/apache/geronimo/transaction/context/TransactionContextManager.java
    geronimo/trunk/modules/transaction/src/java/org/apache/geronimo/transaction/manager/TransactionManagerImpl.java
    geronimo/trunk/modules/transaction/src/java/org/apache/geronimo/transaction/manager/XidFactoryImpl.java
    geronimo/trunk/modules/transaction/src/test/org/apache/geronimo/transaction/manager/TransactionManagerImplTest.java
    geronimo/trunk/sandbox/spring-assembly/src/conf/server.xml

Modified: geronimo/trunk/configs/j2ee-server/src/plan/plan.xml
URL: http://svn.apache.org/viewcvs/geronimo/trunk/configs/j2ee-server/src/plan/plan.xml?rev=233563&r1=233562&r2=233563&view=diff
==============================================================================
--- geronimo/trunk/configs/j2ee-server/src/plan/plan.xml (original)
+++ geronimo/trunk/configs/j2ee-server/src/plan/plan.xml Fri Aug 19 14:28:25 2005
@@ -196,7 +196,7 @@
         <reference name="ServerInfo"><module>org/apache/geronimo/System</module><name>ServerInfo</name></reference>
     </gbean>
 
-    <gbean name="TransactionManager" class="org.apache.geronimo.transaction.manager.TransactionManagerImpl">
+    <gbean name="TransactionManager" class="org.apache.geronimo.transaction.manager.TransactionManagerImplGBean">
         <attribute name="defaultTransactionTimeoutSeconds">600</attribute>
         <reference name="TransactionLog"><name>HOWLTransactionLog</name></reference>
         <references name="ResourceManagers">
@@ -205,7 +205,7 @@
         </references>
     </gbean>
 
-    <gbean name="TransactionContextManager" class="org.apache.geronimo.transaction.context.TransactionContextManager">
+    <gbean name="TransactionContextManager" class="org.apache.geronimo.transaction.context.TransactionContextManagerGBean">
         <reference name="TransactionManager"><name>TransactionManager</name></reference>
         <reference name="XidImporter"><name>TransactionManager</name></reference>
     </gbean>

Modified: geronimo/trunk/modules/assembly/src/plan/j2ee-client-plan.xml
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/assembly/src/plan/j2ee-client-plan.xml?rev=233563&r1=233562&r2=233563&view=diff
==============================================================================
--- geronimo/trunk/modules/assembly/src/plan/j2ee-client-plan.xml (original)
+++ geronimo/trunk/modules/assembly/src/plan/j2ee-client-plan.xml Fri Aug 19 14:28:25 2005
@@ -120,7 +120,7 @@
         <reference name="TransactionContextManager"><name>TransactionContextManager</name></reference>
     </gbean>
 
-    <gbean name="TransactionManager" class="org.apache.geronimo.transaction.manager.TransactionManagerImpl">
+    <gbean name="TransactionManager" class="org.apache.geronimo.transaction.manager.TransactionManagerImplGBean">
         <!--no transaction log on the client-->
         <attribute name="defaultTransactionTimeoutSeconds">600</attribute>
         <references name="ResourceManagers">
@@ -129,7 +129,7 @@
         </references>
     </gbean>
 
-    <gbean name="TransactionContextManager" class="org.apache.geronimo.transaction.context.TransactionContextManager">
+    <gbean name="TransactionContextManager" class="org.apache.geronimo.transaction.context.TransactionContextManagerGBean">
         <reference name="TransactionManager"><name>TransactionManager</name></reference>
         <reference name="XidImporter"><name>TransactionManager</name></reference>
     </gbean>

Modified: geronimo/trunk/modules/assembly/src/plan/j2ee-server-plan.xml
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/assembly/src/plan/j2ee-server-plan.xml?rev=233563&r1=233562&r2=233563&view=diff
==============================================================================
--- geronimo/trunk/modules/assembly/src/plan/j2ee-server-plan.xml (original)
+++ geronimo/trunk/modules/assembly/src/plan/j2ee-server-plan.xml Fri Aug 19 14:28:25 2005
@@ -213,7 +213,7 @@
         <reference name="ServerInfo"><module>org/apache/geronimo/System</module><name>ServerInfo</name></reference>
     </gbean>
 
-    <gbean name="TransactionManager" class="org.apache.geronimo.transaction.manager.TransactionManagerImpl">
+    <gbean name="TransactionManager" class="org.apache.geronimo.transaction.manager.TransactionManagerImplGBean">
         <attribute name="defaultTransactionTimeoutSeconds">600</attribute>
         <reference name="TransactionLog"><name>HOWLTransactionLog</name></reference>
         <references name="ResourceManagers">
@@ -222,7 +222,7 @@
         </references>
     </gbean>
 
-    <gbean name="TransactionContextManager" class="org.apache.geronimo.transaction.context.TransactionContextManager">
+    <gbean name="TransactionContextManager" class="org.apache.geronimo.transaction.context.TransactionContextManagerGBean">
         <reference name="TransactionManager"><name>TransactionManager</name></reference>
         <reference name="XidImporter"><name>TransactionManager</name></reference>
     </gbean>

Modified: geronimo/trunk/modules/connector-builder/src/test-data/connector_1_5/geronimo-ra.xml
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/connector-builder/src/test-data/connector_1_5/geronimo-ra.xml?rev=233563&r1=233562&r2=233563&view=diff
==============================================================================
--- geronimo/trunk/modules/connector-builder/src/test-data/connector_1_5/geronimo-ra.xml (original)
+++ geronimo/trunk/modules/connector-builder/src/test-data/connector_1_5/geronimo-ra.xml Fri
Aug 19 14:28:25 2005
@@ -113,7 +113,7 @@
         <reference name="TransactionContextManager"><gbean-name>*:name=TransactionContextManager,*</gbean-name></reference>
     </gbean>
 
-    <gbean name="TransactionManager" class="org.apache.geronimo.transaction.manager.TransactionManagerImpl">
+    <gbean name="TransactionManager" class="org.apache.geronimo.transaction.manager.TransactionManagerImplGBean">
         <attribute name="defaultTransactionTimeoutSeconds">10</attribute>
         <references name="ResourceManagers">
             <pattern><gbean-name>*:j2eeType=JCAManagedConnectionFactory,*</gbean-name></pattern>
@@ -121,7 +121,7 @@
         </references>
     </gbean>
 
-    <gbean name="TransactionContextManager" class="org.apache.geronimo.transaction.context.TransactionContextManager">
+    <gbean name="TransactionContextManager" class="org.apache.geronimo.transaction.context.TransactionContextManagerGBean">
         <reference name="TransactionManager"><gbean-name>*:name=TransactionManager,*</gbean-name></reference>
         <reference name="XidImporter"><gbean-name>*:name=TransactionManager,*</gbean-name></reference>
     </gbean>

Modified: geronimo/trunk/modules/connector-builder/src/test-data/data/external-application-plan.xml
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/connector-builder/src/test-data/data/external-application-plan.xml?rev=233563&r1=233562&r2=233563&view=diff
==============================================================================
--- geronimo/trunk/modules/connector-builder/src/test-data/data/external-application-plan.xml
(original)
+++ geronimo/trunk/modules/connector-builder/src/test-data/data/external-application-plan.xml
Fri Aug 19 14:28:25 2005
@@ -183,7 +183,7 @@
         <reference name="TransactionContextManager"><gbean-name>*:name=TransactionContextManager,*</gbean-name></reference>
     </gbean>
 
-    <gbean name="TransactionManager" class="org.apache.geronimo.transaction.manager.TransactionManagerImpl">
+    <gbean name="TransactionManager" class="org.apache.geronimo.transaction.manager.TransactionManagerImplGBean">
         <attribute name="defaultTransactionTimeoutSeconds">10</attribute>
         <references name="ResourceManagers">
             <pattern><gbean-name>*:j2eeType=JCAManagedConnectionFactory,*</gbean-name></pattern>
@@ -191,7 +191,7 @@
         </references>
     </gbean>
 
-    <gbean name="TransactionContextManager" class="org.apache.geronimo.transaction.context.TransactionContextManager">
+    <gbean name="TransactionContextManager" class="org.apache.geronimo.transaction.context.TransactionContextManagerGBean">
         <reference name="TransactionManager"><gbean-name>*:name=TransactionManager,*</gbean-name></reference>
         <reference name="XidImporter"><gbean-name>*:name=TransactionManager,*</gbean-name></reference>
     </gbean>

Modified: geronimo/trunk/modules/jetty-builder/src/test/org/apache/geronimo/jetty/deployment/JettyModuleBuilderTest.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/jetty-builder/src/test/org/apache/geronimo/jetty/deployment/JettyModuleBuilderTest.java?rev=233563&r1=233562&r2=233563&view=diff
==============================================================================
--- geronimo/trunk/modules/jetty-builder/src/test/org/apache/geronimo/jetty/deployment/JettyModuleBuilderTest.java
(original)
+++ geronimo/trunk/modules/jetty-builder/src/test/org/apache/geronimo/jetty/deployment/JettyModuleBuilderTest.java
Fri Aug 19 14:28:25 2005
@@ -74,7 +74,9 @@
 import org.apache.geronimo.security.SecurityServiceImpl;
 import org.apache.geronimo.system.serverinfo.BasicServerInfo;
 import org.apache.geronimo.transaction.context.TransactionContextManager;
+import org.apache.geronimo.transaction.context.TransactionContextManagerGBean;
 import org.apache.geronimo.transaction.manager.TransactionManagerImpl;
+import org.apache.geronimo.transaction.manager.TransactionManagerImplGBean;
 
 /**
  * @version $Rev$ $Date$
@@ -293,13 +295,13 @@
         start(container);
         start(connector);
 
-        tm = new GBeanData(tmName, TransactionManagerImpl.GBEAN_INFO);
+        tm = new GBeanData(tmName, TransactionManagerImplGBean.GBEAN_INFO);
         Set patterns = new HashSet();
         patterns.add(ObjectName.getInstance("geronimo.server:j2eeType=JCAManagedConnectionFactory,*"));
         tm.setAttribute("defaultTransactionTimeoutSeconds", new Integer(10));
         tm.setReferencePatterns("ResourceManagers", patterns);
         start(tm);
-        tcm = new GBeanData(tcmName, TransactionContextManager.GBEAN_INFO);
+        tcm = new GBeanData(tcmName, TransactionContextManagerGBean.GBEAN_INFO);
         tcm.setReferencePattern("TransactionManager", tmName);
         start(tcm);
         ctc = new GBeanData(ctcName, ConnectionTrackingCoordinatorGBean.GBEAN_INFO);

Modified: geronimo/trunk/modules/jetty/src/test/org/apache/geronimo/jetty/AbstractWebModuleTest.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/jetty/src/test/org/apache/geronimo/jetty/AbstractWebModuleTest.java?rev=233563&r1=233562&r2=233563&view=diff
==============================================================================
--- geronimo/trunk/modules/jetty/src/test/org/apache/geronimo/jetty/AbstractWebModuleTest.java
(original)
+++ geronimo/trunk/modules/jetty/src/test/org/apache/geronimo/jetty/AbstractWebModuleTest.java
Fri Aug 19 14:28:25 2005
@@ -51,7 +51,9 @@
 import org.apache.geronimo.system.serverinfo.BasicServerInfo;
 import org.apache.geronimo.transaction.context.OnlineUserTransaction;
 import org.apache.geronimo.transaction.context.TransactionContextManager;
+import org.apache.geronimo.transaction.context.TransactionContextManagerGBean;
 import org.apache.geronimo.transaction.manager.TransactionManagerImpl;
+import org.apache.geronimo.transaction.manager.TransactionManagerImplGBean;
 import org.mortbay.jetty.servlet.FormAuthenticator;
 
 
@@ -280,13 +282,13 @@
         start(container);
         start(connector);
 
-        tm = new GBeanData(tmName, TransactionManagerImpl.GBEAN_INFO);
+        tm = new GBeanData(tmName, TransactionManagerImplGBean.GBEAN_INFO);
         Set patterns = new HashSet();
         patterns.add(ObjectName.getInstance("geronimo.server:j2eeType=JCAManagedConnectionFactory,*"));
         tm.setAttribute("defaultTransactionTimeoutSeconds", new Integer(10));
         tm.setReferencePatterns("ResourceManagers", patterns);
         start(tm);
-        tcm = new GBeanData(tcmName, TransactionContextManager.GBEAN_INFO);
+        tcm = new GBeanData(tcmName, TransactionContextManagerGBean.GBEAN_INFO);
         tcm.setReferencePattern("TransactionManager", tmName);
         start(tcm);
         ctc = new GBeanData(ctcName, ConnectionTrackingCoordinatorGBean.GBEAN_INFO);

Modified: geronimo/trunk/modules/tomcat-builder/src/test/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilderTest.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/tomcat-builder/src/test/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilderTest.java?rev=233563&r1=233562&r2=233563&view=diff
==============================================================================
--- geronimo/trunk/modules/tomcat-builder/src/test/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilderTest.java
(original)
+++ geronimo/trunk/modules/tomcat-builder/src/test/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilderTest.java
Fri Aug 19 14:28:25 2005
@@ -83,7 +83,9 @@
 import org.apache.geronimo.tomcat.RealmGBean;
 import org.apache.geronimo.tomcat.TomcatContainer;
 import org.apache.geronimo.transaction.context.TransactionContextManager;
+import org.apache.geronimo.transaction.context.TransactionContextManagerGBean;
 import org.apache.geronimo.transaction.manager.TransactionManagerImpl;
+import org.apache.geronimo.transaction.manager.TransactionManagerImplGBean;
 
 /**
  * @version $Rev: 159325 $ $Date: 2005-03-28 15:53:03 -0700 (Mon, 28 Mar 2005) $
@@ -234,8 +236,8 @@
                     }
 
                     public Reference createCORBAReference(URI corbaURL,
-                            String objectName, ObjectName containerName,
-                            String home) throws DeploymentException {
+                                                          String objectName, ObjectName containerName,
+                                                          String home) throws DeploymentException
{
                         return null;
                     }
 
@@ -253,12 +255,12 @@
                 }, new ResourceReferenceBuilder() {
 
                     public Reference createResourceRef(String containerId,
-                            Class iface) throws DeploymentException {
+                                                       Class iface) throws DeploymentException
{
                         return null;
                     }
 
                     public Reference createAdminObjectRef(String containerId,
-                            Class iface) throws DeploymentException {
+                                                          Class iface) throws DeploymentException
{
                         return null;
                     }
 
@@ -436,13 +438,13 @@
         start(container);
         start(connector);
 
-        tm = new GBeanData(tmName, TransactionManagerImpl.GBEAN_INFO);
+        tm = new GBeanData(tmName, TransactionManagerImplGBean.GBEAN_INFO);
         Set patterns = new HashSet();
         patterns.add(ObjectName.getInstance("geronimo.server:j2eeType=JCAManagedConnectionFactory,*"));
         tm.setAttribute("defaultTransactionTimeoutSeconds", new Integer(10));
         tm.setReferencePatterns("ResourceManagers", patterns);
         start(tm);
-        tcm = new GBeanData(tcmName, TransactionContextManager.GBEAN_INFO);
+        tcm = new GBeanData(tcmName, TransactionContextManagerGBean.GBEAN_INFO);
         tcm.setReferencePattern("TransactionManager", tmName);
         start(tcm);
         ctc = new GBeanData(ctcName, ConnectionTrackingCoordinatorGBean.GBEAN_INFO);

Modified: geronimo/trunk/modules/tomcat/src/test/org/apache/geronimo/tomcat/AbstractWebModuleTest.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/tomcat/src/test/org/apache/geronimo/tomcat/AbstractWebModuleTest.java?rev=233563&r1=233562&r2=233563&view=diff
==============================================================================
--- geronimo/trunk/modules/tomcat/src/test/org/apache/geronimo/tomcat/AbstractWebModuleTest.java
(original)
+++ geronimo/trunk/modules/tomcat/src/test/org/apache/geronimo/tomcat/AbstractWebModuleTest.java
Fri Aug 19 14:28:25 2005
@@ -54,7 +54,9 @@
 import org.apache.geronimo.tomcat.util.SecurityHolder;
 import org.apache.geronimo.transaction.context.OnlineUserTransaction;
 import org.apache.geronimo.transaction.context.TransactionContextManager;
+import org.apache.geronimo.transaction.context.TransactionContextManagerGBean;
 import org.apache.geronimo.transaction.manager.TransactionManagerImpl;
+import org.apache.geronimo.transaction.manager.TransactionManagerImplGBean;
 
 
 /**
@@ -142,7 +144,7 @@
         contextRealm.setAttribute("className", "org.apache.geronimo.tomcat.realm.TomcatJAASRealm");
         contextRealm.setAttribute("initParams", initParams);
         start(contextRealm);
-        
+
         //Force a new realm name and ignore the application name
         SecurityHolder securityHolder = new SecurityHolder();
         securityHolder.setSecurityRealm(REALM_NAME);
@@ -266,7 +268,7 @@
         Principal.PrincipalEditor principalEditor2 = new Principal.PrincipalEditor();
         principalEditor2.setAsText("metro=org.apache.geronimo.security.realm.providers.GeronimoUserPrincipal");
         propertiesRealmGBean2.setAttribute("defaultPrincipal", principalEditor2.getValue());
-        
+
         start(loginConfigurationGBean);
         start(securityServiceGBean);
         start(loginServiceGBean);
@@ -276,12 +278,12 @@
         start(propertiesRealmGBean2);
 
     }
-    
+
     protected void tearDownJAASWebApp() throws Exception{
         stop(webModuleName);
         stop(contextRealmName);
     }
-    
+
     protected void tearDownSecurity() throws Exception {
         stop(propertiesRealmName2);
         stop(propertiesRealmName);
@@ -379,13 +381,13 @@
         start(container);
         start(connector);
 
-        tm = new GBeanData(tmName, TransactionManagerImpl.GBEAN_INFO);
+        tm = new GBeanData(tmName, TransactionManagerImplGBean.GBEAN_INFO);
         Set patterns = new HashSet();
         patterns.add(ObjectName.getInstance("geronimo.server:j2eeType=JCAManagedConnectionFactory,*"));
         tm.setAttribute("defaultTransactionTimeoutSeconds", new Integer(10));
         tm.setReferencePatterns("ResourceManagers", patterns);
         start(tm);
-        tcm = new GBeanData(tcmName, TransactionContextManager.GBEAN_INFO);
+        tcm = new GBeanData(tcmName, TransactionContextManagerGBean.GBEAN_INFO);
         tcm.setReferencePattern("TransactionManager", tmName);
         start(tcm);
         ctc = new GBeanData(ctcName, ConnectionTrackingCoordinatorGBean.GBEAN_INFO);

Modified: geronimo/trunk/modules/transaction/src/java/org/apache/geronimo/transaction/context/TransactionContextManager.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/transaction/src/java/org/apache/geronimo/transaction/context/TransactionContextManager.java?rev=233563&r1=233562&r2=233563&view=diff
==============================================================================
--- geronimo/trunk/modules/transaction/src/java/org/apache/geronimo/transaction/context/TransactionContextManager.java
(original)
+++ geronimo/trunk/modules/transaction/src/java/org/apache/geronimo/transaction/context/TransactionContextManager.java
Fri Aug 19 14:28:25 2005
@@ -17,29 +17,21 @@
 
 package org.apache.geronimo.transaction.context;
 
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-import javax.resource.spi.XATerminator;
-import javax.transaction.InvalidTransactionException;
-import javax.transaction.NotSupportedException;
-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.XAResource;
-import javax.transaction.xa.Xid;
-
-import org.apache.geronimo.gbean.GBeanInfo;
-import org.apache.geronimo.gbean.GBeanInfoBuilder;
-import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 import org.apache.geronimo.transaction.ExtendedTransactionManager;
 import org.apache.geronimo.transaction.ImportedTransactionActiveException;
 import org.apache.geronimo.transaction.XAWork;
 import org.apache.geronimo.transaction.manager.XidImporter;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+
+import javax.resource.spi.XATerminator;
+import javax.transaction.*;
+import javax.transaction.xa.XAException;
+import javax.transaction.xa.XAResource;
+import javax.transaction.xa.Xid;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
 
 /**
  * @version $Rev$ $Date$
@@ -354,38 +346,6 @@
             }
             containerTransactionContext.suspend();
         }
-    }
-
-
-    public static final GBeanInfo GBEAN_INFO;
-
-    static {
-        GBeanInfoBuilder infoFactory = new GBeanInfoBuilder(TransactionContextManager.class,
NameFactory.JTA_RESOURCE);
-
-        infoFactory.addOperation("getTransactionManager");
-        infoFactory.addOperation("getContext");
-        infoFactory.addOperation("setContext", new Class[]{TransactionContext.class});
-        infoFactory.addOperation("newContainerTransactionContext");
-        infoFactory.addOperation("newBeanTransactionContext", new Class[] {long.class});
-        infoFactory.addOperation("newUnspecifiedTransactionContext");
-        infoFactory.addOperation("resumeBeanTransactionContext",  new Class[] {TransactionContext.class});
-        infoFactory.addOperation("suspendBeanTransactionContext");
-        infoFactory.addOperation("getStatus");
-        infoFactory.addOperation("setRollbackOnly");
-        infoFactory.addOperation("setTransactionTimeout", new Class[] {int.class});
-
-        infoFactory.addReference("TransactionManager", ExtendedTransactionManager.class,
NameFactory.JTA_RESOURCE);
-        infoFactory.addReference("XidImporter", XidImporter.class, NameFactory.JTA_RESOURCE);
-
-        infoFactory.addInterface(XATerminator.class);
-        infoFactory.addInterface(XAWork.class);
-
-        infoFactory.setConstructor(new String[]{"TransactionManager", "XidImporter"});
-        GBEAN_INFO = infoFactory.getBeanInfo();
-    }
-
-    public static GBeanInfo getGBeanInfo() {
-        return GBEAN_INFO;
     }
 
 }

Added: geronimo/trunk/modules/transaction/src/java/org/apache/geronimo/transaction/context/TransactionContextManagerGBean.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/transaction/src/java/org/apache/geronimo/transaction/context/TransactionContextManagerGBean.java?rev=233563&view=auto
==============================================================================
--- geronimo/trunk/modules/transaction/src/java/org/apache/geronimo/transaction/context/TransactionContextManagerGBean.java
(added)
+++ geronimo/trunk/modules/transaction/src/java/org/apache/geronimo/transaction/context/TransactionContextManagerGBean.java
Fri Aug 19 14:28:25 2005
@@ -0,0 +1,67 @@
+/**
+ *
+ * Copyright 2004 The Apache Software Foundation
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+package org.apache.geronimo.transaction.context;
+
+import org.apache.geronimo.gbean.GBeanInfo;
+import org.apache.geronimo.gbean.GBeanInfoBuilder;
+import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
+import org.apache.geronimo.transaction.ExtendedTransactionManager;
+import org.apache.geronimo.transaction.XAWork;
+import org.apache.geronimo.transaction.manager.XidImporter;
+
+import javax.resource.spi.XATerminator;
+
+/**
+ * Used to provide the GBean metadata for the TransactionContextManager class
+ *
+ * @version $Rev: 156292 $ $Date: 2005-03-05 21:48:02 -0500 (Sat, 05 Mar 2005) $
+ */
+public class TransactionContextManagerGBean {
+
+    public static final GBeanInfo GBEAN_INFO;
+
+    static {
+        GBeanInfoBuilder infoFactory = new GBeanInfoBuilder(TransactionContextManager.class,
NameFactory.JTA_RESOURCE);
+
+        infoFactory.addOperation("getTransactionManager");
+        infoFactory.addOperation("getContext");
+        infoFactory.addOperation("setContext", new Class[]{TransactionContext.class});
+        infoFactory.addOperation("newContainerTransactionContext");
+        infoFactory.addOperation("newBeanTransactionContext", new Class[] {long.class});
+        infoFactory.addOperation("newUnspecifiedTransactionContext");
+        infoFactory.addOperation("resumeBeanTransactionContext",  new Class[] {TransactionContext.class});
+        infoFactory.addOperation("suspendBeanTransactionContext");
+        infoFactory.addOperation("getStatus");
+        infoFactory.addOperation("setRollbackOnly");
+        infoFactory.addOperation("setTransactionTimeout", new Class[] {int.class});
+
+        infoFactory.addReference("TransactionManager", ExtendedTransactionManager.class,
NameFactory.JTA_RESOURCE);
+        infoFactory.addReference("XidImporter", XidImporter.class, NameFactory.JTA_RESOURCE);
+
+        infoFactory.addInterface(XATerminator.class);
+        infoFactory.addInterface(XAWork.class);
+
+        infoFactory.setConstructor(new String[]{"TransactionManager", "XidImporter"});
+        GBEAN_INFO = infoFactory.getBeanInfo();
+    }
+
+    public static GBeanInfo getGBeanInfo() {
+        return GBEAN_INFO;
+    }
+
+}

Modified: geronimo/trunk/modules/transaction/src/java/org/apache/geronimo/transaction/manager/TransactionManagerImpl.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/transaction/src/java/org/apache/geronimo/transaction/manager/TransactionManagerImpl.java?rev=233563&r1=233562&r2=233563&view=diff
==============================================================================
--- geronimo/trunk/modules/transaction/src/java/org/apache/geronimo/transaction/manager/TransactionManagerImpl.java
(original)
+++ geronimo/trunk/modules/transaction/src/java/org/apache/geronimo/transaction/manager/TransactionManagerImpl.java
Fri Aug 19 14:28:25 2005
@@ -17,34 +17,16 @@
 
 package org.apache.geronimo.transaction.manager;
 
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import javax.transaction.HeuristicMixedException;
-import javax.transaction.HeuristicRollbackException;
-import javax.transaction.InvalidTransactionException;
-import javax.transaction.NotSupportedException;
-import javax.transaction.RollbackException;
-import javax.transaction.Status;
-import javax.transaction.SystemException;
-import javax.transaction.Transaction;
-import javax.transaction.xa.XAException;
-import javax.transaction.xa.Xid;
-
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.apache.geronimo.gbean.GBeanInfo;
-import org.apache.geronimo.gbean.GBeanInfoBuilder;
-import org.apache.geronimo.gbean.ReferenceCollection;
-import org.apache.geronimo.gbean.ReferenceCollectionEvent;
-import org.apache.geronimo.gbean.ReferenceCollectionListener;
-import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
 import org.apache.geronimo.transaction.ExtendedTransactionManager;
 import org.apache.geronimo.transaction.log.UnrecoverableLog;
 
+import javax.transaction.*;
+import javax.transaction.xa.XAException;
+import javax.transaction.xa.Xid;
+import java.util.*;
+
 /**
  * Simple implementation of a transaction manager.
  *
@@ -58,7 +40,7 @@
     private final ThreadLocal threadTx = new ThreadLocal();
     private static final Log recoveryLog = LogFactory.getLog("RecoveryController");
     final Recovery recovery;
-    final ReferenceCollection resourceManagers;
+    final Collection resourceManagers;
     private List recoveryErrors = new ArrayList();
 
     /**
@@ -72,33 +54,24 @@
         this.defaultTransactionTimeoutMilliseconds = defaultTransactionTimeoutSeconds * 1000;
         this.transactionLog = transactionLog == null ? new UnrecoverableLog() : transactionLog;
         this.xidFactory = new XidFactoryImpl("WHAT DO WE CALL IT?".getBytes());
-        this.resourceManagers = (ReferenceCollection) resourceManagers;
+        this.resourceManagers = resourceManagers;
         recovery = new RecoveryImpl(this.transactionLog, this.xidFactory);
 
         if (resourceManagers != null) {
             recovery.recoverLog();
-            List copy = null;
-            synchronized (resourceManagers) {
-                copy = new ArrayList(resourceManagers);
-                this.resourceManagers.addReferenceCollectionListener(new ReferenceCollectionListener()
{
-                    public void memberAdded(ReferenceCollectionEvent event) {
-                        ResourceManager resourceManager = (ResourceManager) event.getMember();
-                        recoverResourceManager(resourceManager);
-                    }
-
-                    public void memberRemoved(ReferenceCollectionEvent event) {
-                    }
-
-                });
-            }
+            List copy = watchResourceManagers(resourceManagers);
             for (Iterator iterator = copy.iterator(); iterator.hasNext();) {
                 ResourceManager resourceManager = (ResourceManager) iterator.next();
                 recoverResourceManager(resourceManager);
             }
-            //what to do if there are recovery errors? or not all resource managers are online?
         }
     }
 
+    protected List watchResourceManagers(Collection resourceManagers) {
+        return new ArrayList(resourceManagers);
+    }
+
+
     public Transaction getTransaction() throws SystemException {
         return (Transaction) threadTx.get();
     }
@@ -279,25 +252,4 @@
         return new HashMap(recovery.getExternalXids());
     }
 
-    public static final GBeanInfo GBEAN_INFO;
-
-    static {
-        GBeanInfoBuilder infoBuilder = new GBeanInfoBuilder(TransactionManagerImpl.class,
NameFactory.JTA_RESOURCE);
-
-        infoBuilder.addAttribute("defaultTransactionTimeoutSeconds", int.class, true);
-        infoBuilder.addReference("TransactionLog", TransactionLog.class, NameFactory.JTA_RESOURCE);
-        infoBuilder.addReference("ResourceManagers", ResourceManager.class);//two kinds of
things, so specify the type in each pattern.
-
-        infoBuilder.addInterface(ExtendedTransactionManager.class);
-        infoBuilder.addInterface(XidImporter.class);
-
-        infoBuilder.setConstructor(new String[]{"defaultTransactionTimeoutSeconds", "TransactionLog",
"ResourceManagers"});
-
-        GBEAN_INFO = infoBuilder.getBeanInfo();
-    }
-
-
-    public static GBeanInfo getGBeanInfo() {
-        return GBEAN_INFO;
-    }
 }

Added: geronimo/trunk/modules/transaction/src/java/org/apache/geronimo/transaction/manager/TransactionManagerImplGBean.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/transaction/src/java/org/apache/geronimo/transaction/manager/TransactionManagerImplGBean.java?rev=233563&view=auto
==============================================================================
--- geronimo/trunk/modules/transaction/src/java/org/apache/geronimo/transaction/manager/TransactionManagerImplGBean.java
(added)
+++ geronimo/trunk/modules/transaction/src/java/org/apache/geronimo/transaction/manager/TransactionManagerImplGBean.java
Fri Aug 19 14:28:25 2005
@@ -0,0 +1,92 @@
+/**
+ *
+ * Copyright 2003-2004 The Apache Software Foundation
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+package org.apache.geronimo.transaction.manager;
+
+import org.apache.geronimo.gbean.*;
+import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
+import org.apache.geronimo.transaction.ExtendedTransactionManager;
+
+import javax.transaction.xa.XAException;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+
+/**
+ * Simple implementation of a transaction manager.
+ *
+ * @version $Rev: 156292 $ $Date: 2005-03-05 21:48:02 -0500 (Sat, 05 Mar 2005) $
+ */
+public class TransactionManagerImplGBean extends TransactionManagerImpl {
+
+    /**
+     * TODO NOTE!!! this should be called in an unspecified transaction context, but we cannot
enforce this restriction!
+     */
+    public TransactionManagerImplGBean(int defaultTransactionTimeoutSeconds, TransactionLog
transactionLog, Collection resourceManagers) throws XAException {
+        super(defaultTransactionTimeoutSeconds, transactionLog, resourceManagers);
+    }
+
+    /**
+     * We can track as resources are added into the geronimo kernel.
+     *
+     * @param resourceManagers
+     * @return the original list of resources.
+     */
+    protected List watchResourceManagers(Collection resourceManagers) {
+        if( resourceManagers instanceof ReferenceCollection ) {
+            List copy;
+            synchronized (resourceManagers) {
+                copy = new ArrayList(resourceManagers);
+                    ((ReferenceCollection)resourceManagers).addReferenceCollectionListener(new
ReferenceCollectionListener() {
+                    public void memberAdded(ReferenceCollectionEvent event) {
+                        ResourceManager resourceManager = (ResourceManager) event.getMember();
+                        recoverResourceManager(resourceManager);
+                    }
+
+                    public void memberRemoved(ReferenceCollectionEvent event) {
+                    }
+
+                });
+            }
+            return copy;
+        } else {
+            return super.watchResourceManagers(resourceManagers);
+        }
+    }
+
+    public static final GBeanInfo GBEAN_INFO;
+
+    static {
+        GBeanInfoBuilder infoBuilder = new GBeanInfoBuilder(TransactionManagerImplGBean.class,
NameFactory.JTA_RESOURCE);
+
+        infoBuilder.addAttribute("defaultTransactionTimeoutSeconds", int.class, true);
+        infoBuilder.addReference("TransactionLog", TransactionLog.class, NameFactory.JTA_RESOURCE);
+        infoBuilder.addReference("ResourceManagers", ResourceManager.class);//two kinds of
things, so specify the type in each pattern.
+
+        infoBuilder.addInterface(ExtendedTransactionManager.class);
+        infoBuilder.addInterface(XidImporter.class);
+
+        infoBuilder.setConstructor(new String[]{"defaultTransactionTimeoutSeconds", "TransactionLog",
"ResourceManagers"});
+
+        GBEAN_INFO = infoBuilder.getBeanInfo();
+    }
+
+
+    public static GBeanInfo getGBeanInfo() {
+        return GBEAN_INFO;
+    }
+}

Modified: geronimo/trunk/modules/transaction/src/java/org/apache/geronimo/transaction/manager/XidFactoryImpl.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/transaction/src/java/org/apache/geronimo/transaction/manager/XidFactoryImpl.java?rev=233563&r1=233562&r2=233563&view=diff
==============================================================================
--- geronimo/trunk/modules/transaction/src/java/org/apache/geronimo/transaction/manager/XidFactoryImpl.java
(original)
+++ geronimo/trunk/modules/transaction/src/java/org/apache/geronimo/transaction/manager/XidFactoryImpl.java
Fri Aug 19 14:28:25 2005
@@ -17,15 +17,10 @@
 
 package org.apache.geronimo.transaction.manager;
 
+import javax.transaction.xa.Xid;
 import java.net.InetAddress;
 import java.net.UnknownHostException;
 
-import javax.transaction.xa.Xid;
-
-import org.apache.geronimo.gbean.GBeanInfo;
-import org.apache.geronimo.gbean.GBeanInfoBuilder;
-import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
-
 /**
  * Factory for transaction ids.
  * The Xid is constructed of three parts:
@@ -113,15 +108,4 @@
         return new XidImpl(formatId, globalTransactionid, branchQualifier);
     }
 
-    public static final GBeanInfo GBEAN_INFO;
-
-    static {
-        GBeanInfoBuilder infoFactory = new GBeanInfoBuilder(XidFactoryImpl.class, NameFactory.JTA_RESOURCE);
-        infoFactory.addInterface(XidFactory.class);
-        GBEAN_INFO = infoFactory.getBeanInfo();
-    }
-
-    public static GBeanInfo getGBeanInfo() {
-        return GBEAN_INFO;
-    }
 }

Added: geronimo/trunk/modules/transaction/src/java/org/apache/geronimo/transaction/manager/XidFactoryImplGBean.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/transaction/src/java/org/apache/geronimo/transaction/manager/XidFactoryImplGBean.java?rev=233563&view=auto
==============================================================================
--- geronimo/trunk/modules/transaction/src/java/org/apache/geronimo/transaction/manager/XidFactoryImplGBean.java
(added)
+++ geronimo/trunk/modules/transaction/src/java/org/apache/geronimo/transaction/manager/XidFactoryImplGBean.java
Fri Aug 19 14:28:25 2005
@@ -0,0 +1,40 @@
+/**
+ *
+ * Copyright 2003-2004 The Apache Software Foundation
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+package org.apache.geronimo.transaction.manager;
+
+import org.apache.geronimo.gbean.GBeanInfo;
+import org.apache.geronimo.gbean.GBeanInfoBuilder;
+import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
+
+/**
+ * Provides the GBean metadata for the XidFactoryImpl class.
+ */
+public class XidFactoryImplGBean {
+
+    public static final GBeanInfo GBEAN_INFO;
+
+    static {
+        GBeanInfoBuilder infoFactory = new GBeanInfoBuilder(XidFactoryImplGBean.class, NameFactory.JTA_RESOURCE);
+        infoFactory.addInterface(XidFactory.class);
+        GBEAN_INFO = infoFactory.getBeanInfo();
+    }
+
+    public static GBeanInfo getGBeanInfo() {
+        return GBEAN_INFO;
+    }
+}

Modified: geronimo/trunk/modules/transaction/src/test/org/apache/geronimo/transaction/manager/TransactionManagerImplTest.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/transaction/src/test/org/apache/geronimo/transaction/manager/TransactionManagerImplTest.java?rev=233563&r1=233562&r2=233563&view=diff
==============================================================================
--- geronimo/trunk/modules/transaction/src/test/org/apache/geronimo/transaction/manager/TransactionManagerImplTest.java
(original)
+++ geronimo/trunk/modules/transaction/src/test/org/apache/geronimo/transaction/manager/TransactionManagerImplTest.java
Fri Aug 19 14:28:25 2005
@@ -48,7 +48,7 @@
     TransactionManagerImpl tm;
 
     protected void setUp() throws Exception {
-        tm = new TransactionManagerImpl(10, transactionLog, resourceManagers);
+        tm = new TransactionManagerImplGBean(10, transactionLog, resourceManagers);
     }
 
     protected void tearDown() throws Exception {

Modified: geronimo/trunk/sandbox/spring-assembly/src/conf/server.xml
URL: http://svn.apache.org/viewcvs/geronimo/trunk/sandbox/spring-assembly/src/conf/server.xml?rev=233563&r1=233562&r2=233563&view=diff
==============================================================================
--- geronimo/trunk/sandbox/spring-assembly/src/conf/server.xml (original)
+++ geronimo/trunk/sandbox/spring-assembly/src/conf/server.xml Fri Aug 19 14:28:25 2005
@@ -158,7 +158,7 @@
         <property name="serverInfo"><ref bean="ServerInfo"/></property>
     </bean>
 
-    <bean name="TransactionManager" class="org.apache.geronimo.transaction.manager.TransactionManagerImpl">
+    <bean name="TransactionManager" class="org.apache.geronimo.transaction.manager.TransactionManagerImplGBean">
         <property name="defaultTransactionTimeoutSeconds"><value>600</value></property>
         <property name="transactionLog"><ref bean="HOWLTransactionLog"/></property>
         <property name="resourceManagers">
@@ -175,7 +175,7 @@
         </property>
     </bean>
 
-    <bean name="TransactionContextManager" class="org.apache.geronimo.transaction.context.TransactionContextManager">
+    <bean name="TransactionContextManager" class="org.apache.geronimo.transaction.context.TransactionContextManagerGBean">
         <property name="transactionManager"><ref bean="TransactionManager"/></property>
         <property name="xidImporter"><ref bean="TransactionManager"/></property>
     </bean>



Mime
View raw message