geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r945814 - in /geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment: ApplicationInfo.java EARConfigBuilder.java annotation/AnnotatedEAR.java
Date Tue, 18 May 2010 18:48:43 GMT
Author: djencks
Date: Tue May 18 18:48:43 2010
New Revision: 945814

URL: http://svn.apache.org/viewvc?rev=945814&view=rev
Log:
GERONIMO-5221 Link up jndi entries for Validator and ValidatorFactory to the ones at java:comp/Validator(Factory)

Added:
    geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/annotation/AnnotatedEAR.java
      - copied, changed from r943316, geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/annotation/AnnotatedWebApp.java
Modified:
    geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/ApplicationInfo.java
    geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder.java

Modified: geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/ApplicationInfo.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/ApplicationInfo.java?rev=945814&r1=945813&r2=945814&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/ApplicationInfo.java
(original)
+++ geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/ApplicationInfo.java
Tue May 18 18:48:43 2010
@@ -19,6 +19,7 @@ package org.apache.geronimo.j2ee.deploym
 import java.util.LinkedHashSet;
 import java.util.jar.JarFile;
 
+import org.apache.geronimo.j2ee.deployment.annotation.AnnotatedApp;
 import org.apache.geronimo.kernel.config.ConfigurationModuleType;
 import org.apache.geronimo.kernel.repository.Environment;
 import org.apache.geronimo.gbean.AbstractName;
@@ -35,17 +36,18 @@ public class ApplicationInfo extends Mod
     private LinkedHashSet<Module> modules;
     private ModuleList moduleLocations;
 
