geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From genspr...@apache.org
Subject svn commit: r1135938 - in /geronimo/server/trunk: framework/modules/geronimo-naming/src/main/java/org/apache/geronimo/naming/java/ plugins/client/client-deployer/ plugins/client/client-deployer/src/main/plan/ plugins/client/geronimo-client-builder/src/...
Date Wed, 15 Jun 2011 07:01:23 GMT
Author: genspring
Date: Wed Jun 15 07:01:22 2011
New Revision: 1135938

URL: http://svn.apache.org/viewvc?rev=1135938&view=rev
Log:
GERONIMO-6008 use openejb remote jndi system in client container to do global jndi lookup.

see OPENEJB-1596 for openejb side changes.

Modified:
    geronimo/server/trunk/framework/modules/geronimo-naming/src/main/java/org/apache/geronimo/naming/java/RootContext.java
    geronimo/server/trunk/plugins/client/client-deployer/pom.xml
    geronimo/server/trunk/plugins/client/client-deployer/src/main/plan/plan.xml
    geronimo/server/trunk/plugins/client/geronimo-client-builder/src/main/java/org/apache/geronimo/client/builder/AppClientModuleBuilder.java
    geronimo/server/trunk/plugins/client/geronimo-client-builder/src/test/java/org/apache/geronimo/client/builder/PlanParsingTest.java
    geronimo/server/trunk/plugins/client/geronimo-client/src/main/java/org/apache/geronimo/client/StaticJndiContextPlugin.java
    geronimo/server/trunk/plugins/openejb/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbModuleBuilder.java
    geronimo/server/trunk/plugins/openejb/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbRefBuilder.java
    geronimo/server/trunk/plugins/openejb/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/GeronimoEjbInfo.java
    geronimo/server/trunk/plugins/openejb/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/MEJBGBean.java
    geronimo/server/trunk/plugins/openejb/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/XBeanJndiFactory.java

Modified: geronimo/server/trunk/framework/modules/geronimo-naming/src/main/java/org/apache/geronimo/naming/java/RootContext.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-naming/src/main/java/org/apache/geronimo/naming/java/RootContext.java?rev=1135938&r1=1135937&r2=1135938&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-naming/src/main/java/org/apache/geronimo/naming/java/RootContext.java
(original)
+++ geronimo/server/trunk/framework/modules/geronimo-naming/src/main/java/org/apache/geronimo/naming/java/RootContext.java
Wed Jun 15 07:01:22 2011
@@ -17,9 +17,13 @@
 
 package org.apache.geronimo.naming.java;
 
+import java.net.URI;
+import java.net.URISyntaxException;
 import java.util.Collections;
+import java.util.Properties;
 
 import javax.naming.Context;
+import javax.naming.InitialContext;
 import javax.naming.Name;
 import javax.naming.NameNotFoundException;
 import javax.naming.NamingException;
@@ -35,6 +39,8 @@ import org.apache.xbean.naming.context.I
  */
 public class RootContext extends ImmutableContext {
     private static InheritableThreadLocal<Context> compContext = new InheritableThreadLocal<Context>();
+    
+    private static InheritableThreadLocal<URI> openejbRemoteContextURI = new InheritableThreadLocal<URI>();
 
     public RootContext() throws NamingException {
         super(Collections.<String, Object>emptyMap());
@@ -52,20 +58,31 @@ public class RootContext extends Immutab
                 return compCtx;
             }
             name = name.charAt(5) == '/'? name.substring(6): name.substring(5);
-            return compCtx.lookup(name);
+            
+            try {
+                return compCtx.lookup(name);
+            } catch (NamingException e1) {
+
+                if (openejbRemoteContextURI.get() != null && (name.startsWith("global/")
|| name.startsWith("app/"))) {
+
+                    Properties p = new Properties();
+                    p.put("java.naming.factory.initial", "org.apache.openejb.client.RemoteInitialContextFactory");
+                    p.put("java.naming.provider.url", openejbRemoteContextURI.get().toString());
+                    p.put("openejb.client.moduleId", "openejb/global");
+
+                    try {
+                        InitialContext ctx = new InitialContext(p);
+                        Object value = ctx.lookup(name);
+                        return value;
+                    } catch (NamingException e2) {
+                        throw (NameNotFoundException) new NameNotFoundException().initCause(e2);
+                    }
+                } else {
 
+                    throw e1;
+                }
+            }
 
-//            if ("comp".equals(name)) {
-//                return compCtx;
-//            } else if (name.startsWith("comp/")) {
-//                return compCtx.lookup(name.substring(5));
-//            } else if ("/comp".equals(name)) {
-//                return compCtx;
-//            } else if (name.startsWith("/comp/")) {
-//                return compCtx.lookup(name.substring(6));
-//            } else {
-//                throw new NameNotFoundException("Unrecognized name, does not start with
expected 'comp': " + name);
-//            }
         }
         return super.lookup(name);
     }
