[jboss-cvs] JBossAS SVN: r65501 - trunk/iiop/src/main/org/jboss/tm/iiop.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Thu Sep 20 11:55:42 EDT 2007


Author: reverbel
Date: 2007-09-20 11:55:42 -0400 (Thu, 20 Sep 2007)
New Revision: 65501

Added:
   trunk/iiop/src/main/org/jboss/tm/iiop/InboundTransactionCurrentImpl.java
Modified:
   trunk/iiop/src/main/org/jboss/tm/iiop/TxServerInterceptorInitializer.java
Log:
Add default implementation of InboundTransactionCurrent.

Added: trunk/iiop/src/main/org/jboss/tm/iiop/InboundTransactionCurrentImpl.java
===================================================================
--- trunk/iiop/src/main/org/jboss/tm/iiop/InboundTransactionCurrentImpl.java	                        (rev 0)
+++ trunk/iiop/src/main/org/jboss/tm/iiop/InboundTransactionCurrentImpl.java	2007-09-20 15:55:42 UTC (rev 65501)
@@ -0,0 +1,45 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.tm.iiop;
+
+import javax.transaction.Transaction;
+
+import org.jboss.iiop.tm.InboundTransactionCurrent;
+import org.omg.CORBA.LocalObject;
+
+/**
+ * Default implementation of the InboundTransactionCurrent SPI.
+ * 
+ * @author <a href="mailto:reverbel at ime.usp.br">Francisco Reverbel</a>
+ * @version $Revision$
+ */
+public class InboundTransactionCurrentImpl 
+      extends LocalObject
+      implements InboundTransactionCurrent
+{
+
+   public Transaction getCurrentTransaction()
+   {
+      return TxServerInterceptor.getCurrentTransaction();
+   }
+
+}

Modified: trunk/iiop/src/main/org/jboss/tm/iiop/TxServerInterceptorInitializer.java
===================================================================
--- trunk/iiop/src/main/org/jboss/tm/iiop/TxServerInterceptorInitializer.java	2007-09-20 15:53:41 UTC (rev 65500)
+++ trunk/iiop/src/main/org/jboss/tm/iiop/TxServerInterceptorInitializer.java	2007-09-20 15:55:42 UTC (rev 65501)
@@ -21,12 +21,14 @@
 */
 package org.jboss.tm.iiop;
 
+import org.jboss.iiop.tm.InboundTransactionCurrent;
 import org.omg.CORBA.LocalObject;
 import org.omg.IOP.Codec;
 import org.omg.IOP.ENCODING_CDR_ENCAPS;
 import org.omg.IOP.Encoding;
 import org.omg.PortableInterceptor.ORBInitInfo;
 import org.omg.PortableInterceptor.ORBInitializer;
+import org.omg.PortableInterceptor.ORBInitInfoPackage.InvalidName;
 
 /**
  * This is an <code>org.omg.PortableInterceptor.ORBInitializer</code> that
@@ -51,7 +53,17 @@
 
    public void pre_init(ORBInitInfo info)
    {
-      // do nothing
+      try
+      {
+         // Create and register the InboundTransactionCurrent
+         InboundTransactionCurrent inboundTxCurrent = new InboundTransactionCurrentImpl();
+         info.register_initial_reference(InboundTransactionCurrent.NAME, inboundTxCurrent);
+      }
+      catch(InvalidName e)
+      {
+         throw new RuntimeException("Could not register initial " +
+            "reference for JBossInboundTransactionCurrent: " + e);
+      }
    }
 
    public void post_init(ORBInitInfo info) 




More information about the jboss-cvs-commits mailing list