-    public ApplicationInfo(ConfigurationModuleType type, 
-                           Environment environment, 
-                           AbstractName baseName, 
-                           String name, 
-                           JarFile earFile, 
-                           XmlObject specDD, 
-                           XmlObject vendorDD, 
-                           LinkedHashSet<Module> modules, 
-                           ModuleList moduleLocations, 
-                           String originalSpecDD) {
-        super(true, baseName, name, environment, earFile, "", specDD, vendorDD, originalSpecDD,
null, null);
+    public ApplicationInfo(ConfigurationModuleType type,
+                           Environment environment,
+                           AbstractName baseName,
+                           String name,
+                           JarFile earFile,
+                           XmlObject specDD,
+                           XmlObject vendorDD,
+                           LinkedHashSet<Module> modules,
+                           ModuleList moduleLocations,
+                           String originalSpecDD,
+                           AnnotatedApp annotatedApp) {
+        super(true, baseName, name, environment, earFile, "", specDD, vendorDD, originalSpecDD,
null, annotatedApp);
         assert type != null;
         assert environment != null;
         assert modules != null;

Modified: geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder.java?rev=945814&r1=945813&r2=945814&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder.java
(original)
+++ geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder.java
Tue May 18 18:48:43 2010
@@ -64,6 +64,8 @@ import org.apache.geronimo.gbean.annotat
 import org.apache.geronimo.gbean.annotation.ParamReference;
 import org.apache.geronimo.gbean.annotation.ParamSpecial;
 import org.apache.geronimo.gbean.annotation.SpecialAttributeType;
+import org.apache.geronimo.j2ee.deployment.annotation.AnnotatedApp;
+import org.apache.geronimo.j2ee.deployment.annotation.AnnotatedEAR;
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
 import org.apache.geronimo.j2ee.jndi.ApplicationJndi;
 import org.apache.geronimo.j2ee.jndi.JndiKey;
@@ -133,6 +135,7 @@ public class EARConfigBuilder implements
     private final SingleElementCollection resourceReferenceBuilder;
     private final NamespaceDrivenBuilderCollection serviceBuilders;
     private final Collection<ModuleBuilderExtension> persistenceUnitBuilders;
+    private final NamingBuilder namingBuilders;
 
     private final Environment defaultEnvironment;
     private final AbstractNameQuery serverName;
@@ -164,15 +167,16 @@ public class EARConfigBuilder implements
                             @ParamAttribute(name = "corbaGBeanAbstractName") AbstractNameQuery
corbaGBeanAbstractName,
                             @ParamAttribute(name = "globalContextAbstractName") AbstractNameQuery
globalContextAbstractName,
                             @ParamAttribute(name = "serverName") AbstractNameQuery serverName,
-                            @ParamReference(name = "Repositories", namingType = "Repository")Collection<?
extends Repository> repositories,
-                            @ParamReference(name = "EJBConfigBuilder", namingType = NameFactory.MODULE_BUILDER)Collection<ModuleBuilder>
ejbConfigBuilder,
-                            @ParamReference(name = "WebConfigBuilder", namingType = NameFactory.MODULE_BUILDER)Collection<ModuleBuilder>
webConfigBuilder,
-                            @ParamReference(name = "ConnectorConfigBuilder", namingType =
NameFactory.MODULE_BUILDER)Collection<ModuleBuilder> connectorConfigBuilder,
-                            @ParamReference(name = "ActivationSpecInfoLocator", namingType
= NameFactory.MODULE_BUILDER)Collection<ModuleBuilder> resourceReferenceBuilder,
-                            @ParamReference(name = "AppClientConfigBuilder", namingType =
NameFactory.MODULE_BUILDER)Collection<ModuleBuilder> appClientConfigBuilder,
-                            @ParamReference(name = "ServiceBuilders", namingType = NameFactory.MODULE_BUILDER)Collection<NamespaceDrivenBuilder>
serviceBuilders,
-                            @ParamReference(name = "PersistenceUnitBuilders", namingType
= NameFactory.MODULE_BUILDER)Collection<ModuleBuilderExtension> persistenceUnitBuilders,
-                            @ParamReference(name = "ArtifactResolvers", namingType = "ArtifactResolver")Collection<?
extends ArtifactResolver> artifactResolvers,
+                            @ParamReference(name = "Repositories", namingType = "Repository")
Collection<? extends Repository> repositories,
+                            @ParamReference(name = "EJBConfigBuilder", namingType = NameFactory.MODULE_BUILDER)
Collection<ModuleBuilder> ejbConfigBuilder,
+                            @ParamReference(name = "WebConfigBuilder", namingType = NameFactory.MODULE_BUILDER)
Collection<ModuleBuilder> webConfigBuilder,
+                            @ParamReference(name = "ConnectorConfigBuilder", namingType =
NameFactory.MODULE_BUILDER) Collection<ModuleBuilder> connectorConfigBuilder,
+                            @ParamReference(name = "ActivationSpecInfoLocator", namingType
= NameFactory.MODULE_BUILDER) Collection<ModuleBuilder> resourceReferenceBuilder,
+                            @ParamReference(name = "AppClientConfigBuilder", namingType =
NameFactory.MODULE_BUILDER) Collection<ModuleBuilder> appClientConfigBuilder,
+                            @ParamReference(name = "ServiceBuilders", namingType = NameFactory.MODULE_BUILDER)
Collection<NamespaceDrivenBuilder> serviceBuilders,
+                            @ParamReference(name = "PersistenceUnitBuilders", namingType
= NameFactory.MODULE_BUILDER) Collection<ModuleBuilderExtension> persistenceUnitBuilders,
+                            @ParamReference(name = "NamingBuilders", namingType = NameFactory.MODULE_BUILDER)
NamingBuilder namingBuilders,
+                            @ParamReference(name = "ArtifactResolvers", namingType = "ArtifactResolver")
Collection<? extends ArtifactResolver> artifactResolvers,
                             @ParamSpecial(type = SpecialAttributeType.kernel) Kernel kernel,
                             @ParamSpecial(type = SpecialAttributeType.bundleContext) BundleContext
bundleContext) throws GBeanNotFoundException {
         this(defaultEnvironment,
@@ -190,7 +194,9 @@ public class EARConfigBuilder implements
                 new SingleElementCollection<ModuleBuilder>(appClientConfigBuilder),
                 serviceBuilders,
                 persistenceUnitBuilders,
-                kernel.getNaming(), artifactResolvers,
+                namingBuilders,
+                kernel.getNaming(),
+                artifactResolvers,
                 bundleContext);
     }
 
@@ -208,6 +214,7 @@ public class EARConfigBuilder implements
                             ModuleBuilder appClientConfigBuilder,
                             NamespaceDrivenBuilder serviceBuilder,
                             ModuleBuilderExtension persistenceUnitBuilder,
+                            NamingBuilder namingBuilders,
                             Naming naming,
                             Collection<? extends ArtifactResolver> artifactResolvers,
BundleContext bundleContext) {
         this(defaultEnvironment,
@@ -225,6 +232,7 @@ public class EARConfigBuilder implements
                 new SingleElementCollection<ModuleBuilder>(appClientConfigBuilder),
                 serviceBuilder == null ? Collections.<NamespaceDrivenBuilder>emptySet()
: Collections.singleton(serviceBuilder),
                 persistenceUnitBuilder == null ? Collections.<ModuleBuilderExtension>emptySet()
: Collections.singleton(persistenceUnitBuilder),
+                namingBuilders,
                 naming,
                 artifactResolvers,
                 bundleContext);
@@ -245,6 +253,7 @@ public class EARConfigBuilder implements
                              SingleElementCollection appClientConfigBuilder,
                              Collection<NamespaceDrivenBuilder> serviceBuilders,
                              Collection<ModuleBuilderExtension> persistenceUnitBuilders,
+                             NamingBuilder namingBuilders,
                              Naming naming,
                              Collection<? extends ArtifactResolver> artifactResolvers,
                              BundleContext bundleContext) {
@@ -259,6 +268,7 @@ public class EARConfigBuilder implements
         this.appClientConfigBuilder = appClientConfigBuilder;
         this.serviceBuilders = new NamespaceDrivenBuilderCollection(serviceBuilders);
         this.persistenceUnitBuilders = persistenceUnitBuilders;
+        this.namingBuilders = namingBuilders;
 
         this.transactionManagerObjectName = transactionManagerAbstractName;
         this.connectionTrackerObjectName = connectionTrackerAbstractName;
@@ -346,6 +356,7 @@ public class EARConfigBuilder implements
                 null,
                 new LinkedHashSet<Module>(Collections.singleton(module)),
                 new ModuleList(),
+                null,
                 null);
     }
 