@@ -83,6 +100,16 @@ public class RootContext extends Immutab
     public static void setComponentContext(Context ctx) {
         compContext.set(ctx);
     }
+    
+    /**
+     * Set the remote Context uri, app client 
+     * need to set this to utilize the openejb remote
+     * jndi system to do fallback global jndi lookup.
+     * @param uri
+     */
+    public static void setOpenejbRemoteContextURI(URI uri) {
+      openejbRemoteContextURI.set(uri);
+    }    
 
     /**
      * Get the component context for the current thread.

Modified: geronimo/server/trunk/plugins/client/client-deployer/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/client/client-deployer/pom.xml?rev=1135938&r1=1135937&r2=1135938&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/client/client-deployer/pom.xml (original)
+++ geronimo/server/trunk/plugins/client/client-deployer/pom.xml Wed Jun 15 07:01:22 2011
@@ -114,8 +114,18 @@
                     </dependencies>
                     <instance>
                         <plugin-artifact>
-                            <config-xml-content server="default" />
-                            <config-xml-content server="offline" />
+                            <config-xml-content server="default">
+                               <gbean name="AppClientBuilder">
+                                    <attribute name="host">${ServerHostname}</attribute>
+                                    <attribute name="port">${OpenEJBPort + PortOffset}</attribute>
+                                </gbean>
+                            </config-xml-content>
+                            <config-xml-content server="offline" >
+                                <gbean name="AppClientBuilder">
+                                    <attribute name="host">${ServerHostname}</attribute>
+                                    <attribute name="port">${OpenEJBPort + PortOffset}</attribute>
+                                </gbean>
+                            </config-xml-content>
                             <copy-file dest-dir="schema">schema/schemaorg_apache_xmlbeans/src/</copy-file>
                         </plugin-artifact>
                     </instance>

Modified: geronimo/server/trunk/plugins/client/client-deployer/src/main/plan/plan.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/client/client-deployer/src/main/plan/plan.xml?rev=1135938&r1=1135937&r2=1135938&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/client/client-deployer/src/main/plan/plan.xml (original)
+++ geronimo/server/trunk/plugins/client/client-deployer/src/main/plan/plan.xml Wed Jun 15
07:01:22 2011
@@ -123,6 +123,8 @@
                 </dependencies>
             </environment>
         </xml-attribute>
+        <attribute name="host">localhost</attribute>
+        <attribute name="port">4201</attribute>
     </gbean>
 
     <gbean name="ClientArtifactResolver" class="org.apache.geronimo.client.builder.OptionalExplicitDefaultArtifactResolver">

Modified: geronimo/server/trunk/plugins/client/geronimo-client-builder/src/main/java/org/apache/geronimo/client/builder/AppClientModuleBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/client/geronimo-client-builder/src/main/java/org/apache/geronimo/client/builder/AppClientModuleBuilder.java?rev=1135938&r1=1135937&r2=1135938&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/client/geronimo-client-builder/src/main/java/org/apache/geronimo/client/builder/AppClientModuleBuilder.java
(original)
+++ geronimo/server/trunk/plugins/client/geronimo-client-builder/src/main/java/org/apache/geronimo/client/builder/AppClientModuleBuilder.java
Wed Jun 15 07:01:22 2011
@@ -30,7 +30,6 @@ import java.util.HashMap;
 import java.util.LinkedList;
 import java.util.List;
 import java.util.Map;
-import java.util.Set;
 import java.util.StringTokenizer;
 import java.util.jar.Attributes;
 import java.util.jar.JarEntry;
@@ -131,6 +130,7 @@ public class AppClientModuleBuilder impl
     private final Collection<Repository> repositories;
 
     private final ArtifactResolver clientArtifactResolver;
+    private final URI uri;
 
     public AppClientModuleBuilder(Environment defaultClientEnvironment,
                                   Environment defaultServerEnvironment,
@@ -143,7 +143,9 @@ public class AppClientModuleBuilder impl
                                   NamespaceDrivenBuilder serviceBuilder,
                                   Collection<NamingBuilder> namingBuilders,
                                   Collection<ModuleBuilderExtension> moduleBuilderExtensions,
-                                  ArtifactResolver clientArtifactResolver) {
+                                  ArtifactResolver clientArtifactResolver,
+                                  String host,
+                                  int port) throws URISyntaxException{
         this(defaultClientEnvironment,
                 defaultServerEnvironment,
                 transactionManagerObjectName,
@@ -153,7 +155,9 @@ public class AppClientModuleBuilder impl
                 serviceBuilder == null ? Collections.<NamespaceDrivenBuilder>emptySet()
: Collections.singleton(serviceBuilder),
                 namingBuilders == null ? Collections.<NamingBuilder>emptySet() : namingBuilders,
                 moduleBuilderExtensions,
-                clientArtifactResolver);
+                clientArtifactResolver,
+                host,
+                port);
     }
 
     public AppClientModuleBuilder(AbstractNameQuery transactionManagerObjectName,
@@ -167,8 +171,9 @@ public class AppClientModuleBuilder impl
                                   Collection<ModuleBuilderExtension> moduleBuilderExtensions,
                                   ArtifactResolver clientArtifactResolver,
                                   Environment defaultClientEnvironment,
-                                  Environment defaultServerEnvironment
-    ) {
+                                  Environment defaultServerEnvironment,
+                                  String host,
+                                  int port) throws URISyntaxException{
         this(defaultClientEnvironment,
                 defaultServerEnvironment,
                 transactionManagerObjectName,
@@ -179,7 +184,9 @@ public class AppClientModuleBuilder impl
                 serviceBuilder,
                 namingBuilders,
                 moduleBuilderExtensions,
-                clientArtifactResolver);
+                clientArtifactResolver,
+                host,
+                port);
     }
 
     private AppClientModuleBuilder(Environment defaultClientEnvironment,
@@ -193,7 +200,9 @@ public class AppClientModuleBuilder impl
                                    Collection<NamespaceDrivenBuilder> serviceBuilder,
                                    Collection<NamingBuilder> namingBuilders,
                                    Collection<ModuleBuilderExtension> moduleBuilderExtensions,
-                                   ArtifactResolver clientArtifactResolver) {
+                                   ArtifactResolver clientArtifactResolver,
+                                   String host,
+                                   int port) throws URISyntaxException {
         this.defaultClientEnvironment = defaultClientEnvironment;
         this.defaultServerEnvironment = defaultServerEnvironment;
         this.corbaGBeanObjectName = corbaGBeanObjectName;
@@ -206,6 +215,11 @@ public class AppClientModuleBuilder impl
         this.namingBuilders = new NamingBuilderCollection(namingBuilders);
         this.moduleBuilderExtensions = moduleBuilderExtensions;
         this.clientArtifactResolver = clientArtifactResolver;
+        if (host != null) {
+            uri = new URI("ejbd", null, host, port, null, null, null);
+        } else {
+            uri = null;
+        }
     }
 
     @Override
@@ -745,6 +759,7 @@ public class AppClientModuleBuilder impl
                 //TODO track resource ref shared and app managed security
                 AbstractName jndiContextName = earContext.getNaming().createChildName(appClientDeploymentContext.getModuleName(),
"StaticJndiContext", "StaticJndiContext");
                 GBeanData jndiContextGBeanData = new GBeanData(jndiContextName, StaticJndiContextPlugin.class);
+                jndiContextGBeanData.setAttribute("uri", uri);
                 try {
                     Map<EARContext.Key, Object> buildingContext = new HashMap<EARContext.Key,
Object>();
                     buildingContext.put(NamingBuilder.GBEAN_NAME_KEY, jndiContextName);
@@ -1038,6 +1053,8 @@ public class AppClientModuleBuilder impl
         infoBuilder.addReference("NamingBuilders", NamingBuilder.class, NameFactory.MODULE_BUILDER);
         infoBuilder.addReference("ModuleBuilderExtensions", ModuleBuilderExtension.class,
NameFactory.MODULE_BUILDER);
         infoBuilder.addReference("ClientArtifactResolver", ArtifactResolver.class, "ArtifactResolver");
+        infoBuilder.addAttribute("host", String.class, true);
+        infoBuilder.addAttribute("port", int.class, true);
 
         infoBuilder.addInterface(ModuleBuilder.class);
 
@@ -1053,6 +1070,8 @@ public class AppClientModuleBuilder impl
                 "ClientArtifactResolver",
                 "defaultClientEnvironment",
                 "defaultServerEnvironment",
+                "host",
+                "port"
         });
 
         GBEAN_INFO = infoBuilder.getBeanInfo();

Modified: geronimo/server/trunk/plugins/client/geronimo-client-builder/src/test/java/org/apache/geronimo/client/builder/PlanParsingTest.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/client/geronimo-client-builder/src/test/java/org/apache/geronimo/client/builder/PlanParsingTest.java?rev=1135938&r1=1135937&r2=1135938&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/client/geronimo-client-builder/src/test/java/org/apache/geronimo/client/builder/PlanParsingTest.java
(original)
+++ geronimo/server/trunk/plugins/client/geronimo-client-builder/src/test/java/org/apache/geronimo/client/builder/PlanParsingTest.java
Wed Jun 15 07:01:22 2011
@@ -41,7 +41,7 @@ public class PlanParsingTest extends Tes
 
     protected void setUp() throws Exception {
         super.setUp();
-        builder = new AppClientModuleBuilder(new Environment(), null, null, null, null, null,
Collections.<Repository>emptyList(), null, null, null, Collections.<ModuleBuilderExtension>emptyList(),
clientArtifactResolver);
+        builder = new AppClientModuleBuilder(new Environment(), null, null, null, null, null,
Collections.<Repository>emptyList(), null, null, null, Collections.<ModuleBuilderExtension>emptyList(),
clientArtifactResolver,"localhost",4021);
         builder.doStart();
     }
 

Modified: geronimo/server/trunk/plugins/client/geronimo-client/src/main/java/org/apache/geronimo/client/StaticJndiContextPlugin.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/client/geronimo-client/src/main/java/org/apache/geronimo/client/StaticJndiContextPlugin.java?rev=1135938&r1=1135937&r2=1135938&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/client/geronimo-client/src/main/java/org/apache/geronimo/client/StaticJndiContextPlugin.java
(original)
+++ geronimo/server/trunk/plugins/client/geronimo-client/src/main/java/org/apache/geronimo/client/StaticJndiContextPlugin.java
Wed Jun 15 07:01:22 2011
@@ -16,6 +16,7 @@
  */
 package org.apache.geronimo.client;
 
