geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ga...@apache.org
Subject svn commit: r934164 - in /geronimo/server/trunk/plugins: client/client-deployer/src/main/plan/ client/geronimo-client-builder/src/main/java/org/apache/geronimo/client/builder/ j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deploy...
Date Wed, 14 Apr 2010 19:57:58 GMT
Author: gawor
Date: Wed Apr 14 19:57:58 2010
New Revision: 934164

URL: http://svn.apache.org/viewvc?rev=934164&view=rev
Log:
GERONIMO-5253: Bind module name into JNDI (java:module/ModuleName). Also, some app client
fixes

Modified:
    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/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/AbstractWebModuleBuilder.java
    geronimo/server/trunk/plugins/openejb/geronimo-openejb-builder/src/main/java/org/apache/geronimo/openejb/deployment/EjbModuleBuilder.java

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=934164&r1=934163&r2=934164&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 Apr 14
19:57:58 2010
@@ -99,12 +99,14 @@
                         <artifactId>webservices-common</artifactId>
                         <type>car</type>
                     </dependency>
+<!--
                     <dependency>
                         <groupId>${pom.groupId}</groupId>
                         <artifactId>axis</artifactId>
                         <type>car</type>
                         <import>classes</import>
                     </dependency>
+-->
                 </dependencies>
             </environment>
         </xml-attribute>

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=934164&r1=934163&r2=934164&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 Apr 14 19:57:58 2010
@@ -68,6 +68,7 @@ import org.apache.geronimo.j2ee.deployme
 import org.apache.geronimo.j2ee.deployment.annotation.AnnotatedApplicationClient;
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
 import org.apache.geronimo.j2ee.jndi.JndiKey;
+import org.apache.geronimo.j2ee.jndi.JndiScope;
 import org.apache.geronimo.j2ee.management.impl.J2EEAppClientModuleImpl;
 import org.apache.geronimo.kernel.GBeanAlreadyExistsException;
 import org.apache.geronimo.kernel.Naming;
@@ -233,7 +234,7 @@ public class AppClientModuleBuilder impl
     }
 
     public Module createModule(File plan, JarFile moduleFile, Naming naming, ModuleIDBuilder
idBuilder) throws DeploymentException {
-        return createModule(plan, moduleFile, "app-client", null, null, null, naming, idBuilder);
+        return createModule(plan, moduleFile, "app-client.jar", null, null, null, naming,
idBuilder);
     }
 
     public Module createModule(Object plan, JarFile moduleFile, String targetPath, URL specDDUrl,
Environment environment, Object moduleContextInfo, AbstractName earName, Naming naming, ModuleIDBuilder
idBuilder) throws DeploymentException {
@@ -707,6 +708,7 @@ public class AppClientModuleBuilder impl
                     }
                     Map<JndiKey, Map<String, Object>> contexts = NamingBuilder.JNDI_KEY.get(earContext.getGeneralData());
                     Map<JndiKey, Map<String, Object>> clientContexts = new HashMap<JndiKey,
Map<String, Object>>(contexts);
+                    getJndiContext(clientContexts, JndiScope.module).put("module/ModuleName",
module.getName());
                     buildingContext.put(NamingBuilder.JNDI_KEY, clientContexts);
                     namingBuilders.buildNaming(appClient, geronimoAppClient, appClientModule,
buildingContext);
 
@@ -805,7 +807,15 @@ public class AppClientModuleBuilder impl
         }
     }
 
-
+    private static Map<String, Object> getJndiContext(Map<JndiKey, Map<String,
Object>> contexts, JndiScope scope) {
+        Map<String, Object> context = contexts.get(scope);
+        if (context == null) {
+            context = new HashMap<String, Object>();
+            contexts.put(scope, context);
+        }
+        return context;
+    }
+    
     private ClassFinder createAppClientClassFinder(ApplicationClientType appClient, AppClientModule
appClientModule) throws DeploymentException {
 
         //------------------------------------------------------------------------------------

Modified: geronimo/server/trunk/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/AbstractWebModuleBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/AbstractWebModuleBuilder.java?rev=934164&r1=934163&r2=934164&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/AbstractWebModuleBuilder.java
(original)
+++ geronimo/server/trunk/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/AbstractWebModuleBuilder.java
Wed Apr 14 19:57:58 2010
@@ -763,6 +763,7 @@ public abstract class AbstractWebModuleB
         buildingContext.put(NamingBuilder.GBEAN_NAME_KEY, moduleContext.getModuleName());
         //get partial jndi context from earContext.
         Map<JndiKey, Map<String, Object>> jndiContext = new HashMap<JndiKey,
Map<String, Object>>(NamingBuilder.JNDI_KEY.get(earContext.getGeneralData()));
+        getJndiContext(jndiContext, JndiScope.module).put("module/ModuleName", webModule.getName());
         buildingContext.put(NamingBuilder.JNDI_KEY, jndiContext);
         if (!webApp.getMetadataComplete()) {
             // Create a classfinder and populate it for the naming builder(s). The absence
of a
@@ -815,6 +816,15 @@ public abstract class AbstractWebModuleB
         webModuleData.setAttribute("modulePath", webModule.isStandAlone() || webModule.getEarContext()
!= webModule.getRootEarContext() ? null : webModule.getTargetPath());
     }
 
+    private static Map<String, Object> getJndiContext(Map<JndiKey, Map<String,
Object>> contexts, JndiScope scope) {
+        Map<String, Object> context = contexts.get(scope);
+        if (context == null) {
+            context = new HashMap<String, Object>();
+            contexts.put(scope, context);
+        }
+        return context;
+    }
+    
     private static class InternWrapper implements XMLStreamReader {
 
         private final XMLStreamReader delegate;

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=934164&r1=934163&r2=934164&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 Apr 14 19:57:58 2010
@@ -759,11 +759,11 @@ public class EjbModuleBuilder implements
 
         // add enc
         Map<JndiKey, Map<String, Object>> jndiContext = NamingBuilder.JNDI_KEY.get(earContext.getGeneralData());
+        getJndiContext(jndiContext, JndiScope.module).put("module/ModuleName", module.getName());
       
         ejbModule.getSharedContext().put(NamingBuilder.JNDI_KEY, jndiContext);
         ejbDeploymentBuilder.buildEnc();
         Map<String, Object> moduleContext = jndiContext.remove(JndiScope.module);
 
-
         Set<GBeanData> gBeanDatas = earContext.getConfiguration().findGBeanDatas(Collections.singleton(new
AbstractNameQuery(PersistenceUnitGBean.class.getName())));
         LinkResolver<String> linkResolver = new UniqueDefaultLinkResolver<String>();
         for (GBeanData gBeanData : gBeanDatas) {
@@ -830,6 +830,15 @@ public class EjbModuleBuilder implements
         }
     }
 
+    private static Map<String, Object> getJndiContext(Map<JndiKey, Map<String,
Object>> contexts, JndiScope scope) {
+        Map<String, Object> context = contexts.get(scope);
+        if (context == null) {
+            context = new HashMap<String, Object>();
+            contexts.put(scope, context);
+        }
+        return context;
+    }
+    
     private void setMdbContainerIds(EARContext earContext, EjbModule ejbModule, GBeanData
ejbModuleGBeanData) throws DeploymentException {
         Object altDD = ejbModule.getEjbModule().getAltDDs().get("openejb-jar.xml");
         if (!(altDD instanceof OpenejbJarType)) {



Mime
View raw message