@@ -407,6 +418,7 @@ public class EARConfigBuilder implements
 
         Artifact artifact = environment.getConfigId();
         AbstractName earName = naming.createRootName(artifact, artifact.toString(), NameFactory.J2EE_APPLICATION);
+        namingBuilders.buildEnvironment(application, gerApplication, environment);
 
         // get the modules either the application plan or for a stand alone module from the
specific deployer
         // todo change module so you can extract the real module path back out.. then we
can eliminate
@@ -437,13 +449,13 @@ public class EARConfigBuilder implements
 
         String applicationName = null;
         if (application != null && application.isSetApplicationName()) {
-            applicationName = application.getApplicationName().getStringValue().trim(); 
          
+            applicationName = application.getApplicationName().getStringValue().trim();
         } else if (earFile != null) {
             applicationName = FileUtils.removeExtension(new File(earFile.getName()).getName(),
".ear");
         } else {
             applicationName = artifact.toString();
         }
-        
+        AnnotatedApp annotatedApp = new AnnotatedEAR(application);
         return new ApplicationInfo(ConfigurationModuleType.EAR,
                 environment,
                 earName,
@@ -453,7 +465,8 @@ public class EARConfigBuilder implements
                 gerApplication,
                 modules,
                 moduleLocations,
-                application == null ? null : application.toString());
+                application == null ? null : application.toString(),
+                annotatedApp);
     }
 
 
@@ -615,9 +628,12 @@ public class EARConfigBuilder implements
             Map<String, Object> app = new HashMap<String, Object>();
             app.put("app/AppName", applicationInfo.getName());
             contexts.put(JndiScope.app, app);
-            
+
             // give each module a chance to populate the earContext now that a classloader
is available
             Bundle bundle = earContext.getDeploymentBundle();