+import java.net.URI;
 import java.util.HashMap;
 import java.util.Map;
 
@@ -38,12 +39,13 @@ import org.osgi.framework.Bundle;
 public class StaticJndiContextPlugin implements AppClientPlugin {
     private final Context context;
 
-    public StaticJndiContextPlugin(Map<JndiKey, Map<String, Object>> contexts,
Kernel kernel, ClassLoader classLoader, Bundle bundle) throws NamingException {
+    public StaticJndiContextPlugin(Map<JndiKey, Map<String, Object>> contexts,
Kernel kernel, ClassLoader classLoader, Bundle bundle, URI uri) throws NamingException {
         //TODO this does not include global entries from other apps.
         Map<String, Object> clientContext = new HashMap<String, Object>();
         for (Map<String, Object> context: contexts.values()) {
             clientContext.putAll(context);
         }
+        RootContext.setOpenejbRemoteContextURI(uri);
         this.context = EnterpriseNamingContext.livenReferences(clientContext, null, kernel,
classLoader, bundle, "comp/");
     }
 
@@ -70,9 +72,10 @@ public class StaticJndiContextPlugin imp
         infoFactory.addAttribute("kernel", Kernel.class, false);
         infoFactory.addAttribute("classLoader", ClassLoader.class, false);
         infoFactory.addAttribute("bundle", Bundle.class, false);
+        infoFactory.addAttribute("uri", URI.class, false);
         infoFactory.addInterface(AppClientPlugin.class);
 
-        infoFactory.setConstructor(new String[]{"context", "kernel", "classLoader", "bundle"});
+        infoFactory.setConstructor(new String[]{"context", "kernel", "classLoader", "bundle",
"uri"});
 
         GBEAN_INFO = infoFactory.getBeanInfo();
     }

Modified: geronimo/server/trunk/plugins/openejb/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbModuleBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/openejb/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbModuleBuilder.java?rev=1135938&r1=1135937&r2=1135938&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/openejb/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbModuleBuilder.java
(original)
+++ geronimo/server/trunk/plugins/openejb/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbModuleBuilder.java
Wed Jun 15 07:01:22 2011
@@ -841,6 +841,11 @@ public class EjbModuleBuilder implements
                 module.setClassLoader(bundleLoader);
                 appModule.getEjbModules().add(module.getEjbModule());
             }
