geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r983150 - in /geronimo/server/trunk/plugins/openejb/geronimo-openejb/src/main/java/org/apache/geronimo/openejb: GeronimoInboundRecovery.java OpenEjbSystemGBean.java
Date Sat, 07 Aug 2010 00:27:51 GMT
Author: djencks
Date: Sat Aug  7 00:27:51 2010
New Revision: 983150

URL: http://svn.apache.org/viewvc?rev=983150&view=rev
Log:
GERONIMO-5501 support openejb xa recovery of inbound resource adapters.  Apparently openejb
is somehow not using our ra wrapper

Modified:
    geronimo/server/trunk/plugins/openejb/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/GeronimoInboundRecovery.java
    geronimo/server/trunk/plugins/openejb/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/OpenEjbSystemGBean.java

Modified: geronimo/server/trunk/plugins/openejb/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/GeronimoInboundRecovery.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/openejb/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/GeronimoInboundRecovery.java?rev=983150&r1=983149&r2=983150&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/openejb/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/GeronimoInboundRecovery.java
(original)
+++ geronimo/server/trunk/plugins/openejb/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/GeronimoInboundRecovery.java
Sat Aug  7 00:27:51 2010
@@ -22,7 +22,9 @@ package org.apache.geronimo.openejb;
 
 import javax.resource.spi.ActivationSpec;
 import javax.resource.spi.ResourceAdapter;
+import org.apache.geronimo.connector.ActivationSpecNamedXAResourceFactory;
 import org.apache.geronimo.connector.ResourceAdapterWrapper;
+import org.apache.geronimo.transaction.manager.RecoverableTransactionManager;
 import org.apache.openejb.OpenEJBException;
 import org.apache.openejb.core.mdb.InboundRecovery;
 
@@ -31,7 +33,13 @@ import org.apache.openejb.core.mdb.Inbou
  */
 public class GeronimoInboundRecovery implements InboundRecovery {
 
+    private final RecoverableTransactionManager transactionManager;
+
+    public GeronimoInboundRecovery(RecoverableTransactionManager transactionManager) {
+        this.transactionManager = transactionManager;
+    }
+
     public void recover(ResourceAdapter resourceAdapter, ActivationSpec activationSpec, String
containerId) throws OpenEJBException {
-        ((ResourceAdapterWrapper)resourceAdapter).doRecovery(activationSpec, containerId);
+        transactionManager.registerNamedXAResourceFactory(new ActivationSpecNamedXAResourceFactory(containerId,
activationSpec, resourceAdapter));
     }
 }

Modified: geronimo/server/trunk/plugins/openejb/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/OpenEjbSystemGBean.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/openejb/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/OpenEjbSystemGBean.java?rev=983150&r1=983149&r2=983150&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/openejb/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/OpenEjbSystemGBean.java
(original)
+++ geronimo/server/trunk/plugins/openejb/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/OpenEjbSystemGBean.java
Sat Aug  7 00:27:51 2010
@@ -47,6 +47,7 @@ import org.apache.geronimo.j2ee.j2eeobje
 import org.apache.geronimo.kernel.GBeanNotFoundException;
 import org.apache.geronimo.kernel.Kernel;
 import org.apache.geronimo.persistence.PersistenceUnitGBean;
+import org.apache.geronimo.transaction.manager.RecoverableTransactionManager;
 import org.apache.openejb.Container;
 import org.apache.openejb.DeploymentInfo;
 import org.apache.openejb.NoSuchApplicationException;
@@ -97,11 +98,11 @@ public class OpenEjbSystemGBean implemen
     private ORB orb;
     private Properties properties; 
     
-    public OpenEjbSystemGBean(TransactionManager transactionManager) throws Exception {
+    public OpenEjbSystemGBean(RecoverableTransactionManager transactionManager) throws Exception
{
         this(transactionManager, null, null, null, OpenEjbSystemGBean.class.getClassLoader(),
new Properties());
     }
 
-    public OpenEjbSystemGBean(@ParamReference(name = "TransactionManager", namingType = NameFactory.JTA_RESOURCE)
TransactionManager transactionManager,
+    public OpenEjbSystemGBean(@ParamReference(name = "TransactionManager", namingType = NameFactory.JTA_RESOURCE)
RecoverableTransactionManager transactionManager,
                               @ParamReference(name = "ResourceAdapterWrappers", namingType
= NameFactory.JCA_RESOURCE_ADAPTER) Collection<ResourceAdapterWrapper> resourceAdapters,
                               @ParamReference(name = "PersistenceUnitGBeans", namingType
= NameFactory.PERSISTENCE_UNIT) Collection<PersistenceUnitGBean> persistenceUnitGBeans,
 //                              @ParamReference(name = "OpenEjbContext")DeepBindableContext
openejbContext,
@@ -142,7 +143,7 @@ public class OpenEjbSystemGBean implemen
         assembler.createTransactionManager(transactionServiceInfo);
 	    SystemInstance.get().setComponent(XAResourceWrapper.class, new GeronimoXAResourceWrapper());
 
-        SystemInstance.get().setComponent(InboundRecovery.class, new GeronimoInboundRecovery());
+        SystemInstance.get().setComponent(InboundRecovery.class, new GeronimoInboundRecovery(transactionManager));
 
         // install security service
         SecurityService securityService = new GeronimoSecurityService();



Mime
View raw message