+            if (ConfigurationModuleType.EAR == applicationType) {
+                namingBuilders.initContext(applicationInfo.getSpecDD(), applicationInfo.getVendorDD(),
applicationInfo);
+            }
             for (Module module : applicationInfo.getModules()) {
                 if (createPlanMode.get()) {
                     try {
@@ -673,6 +689,8 @@ public class EARConfigBuilder implements
                 gbeanData.setReferencePatterns("ResourceAdapterModules", new ReferencePatterns(new
AbstractNameQuery(null, thisApp, org.apache.geronimo.management.geronimo.ResourceAdapterModule.class.getName())));
                 gbeanData.setReferencePatterns("WebModules", new ReferencePatterns(new AbstractNameQuery(null,
thisApp, org.apache.geronimo.management.geronimo.WebModule.class.getName())));
                 earContext.addGBean(gbeanData);
+
+                namingBuilders.buildNaming(applicationInfo.getSpecDD(), applicationInfo.getVendorDD(),
applicationInfo, earContext.getGeneralData());
             }
 
             AbstractName appJndiName = naming.createChildName(earContext.getModuleName(),
"ApplicationJndi", "ApplicationJndi");
@@ -695,7 +713,7 @@ public class EARConfigBuilder implements
                 EARConfigBuilder.appInfo.set(applicationInfo);
                 throw new DeploymentException();
             }
-            
+
             GBeanData appContexts = new GBeanData(appJndiName, ApplicationJndi.class);
             appContexts.setAttribute("globalContextSegment", contexts.get(JndiScope.global));
             appContexts.setAttribute("applicationContextMap", contexts.get(JndiScope.app));

Copied: geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/annotation/AnnotatedEAR.java
(from r943316, geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/annotation/AnnotatedWebApp.java)
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/annotation/AnnotatedEAR.java?p2=geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/annotation/AnnotatedEAR.java&p1=geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/annotation/AnnotatedWebApp.java&r1=943316&r2=945814&rev=945814&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/annotation/AnnotatedWebApp.java
(original)
+++ geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/annotation/AnnotatedEAR.java
Tue May 18 18:48:43 2010
@@ -17,11 +17,7 @@
 
 package org.apache.geronimo.j2ee.deployment.annotation;
 
-import java.util.ArrayList;
-import java.util.List;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import org.apache.geronimo.xbeans.javaee6.ApplicationType;
 import org.apache.geronimo.xbeans.javaee6.DataSourceType;
 import org.apache.geronimo.xbeans.javaee6.EjbLocalRefType;
 import org.apache.geronimo.xbeans.javaee6.EjbRefType;
@@ -33,7 +29,11 @@ import org.apache.geronimo.xbeans.javaee
 import org.apache.geronimo.xbeans.javaee6.ResourceEnvRefType;
 import org.apache.geronimo.xbeans.javaee6.ResourceRefType;
 import org.apache.geronimo.xbeans.javaee6.ServiceRefType;
-import org.apache.geronimo.xbeans.javaee6.WebAppType;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.ArrayList;
+import java.util.List;
 
 /**
  * Wrapper class to encapsulate the WebAppType class with an interface that the various
@@ -47,20 +47,20 @@ import org.apache.geronimo.xbeans.javaee
  * @version $Rev $Date
  * @since Geronimo 2.0
  */
-public class AnnotatedWebApp implements AnnotatedApp {
-    private static final Logger log = LoggerFactory.getLogger(AnnotatedWebApp.class);
-    private WebAppType webApp;
+public class AnnotatedEAR implements AnnotatedApp {
+    private static final Logger log = LoggerFactory.getLogger(AnnotatedEAR.class);
+    private ApplicationType app;
 
     // Protected instance variables
     protected List<EjbRefType> ambiguousEjbRefs;
 
     /**
-     * WebAppType-qualified constructor
+     * ApplicationType-qualified constructor
      *
-     * @param webApp WebAppType
+     * @param app ApplicationType
      */
-    public AnnotatedWebApp(WebAppType webApp) {
-        this.webApp = webApp;
+    public AnnotatedEAR(ApplicationType app) {
+        this.app = app;
     }
 
 
@@ -68,19 +68,19 @@ public class AnnotatedWebApp implements 
      * WebAppType methods used for the @EJB, @EJBs annotations
      */
     public EjbLocalRefType[] getEjbLocalRefArray() {
-        return webApp.getEjbLocalRefArray();
+        return app.getEjbLocalRefArray();
     }
 
     public EjbLocalRefType addNewEjbLocalRef() {
-        return webApp.addNewEjbLocalRef();
+        return app.addNewEjbLocalRef();
     }
 
     public EjbRefType[] getEjbRefArray() {
-        return webApp.getEjbRefArray();
+        return app.getEjbRefArray();
     }
 
     public EjbRefType addNewEjbRef() {
-        return webApp.addNewEjbRef();
+        return app.addNewEjbRef();
     }
 
 
@@ -88,43 +88,43 @@ public class AnnotatedWebApp implements 
      * WebAppType methods used for the @Resource, @Resources annotations
      */
     public EnvEntryType[] getEnvEntryArray() {
-        return webApp.getEnvEntryArray();
+        return app.getEnvEntryArray();
     }
 
     public EnvEntryType addNewEnvEntry() {
-        return webApp.addNewEnvEntry();
+        return app.addNewEnvEntry();
     }
 
     public ServiceRefType[] getServiceRefArray() {
-        return webApp.getServiceRefArray();
+        return app.getServiceRefArray();
     }
 
     public ServiceRefType addNewServiceRef() {
-        return webApp.addNewServiceRef();
+        return app.addNewServiceRef();
     }
 
     public ResourceRefType[] getResourceRefArray() {
-        return webApp.getResourceRefArray();
+        return app.getResourceRefArray();
     }
 
     public ResourceRefType addNewResourceRef() {
-        return webApp.addNewResourceRef();
+        return app.addNewResourceRef();
     }
 
     public MessageDestinationRefType[] getMessageDestinationRefArray() {
-        return webApp.getMessageDestinationRefArray();
+        return app.getMessageDestinationRefArray();
     }
 
     public MessageDestinationRefType addNewMessageDestinationRef() {
-        return webApp.addNewMessageDestinationRef();
+        return app.addNewMessageDestinationRef();
     }
 
     public ResourceEnvRefType[] getResourceEnvRefArray() {
-        return webApp.getResourceEnvRefArray();
+        return app.getResourceEnvRefArray();
     }
 
     public ResourceEnvRefType addNewResourceEnvRef() {
-        return webApp.addNewResourceEnvRef();
+        return app.addNewResourceEnvRef();
     }
 
 
@@ -134,17 +134,17 @@ public class AnnotatedWebApp implements 
      * @return String representation of webApp
      */
     public String toString() {
-        return webApp.toString();
+        return app.toString();
     }
 
 
     /**
      * webApp getter
      *
-     * @return webApp WebAppType
+     * @return webApp ApplicationType
      */
-    public WebAppType getWebApp() {
-        return webApp;
+    public ApplicationType getApp() {
+        return app;
     }
 
 
@@ -166,46 +166,50 @@ public class AnnotatedWebApp implements 
     }
 
     public LifecycleCallbackType[] getPostConstructArray() {
-        return webApp.getPostConstructArray();
+        return null;
+//        return app.getPostConstructArray();
     }
 
     public LifecycleCallbackType addPostConstruct() {
-        return webApp.addNewPostConstruct();
+        return null;
+//        return app.addNewPostConstruct();
     }
 
     public LifecycleCallbackType[] getPreDestroyArray() {
-        return webApp.getPreDestroyArray();
+        return null;
+//        return app.getPreDestroyArray();
     }
 
     public LifecycleCallbackType addPreDestroy() {
-        return webApp.addNewPreDestroy();
+        return null;
+//        return app.addNewPreDestroy();
     }
 
     public PersistenceContextRefType[] getPersistenceContextRefArray() {
-        return webApp.getPersistenceContextRefArray();
+        return app.getPersistenceContextRefArray();
     }
 
     public PersistenceContextRefType addNewPersistenceContextRef() {
-        return webApp.addNewPersistenceContextRef();
+        return app.addNewPersistenceContextRef();
     }
 
     public PersistenceUnitRefType[] getPersistenceUnitRefArray() {
-        return webApp.getPersistenceUnitRefArray();
+        return app.getPersistenceUnitRefArray();
     }
 
     public PersistenceUnitRefType addNewPersistenceUnitRef() {
-        return webApp.addNewPersistenceUnitRef();
+        return app.addNewPersistenceUnitRef();
     }
 
     public DataSourceType[] getDataSourceArray() {
-        return webApp.getDataSourceArray();
+        return app.getDataSourceArray();
     }
-    
+
     public DataSourceType addNewDataSource() {
-        return webApp.addNewDataSource();
+        return app.addNewDataSource();
     }
-    
+
     public String getComponentType() {
         return null;
     }
-}
+}
\ No newline at end of file



Mime
View raw message