geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rickmcgu...@apache.org
Subject svn commit: r521653 - in /geronimo/server/trunk: configs/j2ee-corba-yoko/src/plan/ configs/openejb/src/plan/ modules/geronimo-corba/src/main/java/org/apache/geronimo/corba/ modules/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/
Date Fri, 23 Mar 2007 10:05:05 GMT
Author: rickmcguire
Date: Fri Mar 23 03:04:59 2007
New Revision: 521653

URL: http://svn.apache.org/viewvc?view=rev&rev=521653
Log:
GERONIMO-3001 A cleaner fix that gets the comp/ORB insertion working the way it needs to be.


Removed:
    geronimo/server/trunk/modules/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/ORBProvider.java
Modified:
    geronimo/server/trunk/configs/j2ee-corba-yoko/src/plan/plan.xml
    geronimo/server/trunk/configs/openejb/src/plan/plan.xml
    geronimo/server/trunk/modules/geronimo-corba/src/main/java/org/apache/geronimo/corba/CORBABean.java
    geronimo/server/trunk/modules/geronimo-corba/src/main/java/org/apache/geronimo/corba/CORBABeanGBean.java
    geronimo/server/trunk/modules/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/OpenEjbSystem.java
    geronimo/server/trunk/modules/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/OpenEjbSystemGBean.java

Modified: geronimo/server/trunk/configs/j2ee-corba-yoko/src/plan/plan.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/configs/j2ee-corba-yoko/src/plan/plan.xml?view=diff&rev=521653&r1=521652&r2=521653
==============================================================================
--- geronimo/server/trunk/configs/j2ee-corba-yoko/src/plan/plan.xml (original)
+++ geronimo/server/trunk/configs/j2ee-corba-yoko/src/plan/plan.xml Fri Mar 23 03:04:59 2007
@@ -61,6 +61,7 @@
         <reference name="NameService">
             <name>NameServer</name>
         </reference>
+        <reference name="OpenEjbSystem"/>
         <reference name="SSLConfig">
             <name>CORBASSLConfig</name>
         </reference>

Modified: geronimo/server/trunk/configs/openejb/src/plan/plan.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/configs/openejb/src/plan/plan.xml?view=diff&rev=521653&r1=521652&r2=521653
==============================================================================
--- geronimo/server/trunk/configs/openejb/src/plan/plan.xml (original)
+++ geronimo/server/trunk/configs/openejb/src/plan/plan.xml Fri Mar 23 03:04:59 2007
@@ -25,7 +25,6 @@
             <name>TransactionManager</name>
         </reference>
         <reference name="ResourceAdapterWrappers"/>
-        <reference name="ORBProviders"/>
     </gbean>
 
     <gbean name="DefaultStatelessContainer" class="org.apache.geronimo.openejb.EjbContainer">

Modified: geronimo/server/trunk/modules/geronimo-corba/src/main/java/org/apache/geronimo/corba/CORBABean.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-corba/src/main/java/org/apache/geronimo/corba/CORBABean.java?view=diff&rev=521653&r1=521652&r2=521653
==============================================================================
--- geronimo/server/trunk/modules/geronimo-corba/src/main/java/org/apache/geronimo/corba/CORBABean.java
(original)
+++ geronimo/server/trunk/modules/geronimo-corba/src/main/java/org/apache/geronimo/corba/CORBABean.java
Fri Mar 23 03:04:59 2007
@@ -33,7 +33,7 @@
 import org.apache.geronimo.corba.security.config.tss.TSSSSLTransportConfig;
 import org.apache.geronimo.corba.security.config.tss.TSSTransportMechConfig;
 import org.apache.geronimo.corba.util.Util;
-import org.apache.geronimo.openejb.ORBProvider; 
+import org.apache.geronimo.openejb.OpenEjbSystem; 
 import org.omg.CORBA.ORB;
 import org.omg.CORBA.Policy;
 import org.omg.PortableServer.POA;
@@ -50,7 +50,7 @@
  * endpoint and transport-level security.
  * @version $Revision: 497125 $ $Date: 2007-01-17 10:51:30 -0800 (Wed, 17 Jan 2007) $
  */
