[jboss-cvs] JBossAS SVN: r65492 - trunk/iiop/src/main/org/jboss/proxy/ejb.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Thu Sep 20 09:53:03 EDT 2007


Author: reverbel
Date: 2007-09-20 09:53:03 -0400 (Thu, 20 Sep 2007)
New Revision: 65492

Modified:
   trunk/iiop/src/main/org/jboss/proxy/ejb/EjbHomeCorbaServant.java
   trunk/iiop/src/main/org/jboss/proxy/ejb/EjbObjectCorbaServant.java
Log:
Remove the hardcoded dependency to TxServerInterceptor, use the SPI interface InboundTransactionCurrent instead. 

Modified: trunk/iiop/src/main/org/jboss/proxy/ejb/EjbHomeCorbaServant.java
===================================================================
--- trunk/iiop/src/main/org/jboss/proxy/ejb/EjbHomeCorbaServant.java	2007-09-20 13:44:02 UTC (rev 65491)
+++ trunk/iiop/src/main/org/jboss/proxy/ejb/EjbHomeCorbaServant.java	2007-09-20 13:53:03 UTC (rev 65492)
@@ -42,13 +42,13 @@
 import org.jboss.iiop.csiv2.SASCurrent;
 import org.jboss.iiop.rmi.RmiIdlUtil;
 import org.jboss.iiop.rmi.marshal.strategy.SkeletonStrategy;
+import org.jboss.iiop.tm.InboundTransactionCurrent;
 import org.jboss.invocation.Invocation;
 import org.jboss.invocation.InvocationKey;
 import org.jboss.invocation.InvocationType;
 import org.jboss.invocation.PayloadKey;
 import org.jboss.invocation.iiop.ServantWithMBeanServer;
 import org.jboss.logging.Logger;
-import org.jboss.tm.iiop.TxServerInterceptor;
 import org.jboss.security.SimplePrincipal;
 
 /**
@@ -118,6 +118,12 @@
     */
    private SASCurrent sasCurrent;
 
+   /** 
+    * A reference to the InboundTransactionCurrent, or null if OTS interceptors
+    * are not installed.
+    */
+   private InboundTransactionCurrent inboundTxCurrent;
+
    /**
     * Constructs an <code>EjbHomeCorbaServant></code>.
     */ 
@@ -144,6 +150,15 @@
       {
          this.sasCurrent = null;
       }
+      try
+      {
+         this.inboundTxCurrent = (InboundTransactionCurrent)
+            CorbaORB.getInstance().resolve_initial_references("JBossInboundTransactionCurrent");
+      }
+      catch (InvalidName invalidName)
+      {
+         this.inboundTxCurrent = null;
+      }
    }
 
    public void setHomeHandle(HomeHandle homeHandle)
@@ -224,7 +239,9 @@
             }
             else
             {
-               Transaction tx = TxServerInterceptor.getCurrentTransaction();
+               Transaction tx = null;
+               if (inboundTxCurrent != null)
+                  tx = inboundTxCurrent.getCurrentTransaction();
                SimplePrincipal principal = null;
                char[] password = null;
                if (sasCurrent != null)

Modified: trunk/iiop/src/main/org/jboss/proxy/ejb/EjbObjectCorbaServant.java
===================================================================
--- trunk/iiop/src/main/org/jboss/proxy/ejb/EjbObjectCorbaServant.java	2007-09-20 13:44:02 UTC (rev 65491)
+++ trunk/iiop/src/main/org/jboss/proxy/ejb/EjbObjectCorbaServant.java	2007-09-20 13:53:03 UTC (rev 65492)
@@ -43,6 +43,7 @@
 import org.jboss.iiop.csiv2.SASCurrent;
 import org.jboss.iiop.rmi.RmiIdlUtil;
 import org.jboss.iiop.rmi.marshal.strategy.SkeletonStrategy;
+import org.jboss.iiop.tm.InboundTransactionCurrent;
 import org.jboss.invocation.Invocation;
 import org.jboss.invocation.InvocationKey;
 import org.jboss.invocation.InvocationType;
@@ -50,7 +51,6 @@
 import org.jboss.invocation.iiop.ReferenceData;
 import org.jboss.invocation.iiop.ServantWithMBeanServer;
 import org.jboss.logging.Logger;
-import org.jboss.tm.iiop.TxServerInterceptor;
 import org.jboss.security.SimplePrincipal;
 
 
@@ -122,6 +122,12 @@
     * installed.
     */
    private SASCurrent sasCurrent;
+   
+   /** 
+    * A reference to the InboundTransactionCurrent, or null if OTS interceptors
+    * are not installed.
+    */
+   private InboundTransactionCurrent inboundTxCurrent;
 
    /**
     * Constructs an <code>EjbObjectCorbaServant></code>.
@@ -151,6 +157,15 @@
       {
          this.sasCurrent = null;
       }
+      try
+      {
+         this.inboundTxCurrent = (InboundTransactionCurrent)
+            CorbaORB.getInstance().resolve_initial_references("JBossInboundTransactionCurrent");
+      }
+      catch (InvalidName invalidName)
+      {
+         this.inboundTxCurrent = null;
+      }
    }
 
    // Implementation of method declared as abstract in the superclass ------
@@ -238,7 +253,9 @@
             }
             else
             {
-               Transaction tx = TxServerInterceptor.getCurrentTransaction();
+               Transaction tx = null;
+               if (inboundTxCurrent != null)
+                  tx = inboundTxCurrent.getCurrentTransaction();
                SimplePrincipal principal = null;
                char[] password = null;
                if (sasCurrent != null)




More information about the jboss-cvs-commits mailing list