geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rickmcgu...@apache.org
Subject svn commit: r520925 - in /geronimo/server/trunk: configs/client-corba-yoko/ 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 Wed, 21 Mar 2007 16:03:21 GMT
Author: rickmcguire
Date: Wed Mar 21 09:03:20 2007
New Revision: 520925

URL: http://svn.apache.org/viewvc?view=rev&rev=520925
Log:
GERONIMO-3001 Geronimo needs to inject into the openejb3 system context the server ORB and
HandleDelegate instances.


Modified:
    geronimo/server/trunk/configs/client-corba-yoko/pom.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/OpenEjbSystemGBean.java

Modified: geronimo/server/trunk/configs/client-corba-yoko/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/configs/client-corba-yoko/pom.xml?view=diff&rev=520925&r1=520924&r2=520925
==============================================================================
--- geronimo/server/trunk/configs/client-corba-yoko/pom.xml (original)
+++ geronimo/server/trunk/configs/client-corba-yoko/pom.xml Wed Mar 21 09:03:20 2007
@@ -42,6 +42,12 @@
             <version>${version}</version>
             <type>car</type>
         </dependency>
+            
+        <dependency>
+            <groupId>org.apache.geronimo.modules</groupId>
+            <artifactId>geronimo-openejb</artifactId>
+            <version>${version}</version>
+        </dependency>
 
         <dependency>
             <groupId>org.apache.geronimo.configs</groupId>

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=520925&r1=520924&r2=520925
==============================================================================
--- geronimo/server/trunk/configs/openejb/src/plan/plan.xml (original)
+++ geronimo/server/trunk/configs/openejb/src/plan/plan.xml Wed Mar 21 09:03:20 2007
@@ -25,6 +25,7 @@
             <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=520925&r1=520924&r2=520925
==============================================================================
--- 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
Wed Mar 21 09:03:20 2007
@@ -33,6 +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.omg.CORBA.ORB;
 import org.omg.CORBA.Policy;
 import org.omg.PortableServer.POA;
@@ -49,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, ORBConfiguration {
+public class CORBABean implements GBeanLifecycle, ORBRef, ORBProvider, ORBConfiguration {
     private final Log log = LogFactory.getLog(CORBABean.class);
 
     private final ClassLoader classLoader;

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=520925&r1=520924&r2=520925
==============================================================================
--- 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
Wed Mar 21 09:03:20 2007
@@ -27,6 +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.omg.CORBA.ORB;
 import org.omg.PortableServer.POA;
 
@@ -56,6 +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);
+        
+        // Used by the OpenEjbSystemGBean to obtain ORB information. 
+        infoBuilder.addInterface(ORBProvider.class); 
 
         infoBuilder.setConstructor(new String[]{"abstractName", "ConfigAdapter", "host",
"port", "classLoader", "NameService", "SSLConfig"});
 

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=520925&r1=520924&r2=520925
==============================================================================
--- 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
Wed Mar 21 09:03:20 2007
@@ -16,6 +16,19 @@
  */
 package org.apache.geronimo.openejb;
 
+import java.io.IOException;
+import java.util.Collection;
+import java.util.Map;
+import java.util.Properties;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.ConcurrentMap;
+
+import javax.ejb.spi.HandleDelegate;
+import javax.management.ObjectName;
+import javax.naming.NamingException;
+import javax.resource.spi.ResourceAdapter;
+import javax.transaction.TransactionManager;
+
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.geronimo.connector.ResourceAdapterWrapper;
@@ -23,8 +36,9 @@
 import org.apache.geronimo.gbean.GBeanInfo;
 import org.apache.geronimo.gbean.GBeanInfoBuilder;
 import org.apache.geronimo.gbean.ReferenceCollection;
-import org.apache.geronimo.gbean.ReferenceCollectionListener;
 import org.apache.geronimo.gbean.ReferenceCollectionEvent;
+import org.apache.geronimo.gbean.ReferenceCollectionListener;
+import org.apache.geronimo.gbean.SingleElementCollection;
 import org.apache.geronimo.kernel.GBeanNotFoundException;
 import org.apache.geronimo.kernel.Kernel;
 import org.apache.openejb.Container;
@@ -52,16 +66,7 @@
 import org.apache.openejb.spi.ContainerSystem;
 import org.apache.openejb.util.proxy.Jdk13ProxyFactory;
 
-import javax.naming.NamingException;
-import javax.resource.spi.ResourceAdapter;
-import javax.transaction.TransactionManager;
-import javax.management.ObjectName;
-import java.io.IOException;
-import java.util.Collection;
-import java.util.Map;
-import java.util.Properties;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.ConcurrentMap;
+import org.omg.CORBA.ORB;
 
 /**
  * @version $Rev$ $Date$
@@ -72,12 +77,15 @@
     private final Assembler assembler;
     private final ConcurrentMap<String,ResourceAdapterWrapper> processedResourceAdapterWrappers
=  new ConcurrentHashMap<String,ResourceAdapterWrapper>() ;
     private final ClassLoader classLoader;
+    private final SingleElementCollection orbProvider;                
 
     public OpenEjbSystemGBean(TransactionManager transactionManager) throws Exception {
-        this(transactionManager, null, null, OpenEjbSystemGBean.class.getClassLoader());
+        this(transactionManager, null, null, null, OpenEjbSystemGBean.class.getClassLoader());
     }
-    public OpenEjbSystemGBean(TransactionManager transactionManager, Collection<ResourceAdapterWrapper>
resourceAdapters, Kernel kernel, ClassLoader classLoader) throws Exception {
+    public OpenEjbSystemGBean(TransactionManager transactionManager, Collection<ResourceAdapterWrapper>
resourceAdapters, Collection<ORBProvider> orbProviders, Kernel kernel, ClassLoader classLoader)
throws Exception {
         this.classLoader = classLoader;
+        orbProvider = new SingleElementCollection(orbProviders); 
+        
         System.setProperty("duct tape","");
         SystemInstance systemInstance = SystemInstance.get();
 
@@ -122,6 +130,13 @@
         proxyFactoryInfo.className = Jdk13ProxyFactory.class.getName();
         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();
@@ -313,11 +328,13 @@
         GBeanInfoBuilder infoBuilder = GBeanInfoBuilder.createStatic(OpenEjbSystemGBean.class);
         infoBuilder.addReference("TransactionManager", TransactionManager.class);
         infoBuilder.addReference("ResourceAdapterWrappers", ResourceAdapterWrapper.class);
+        infoBuilder.addReference("ORBProviders", ORBProvider.class);
         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