-public class CORBABean implements GBeanLifecycle, ORBRef, ORBProvider, ORBConfiguration {
+public class CORBABean implements GBeanLifecycle, ORBRef, ORBConfiguration {
     private final Log log = LogFactory.getLog(CORBABean.class);
 
     private final ClassLoader classLoader;
@@ -65,6 +65,7 @@
     private POA rootPOA;
     private NameService nameService;
     private AbstractName abstractName;
+    private OpenEjbSystem ejbSystem; 
     // ORB-specific policy overrides we need to add to POA policies created by 
     // child TSSBeans.  
     private Policy[] policyOverrides = null; 
@@ -77,6 +78,7 @@
         this.host = null;
         this.abstractName = null;
         this.policyOverrides = null; 
+        this.ejbSystem = null;
     }
 
     /**
@@ -98,7 +100,7 @@
      * @param ssl    The SSL configuration, including the KeystoreManager.
      *
      */
-    public CORBABean(AbstractName abstractName, ConfigAdapter configAdapter, String host,
int listenerPort, ClassLoader classLoader, NameService nameService, SSLConfig ssl) {
+    public CORBABean(AbstractName abstractName, ConfigAdapter configAdapter, String host,
int listenerPort, ClassLoader classLoader, NameService nameService, OpenEjbSystem ejbSystem,
SSLConfig ssl) {
         this.abstractName = abstractName;
         this.classLoader = classLoader;
         this.configAdapter = configAdapter;
@@ -107,6 +109,7 @@
         this.host = host;
         this.listenerPort = listenerPort;
         this.policyOverrides = null; 
+        this.ejbSystem = ejbSystem; 
     }
 
     /**
@@ -234,6 +237,11 @@
             // TSSBeans are going to need our rootPOA instance, so resolve this now.
             org.omg.CORBA.Object obj = orb.resolve_initial_references("RootPOA");
             rootPOA = POAHelper.narrow(obj);
+            // if we have an OpenEjbSystem reference, inform the ejb subsystem 
+            // there's now an ORB available for the JNDI context. 
+            if (ejbSystem != null) {
+                ejbSystem.setORBContext(orb, getHandleDelegate()); 
+            }
         } catch (NoSuchMethodError e) {
             log.error("Incorrect level of org.omg.CORBA classes found.\nLikely cause is an
incorrect java.endorsed.dirs configuration"); 
             throw new InvalidConfigurationException("CORBA usage requires Yoko CORBA spec
classes in java.endorsed.dirs classpath", e); 

Modified: geronimo/server/trunk/modules/geronimo-corba/src/main/java/org/apache/geronimo/corba/CORBABeanGBean.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-corba/src/main/java/org/apache/geronimo/corba/CORBABeanGBean.java?view=diff&rev=521653&r1=521652&r2=521653
==============================================================================
--- geronimo/server/trunk/modules/geronimo-corba/src/main/java/org/apache/geronimo/corba/CORBABeanGBean.java
(original)
+++ geronimo/server/trunk/modules/geronimo-corba/src/main/java/org/apache/geronimo/corba/CORBABeanGBean.java
Fri Mar 23 03:04:59 2007
@@ -27,7 +27,7 @@
 import org.apache.geronimo.corba.security.config.ConfigAdapter;
 import org.apache.geronimo.corba.security.config.ssl.SSLConfig;
 import org.apache.geronimo.corba.security.config.tss.TSSConfig;
-import org.apache.geronimo.openejb.ORBProvider; 
+import org.apache.geronimo.openejb.OpenEjbSystem; 
 import org.omg.CORBA.ORB;
 import org.omg.PortableServer.POA;
 
@@ -57,11 +57,9 @@
         infoBuilder.addReference("ConfigAdapter", ConfigAdapter.class, NameFactory.ORB_CONFIG);
         infoBuilder.addReference("SSLConfig", SSLConfig.class, NameFactory.CORBA_SSL);
         infoBuilder.addReference("NameService", NameService.class, NameFactory.CORBA_NAME_SERVICE);
+        infoBuilder.addReference("OpenEjbSystem", OpenEjbSystem.class);
         
-        // Used by the OpenEjbSystemGBean to obtain ORB information. 
-        infoBuilder.addInterface(ORBProvider.class); 
-
-        infoBuilder.setConstructor(new String[]{"abstractName", "ConfigAdapter", "host",
"port", "classLoader", "NameService", "SSLConfig"});
+        infoBuilder.setConstructor(new String[]{"abstractName", "ConfigAdapter", "host",
"port", "classLoader", "NameService", "OpenEjbSystem", "SSLConfig"});
 
         GBEAN_INFO = infoBuilder.getBeanInfo();
     }

Modified: geronimo/server/trunk/modules/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/OpenEjbSystem.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/OpenEjbSystem.java?view=diff&rev=521653&r1=521652&r2=521653
==============================================================================
--- geronimo/server/trunk/modules/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/OpenEjbSystem.java
(original)
+++ geronimo/server/trunk/modules/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/OpenEjbSystem.java
Fri Mar 23 03:04:59 2007
@@ -18,6 +18,7 @@
 
 import java.io.IOException;
 import java.util.Properties;
+import javax.ejb.spi.HandleDelegate;
 import javax.naming.NamingException;
 
 import org.apache.openejb.Container;
@@ -34,6 +35,8 @@
 import org.apache.openejb.assembler.classic.AppInfo;
 import org.apache.openejb.spi.ContainerSystem;
 
+import org.omg.CORBA.ORB;
+
 /**
  * @version $Rev$ $Date$
  */
@@ -55,4 +58,6 @@
     void removeEjbJar(EjbJarInfo ejbJarInfo, ClassLoader classLoader) throws UndeployException,
NoSuchApplicationException;
 
     AppInfo configureApplication(AppModule appModule) throws OpenEJBException;
+
+    void setORBContext(ORB orb, HandleDelegate handleDelegate);
 }

Modified: geronimo/server/trunk/modules/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/OpenEjbSystemGBean.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/OpenEjbSystemGBean.java?view=diff&rev=521653&r1=521652&r2=521653
==============================================================================
--- geronimo/server/trunk/modules/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/OpenEjbSystemGBean.java
(original)
+++ geronimo/server/trunk/modules/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/OpenEjbSystemGBean.java
Fri Mar 23 03:04:59 2007
@@ -78,14 +78,16 @@
     private final Assembler assembler;
     private final ConcurrentMap<String,ResourceAdapterWrapper> processedResourceAdapterWrappers
=  new ConcurrentHashMap<String,ResourceAdapterWrapper>() ;
     private final ClassLoader classLoader;
-    private final SingleElementCollection orbProvider;                
+    // These are provided by the corba subsystem when it first initializes.  
+    // Once we have a set, we ignore any additional notifications. 
+    private ORB orb; 
+    private HandleDelegate handleDelegate; 
 
     public OpenEjbSystemGBean(TransactionManager transactionManager) throws Exception {
-        this(transactionManager, null, null, null, OpenEjbSystemGBean.class.getClassLoader());
+        this(transactionManager, null, null, OpenEjbSystemGBean.class.getClassLoader());
     }
-    public OpenEjbSystemGBean(TransactionManager transactionManager, Collection<ResourceAdapterWrapper>
resourceAdapters, Collection<ORBProvider> orbProviders, Kernel kernel, ClassLoader classLoader)
throws Exception {
+    public OpenEjbSystemGBean(TransactionManager transactionManager, Collection<ResourceAdapterWrapper>
resourceAdapters, Kernel kernel, ClassLoader classLoader) throws Exception {
         this.classLoader = classLoader;
-        orbProvider = new SingleElementCollection(orbProviders); 
         
         System.setProperty("duct tape","");
         SystemInstance systemInstance = SystemInstance.get();
@@ -132,13 +134,6 @@
         proxyFactoryInfo.properties = new Properties();
         assembler.createProxyFactory(proxyFactoryInfo);
         
-        // install CORBA values 
-        ORBProvider orbSource = (ORBProvider)orbProvider.getElement(); 
-        if (orbSource != null) {
-            SystemInstance.get().setComponent(ORB.class, orbSource.getORB());
-            SystemInstance.get().setComponent(HandleDelegate.class, orbSource.getHandleDelegate());
-        }
-
         // add our thread context listener
         GeronimoThreadContextListener.init();
 
@@ -323,19 +318,27 @@
         return getContainerSystem().getDeploymentInfo(deploymentId);
     }
 
+    public void setORBContext(ORB orb, HandleDelegate handleDelegate) {
+        // this is only processed once, since these are global values. 
+        if (this.orb == null) {
+            this.orb = orb; 
+            this.handleDelegate = handleDelegate; 
+            SystemInstance.get().setComponent(ORB.class, orb);
+            SystemInstance.get().setComponent(HandleDelegate.class, handleDelegate);
+        }
+    }
+
     public static final GBeanInfo GBEAN_INFO;
 
     static {
         GBeanInfoBuilder infoBuilder = GBeanInfoBuilder.createStatic(OpenEjbSystemGBean.class);
         infoBuilder.addReference("TransactionManager", TransactionManager.class);
         infoBuilder.addReference("ResourceAdapterWrappers", ResourceAdapterWrapper.class);
-        infoBuilder.addReference("ORBProviders", ORBProvider.class, NameFactory.CORBA_SERVICE);
         infoBuilder.addAttribute("kernel", Kernel.class, false);
         infoBuilder.addAttribute("classLoader", ClassLoader.class, false);
         infoBuilder.setConstructor(new String[] {
                 "TransactionManager",
                 "ResourceAdapterWrappers",
-                "ORBProviders",
                 "kernel",
                 "classLoader",
         });



Mime
View raw message