[jboss-cvs] JBossAS SVN: r58811 - trunk/tomcat/src/main/org/jboss/web/tomcat/tc6/deployers

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Fri Dec 1 16:38:35 EST 2006


Author: scott.stark at jboss.org
Date: 2006-12-01 16:38:33 -0500 (Fri, 01 Dec 2006)
New Revision: 58811

Modified:
   trunk/tomcat/src/main/org/jboss/web/tomcat/tc6/deployers/TomcatDeployment.java
Log:
Restore the ORB and UserTransaction enc bindings.

Modified: trunk/tomcat/src/main/org/jboss/web/tomcat/tc6/deployers/TomcatDeployment.java
===================================================================
--- trunk/tomcat/src/main/org/jboss/web/tomcat/tc6/deployers/TomcatDeployment.java	2006-12-01 19:20:44 UTC (rev 58810)
+++ trunk/tomcat/src/main/org/jboss/web/tomcat/tc6/deployers/TomcatDeployment.java	2006-12-01 21:38:33 UTC (rev 58811)
@@ -44,6 +44,7 @@
 import javax.management.ObjectName;
 import javax.naming.Context;
 import javax.naming.InitialContext;
+import javax.naming.LinkRef;
 
 import org.apache.catalina.Loader;
 import org.apache.tomcat.util.modeler.Registry;
@@ -51,6 +52,7 @@
 import org.jboss.logging.Logger;
 import org.jboss.metadata.WebMetaData;
 import org.jboss.mx.util.MBeanServerLocator;
+import org.jboss.naming.NonSerializableFactory;
 import org.jboss.security.AuthorizationManager;
 import org.jboss.security.authorization.PolicyRegistration;
 import org.jboss.virtual.VirtualFile;
@@ -337,6 +339,28 @@
             metaData.setENCLoader(webLoader.getClassLoader());
             InitialContext iniCtx = new InitialContext();
             Context envCtx = (Context) iniCtx.lookup("java:comp");
+            // Add ORB/UserTransaction
+            ORB orb = null;
+            try
+            {
+               ObjectName ORB_NAME = new ObjectName("jboss:service=CorbaORB");
+               orb = (ORB) server.getAttribute(ORB_NAME, "ORB");
+               // Bind the orb
+               if (orb != null)
+               {
+                  NonSerializableFactory.rebind(envCtx, "ORB", orb);
+                  log.debug("Bound java:comp/ORB");
+               }
+            }
+            catch (Throwable t)
+            {
+               log.debug("Unable to retrieve orb" + t.toString());
+            }
+
+            // TODO: injection, Add a link to the global transaction manager
+            envCtx.bind("UserTransaction", new LinkRef("UserTransaction"));
+            log.debug("Linked java:comp/UserTransaction to JNDI name: UserTransaction");
+
             envCtx = envCtx.createSubcontext("env");
             injectionContainer.populateEnc(webLoader.getClassLoader());
             // TODO: this should be bindings in the metadata




More information about the jboss-cvs-commits mailing list