+            
+            if(!ejbModule.isStandAlone())
+            {
+               appModule.setModuleId(ejbModule.getParentModule().getName());
+            }
 
             // build the config info tree
             // this method fills in the ejbJar jaxb tree based on the annotations
@@ -867,7 +872,7 @@ public class EjbModuleBuilder implements
 
             // add all of the modules to the ear data
             for (EjbJarInfo ejbJar : appInfo.ejbJars) {
-                GeronimoEjbInfo ejbInfo = new GeronimoEjbInfo(ejbJar, appInfo.globalJndiEnc,
appInfo.appJndiEnc);
+                GeronimoEjbInfo ejbInfo = new GeronimoEjbInfo(ejbJar, appInfo.globalJndiEnc,
appInfo.appJndiEnc, appInfo.appId);
                 earData.addEjbInfo(ejbInfo);
             }
 

Modified: geronimo/server/trunk/plugins/openejb/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbRefBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/openejb/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbRefBuilder.java?rev=1135938&r1=1135937&r2=1135938&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/openejb/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbRefBuilder.java
(original)
+++ geronimo/server/trunk/plugins/openejb/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbRefBuilder.java
Wed Jun 15 07:01:22 2011
@@ -27,15 +27,13 @@ import java.util.Collections;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
-import java.util.Set;
-import java.util.TreeSet;
+import java.util.Map.Entry;
 
 import org.apache.geronimo.common.DeploymentException;
 import org.apache.geronimo.gbean.GBeanInfo;
 import org.apache.geronimo.gbean.GBeanInfoBuilder;
 import org.apache.geronimo.j2ee.deployment.EARContext;
 import org.apache.geronimo.j2ee.deployment.Module;
