geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From genspr...@apache.org
Subject svn commit: r1127758 - /geronimo/server/trunk/plugins/openejb/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbDeploymentBuilder.java
Date Thu, 26 May 2011 02:23:05 GMT
Author: genspring
Date: Thu May 26 02:23:05 2011
New Revision: 1127758

URL: http://svn.apache.org/viewvc?rev=1127758&view=rev
Log:
To add the AppName in the ejb's global JNDI name only when the ejb module is part of an ear.

Modified:
    geronimo/server/trunk/plugins/openejb/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbDeploymentBuilder.java

Modified: geronimo/server/trunk/plugins/openejb/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbDeploymentBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/openejb/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbDeploymentBuilder.java?rev=1127758&r1=1127757&r2=1127758&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/openejb/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbDeploymentBuilder.java
(original)
+++ geronimo/server/trunk/plugins/openejb/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbDeploymentBuilder.java
Thu May 26 02:23:05 2011
@@ -38,9 +38,11 @@ import org.apache.geronimo.connector.out
 import org.apache.geronimo.gbean.AbstractName;
 import org.apache.geronimo.gbean.AbstractNameQuery;
 import org.apache.geronimo.gbean.GBeanData;
+import org.apache.geronimo.j2ee.deployment.ApplicationInfo;
 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.WebModule;
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
 import org.apache.geronimo.j2ee.jndi.JndiKey;
 import org.apache.geronimo.j2ee.jndi.JndiScope;
@@ -388,7 +390,20 @@ public class EjbDeploymentBuilder {
             // classFinder in the module will convey whether metadata-complete is set (or
not)
 //            ejbModule.setClassFinder(createEjbJarClassFinder(ejbModule));
         }
-        String appName = (String)ejbModule.getJndiScope(JndiScope.app).get("app/AppName");
+        
+        String appName = null;
+        
+        Module parentModule = ejbModule.getParentModule();
+
+        while (parentModule != null) {
+            // only when the ejb module is part of ear, add the AppName in the ejb's global
JNDI name.
+            if (parentModule instanceof ApplicationInfo) {
+                appName = (String) ejbModule.getJndiScope(JndiScope.app).get("app/AppName");
+                break;
+            }
+            parentModule = parentModule.getParentModule();
+        }
+        
         EjbJarInfo ejbJarInfo = ejbModule.getEjbInfo().getEjbJarInfo();
         for (EnterpriseBean bean : ejbJar.getEnterpriseBeans()) {
             String ejbName = bean.getEjbName();



Mime
View raw message