-import org.apache.geronimo.j2ee.deployment.NamingBuilder;
 import org.apache.geronimo.j2ee.deployment.annotation.EJBAnnotationHelper;
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
 import org.apache.geronimo.j2ee.jndi.JndiKey;
@@ -51,7 +49,6 @@ import org.apache.geronimo.xbeans.geroni
 import org.apache.geronimo.xbeans.geronimo.naming.GerPatternType;
 import org.apache.openejb.OpenEJBException;
 import org.apache.openejb.assembler.classic.AppInfo;
-import org.apache.openejb.assembler.classic.EjbJarInfo;
 import org.apache.openejb.assembler.classic.JndiEncBuilder;
 import org.apache.openejb.assembler.classic.JndiEncInfo;
 import org.apache.openejb.config.JndiEncInfoBuilder;
@@ -199,6 +196,32 @@ public class EjbRefBuilder extends Abstr
                 }
             }
         }
+        
+        if (uri != null) {
+            
+           /* Map<String, Object> appclientAppContext = new HashMap<String, Object>();
+            Map<String, Object> sharedAppScopeContext = module.getJndiScope(JndiScope.app);
+            for (Entry<String, Object> entry : sharedAppScopeContext.entrySet()) {
+                appclientAppContext.put(entry.getKey(), createClientRef(entry.getValue()));
+            }
+            module.getJndiContext().put(JndiScope.app, appclientAppContext);
+
+            Map<String, Object> appclientGlobalContext = new HashMap<String, Object>();
+            Map<String, Object> sharedGlobalScopeContext = module.getJndiScope(JndiScope.global);
+            for (Entry<String, Object> entry : sharedGlobalScopeContext.entrySet())
{
+                appclientGlobalContext.put(entry.getKey(), createClientRef(entry.getValue()));
+            }
+            module.getJndiContext().put(JndiScope.global, appclientGlobalContext);*/
+            
+            
+            Map<String, Object> appclientModuleContext = new HashMap<String, Object>();
+            Map<String, Object> sharedModuleScopeContext = module.getJndiScope(JndiScope.module);
+            for (Entry<String, Object> entry : sharedModuleScopeContext.entrySet())
{
+                appclientModuleContext.put(entry.getKey(), createClientRef(entry.getValue()));
+            }
+            module.getJndiContext().put(JndiScope.module, appclientModuleContext);
+
+        }
     }
     
     /*
@@ -236,10 +259,12 @@ public class EjbRefBuilder extends Abstr
 
         Object valueToConvert = null;
 
-        if (moduleJndiContext.get(JndiScope.app).containsKey(name)) {
+/*        if (moduleJndiContext.get(JndiScope.app).containsKey(name)) {
             valueToConvert = moduleJndiContext.get(JndiScope.app).get(name);
         } else if (moduleJndiContext.get(JndiScope.global).containsKey(name)) {
             valueToConvert = moduleJndiContext.get(JndiScope.global).get(name);
+        } else */if (moduleJndiContext.get(JndiScope.module).containsKey(name)) {
+            valueToConvert = moduleJndiContext.get(JndiScope.module).get(name);
         } else {
             return;
         }

Modified: geronimo/server/trunk/plugins/openejb/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/GeronimoEjbInfo.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/openejb/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/GeronimoEjbInfo.java?rev=1135938&r1=1135937&r2=1135938&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/openejb/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/GeronimoEjbInfo.java
(original)
+++ geronimo/server/trunk/plugins/openejb/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/GeronimoEjbInfo.java
Wed Jun 15 07:01:22 2011
@@ -27,15 +27,17 @@ public class GeronimoEjbInfo implements 
     private final EjbJarInfo ejbJarInfo;
     private final JndiEncInfo globalJndiEnc;
     private final JndiEncInfo appJndiEnc;
+    private final String appId;
 
-    public GeronimoEjbInfo(EjbJarInfo ejbJarInfo) {
-        this(ejbJarInfo, new JndiEncInfo(), new JndiEncInfo());
+    public GeronimoEjbInfo(EjbJarInfo ejbJarInfo, String appId) {
+        this(ejbJarInfo, new JndiEncInfo(), new JndiEncInfo(), appId);
     }
 
-    public GeronimoEjbInfo(EjbJarInfo ejbJarInfo, JndiEncInfo globalJndiEnc, JndiEncInfo
appJndiEnc) {
+    public GeronimoEjbInfo(EjbJarInfo ejbJarInfo, JndiEncInfo globalJndiEnc, JndiEncInfo
appJndiEnc, String appId) {
         this.ejbJarInfo = ejbJarInfo;
         this.globalJndiEnc = globalJndiEnc;
         this.appJndiEnc = appJndiEnc;
+        this.appId = appId;
     }
 
     public EjbJarInfo getEjbJarInfo() {
@@ -46,7 +48,7 @@ public class GeronimoEjbInfo implements 
         AppInfo appInfo = new AppInfo();
         appInfo.path = ejbJarInfo.path;
         appInfo.ejbJars.add(ejbJarInfo);
-        appInfo.appId = ejbJarInfo.moduleId;
+        appInfo.appId = appId == null ? "" : appId;
         merge(appInfo.appJndiEnc, appJndiEnc);
         merge(appInfo.globalJndiEnc, globalJndiEnc);
         return appInfo;

Modified: geronimo/server/trunk/plugins/openejb/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/MEJBGBean.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/openejb/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/MEJBGBean.java?rev=1135938&r1=1135937&r2=1135938&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/openejb/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/MEJBGBean.java
(original)
+++ geronimo/server/trunk/plugins/openejb/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/MEJBGBean.java
Wed Jun 15 07:01:22 2011
@@ -47,7 +47,7 @@ public class MEJBGBean implements GBeanL
         OpenEjbSystem openEjbSystem = ejbContainer.getOpenEjbSystem();
         //A dummy URL MEJBGBean.class.getResource( "" ).toString() to avoid the "java.net.MalformedURLException:
no protocol: MEJBGBean" when startup
         EjbJarInfo ejbJarInfo = openEjbSystem.configureApplication(new EjbModule(cl, getClass().getSimpleName(),
MEJBGBean.class.getResource( "" ).toString(), ejbJar, null));
-        GeronimoEjbInfo ejbInfo = new GeronimoEjbInfo(ejbJarInfo);
+        GeronimoEjbInfo ejbInfo = new GeronimoEjbInfo(ejbJarInfo, null);
         openEjbSystem.createApplication(ejbInfo.createAppInfo(), cl);
 	}
 

Modified: geronimo/server/trunk/plugins/openejb/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/XBeanJndiFactory.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/openejb/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/XBeanJndiFactory.java?rev=1135938&r1=1135937&r2=1135938&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/openejb/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/XBeanJndiFactory.java
(original)
+++ geronimo/server/trunk/plugins/openejb/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/XBeanJndiFactory.java
Wed Jun 15 07:01:22 2011
@@ -46,6 +46,7 @@ public class XBeanJndiFactory implements
         rootContext.createSubcontext("remote");
         rootContext.createSubcontext("client");
         rootContext.createSubcontext("Deployment");
+        rootContext.createSubcontext("global");
     }
 
     @Override



Mime
View raw message