geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r516226 - in /geronimo/server/trunk/modules: geronimo-jetty6-builder/src/main/java/org/apache/geronimo/jetty6/deployment/ geronimo-jetty6-builder/src/test/java/org/apache/geronimo/jetty6/deployment/ geronimo-tomcat6-builder/src/main/java/or...
Date Thu, 08 Mar 2007 23:31:26 GMT
Author: djencks
Date: Thu Mar  8 15:31:23 2007
New Revision: 516226

URL: http://svn.apache.org/viewvc?view=rev&rev=516226
Log:
GERONIMO-2943 add ModuleBuilderExtensions to web module builders

Modified:
    geronimo/server/trunk/modules/geronimo-jetty6-builder/src/main/java/org/apache/geronimo/jetty6/deployment/JettyModuleBuilder.java
    geronimo/server/trunk/modules/geronimo-jetty6-builder/src/test/java/org/apache/geronimo/jetty6/deployment/JettyModuleBuilderTest.java
    geronimo/server/trunk/modules/geronimo-jetty6-builder/src/test/java/org/apache/geronimo/jetty6/deployment/PlanParsingTest.java
    geronimo/server/trunk/modules/geronimo-tomcat6-builder/src/main/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilder.java
    geronimo/server/trunk/modules/geronimo-tomcat6-builder/src/test/java/org/apache/geronimo/tomcat/deployment/PlanParsingTest.java
    geronimo/server/trunk/modules/geronimo-tomcat6-builder/src/test/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilderTest.java
    geronimo/server/trunk/modules/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/AbstractWebModuleBuilder.java
    geronimo/server/trunk/modules/geronimo-web-2.5-builder/src/test/java/org/apache/geronimo/web25/deployment/SchemaConversionTest.java
    geronimo/server/trunk/modules/geronimo-web-2.5-builder/src/test/java/org/apache/geronimo/web25/deployment/SecurityConfigTest.java
    geronimo/server/trunk/modules/geronimo-web-2.5-builder/src/test/java/org/apache/geronimo/web25/deployment/SpecSecurityParsingTest.java

Modified: geronimo/server/trunk/modules/geronimo-jetty6-builder/src/main/java/org/apache/geronimo/jetty6/deployment/JettyModuleBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-jetty6-builder/src/main/java/org/apache/geronimo/jetty6/deployment/JettyModuleBuilder.java?view=diff&rev=516226&r1=516225&r2=516226
==============================================================================
--- geronimo/server/trunk/modules/geronimo-jetty6-builder/src/main/java/org/apache/geronimo/jetty6/deployment/JettyModuleBuilder.java
(original)
+++ geronimo/server/trunk/modules/geronimo-jetty6-builder/src/main/java/org/apache/geronimo/jetty6/deployment/JettyModuleBuilder.java
Thu Mar  8 15:31:23 2007
@@ -64,6 +64,7 @@
 import org.apache.geronimo.j2ee.deployment.NamingBuilder;
 import org.apache.geronimo.j2ee.deployment.WebModule;
 import org.apache.geronimo.j2ee.deployment.WebServiceBuilder;
+import org.apache.geronimo.j2ee.deployment.ModuleBuilderExtension;
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
 import org.apache.geronimo.j2ee.annotation.Holder;
 import org.apache.geronimo.jetty6.Host;
@@ -152,9 +153,10 @@
             Collection securityBuilders,
             Collection serviceBuilders,
             NamingBuilder namingBuilders,
+            Collection<ModuleBuilderExtension> moduleBuilderExtensions,
             ResourceEnvironmentSetter resourceEnvironmentSetter,
             Kernel kernel) throws GBeanNotFoundException {
-        super(kernel, securityBuilders, serviceBuilders, namingBuilders, resourceEnvironmentSetter,
webServiceBuilder);
+        super(kernel, securityBuilders, serviceBuilders, namingBuilders, resourceEnvironmentSetter,
webServiceBuilder, moduleBuilderExtensions);
         this.defaultEnvironment = defaultEnvironment;
         this.defaultSessionTimeoutSeconds = (defaultSessionTimeoutSeconds == null) ? new
Integer(30 * 60) : defaultSessionTimeoutSeconds;
         this.jettyContainerObjectName = jettyContainerName;
@@ -255,7 +257,12 @@
         // Create the AnnotatedApp interface for the WebModule
         AnnotatedWebApp annotatedWebApp = new AnnotatedWebApp(webApp);
 
-        return new WebModule(standAlone, moduleName, environment, moduleFile, targetPath,
webApp, jettyWebApp, specDD, contextRoot, new HashMap(), JETTY_NAMESPACE, annotatedWebApp);
+        WebModule module = new WebModule(standAlone, moduleName, environment, moduleFile,
targetPath, webApp, jettyWebApp, specDD, contextRoot, new HashMap(), JETTY_NAMESPACE, annotatedWebApp);
+
+        for (ModuleBuilderExtension mbe: moduleBuilderExtensions) {
+            mbe.createModule(module, plan, moduleFile, targetPath, specDDUrl, environment,
contextRoot, earName, naming, idBuilder);
+        }
+        return module;
     }
 
     JettyWebAppType getJettyWebApp(Object plan, JarFile moduleFile, boolean standAlone, String
targetPath, WebAppType webApp) throws DeploymentException {
@@ -309,10 +316,12 @@
     }
 
     public void initContext(EARContext earContext, Module module, ClassLoader cl) throws
DeploymentException {
-        WebAppType webApp = (WebAppType) module.getSpecDD();
         JettyWebAppType gerWebApp = (JettyWebAppType) module.getVendorDD();
         boolean hasSecurityRealmName = gerWebApp.isSetSecurityRealmName();
         buildSubstitutionGroups(gerWebApp, hasSecurityRealmName, module, earContext);
+        for (ModuleBuilderExtension mbe: moduleBuilderExtensions) {
+            mbe.initContext(earContext, module, cl);
+        }
     }
 
     public void addGBeans(EARContext earContext, Module module, ClassLoader cl, Collection
repository) throws DeploymentException {
@@ -510,6 +519,11 @@
         } catch (Exception e) {
             throw new DeploymentException("Unable to initialize webapp GBean for " + module.getName(),
e);
         }
+
+        //TODO this may definitely not be the best place for this!
+        for (ModuleBuilderExtension mbe: moduleBuilderExtensions) {
+            mbe.addGBeans(earContext, module, cl, repository);
+        }
     }
 
     private void configureNoClustering(EARContext moduleContext, GBeanData webModuleData)
throws GBeanAlreadyExistsException {
@@ -1047,6 +1061,7 @@
         infoBuilder.addReference("SecurityBuilders", NamespaceDrivenBuilder.class, NameFactory.MODULE_BUILDER);
         infoBuilder.addReference("ServiceBuilders", NamespaceDrivenBuilder.class, NameFactory.MODULE_BUILDER);
         infoBuilder.addReference("NamingBuilders", NamingBuilder.class, NameFactory.MODULE_BUILDER);
+        infoBuilder.addReference("ModuleBuilderExtensions", ModuleBuilderExtension.class,
NameFactory.MODULE_BUILDER);
         infoBuilder.addReference("ResourceEnvironmentSetter", ResourceEnvironmentSetter.class,
NameFactory.MODULE_BUILDER);
         infoBuilder.addAttribute("kernel", Kernel.class, false);
         infoBuilder.addInterface(ModuleBuilder.class);
@@ -1066,6 +1081,7 @@
                 "SecurityBuilders",
                 "ServiceBuilders",
                 "NamingBuilders",
+                "ModuleBuilderExtensions",
                 "ResourceEnvironmentSetter",
                 "kernel"});
         GBEAN_INFO = infoBuilder.getBeanInfo();

Modified: geronimo/server/trunk/modules/geronimo-jetty6-builder/src/test/java/org/apache/geronimo/jetty6/deployment/JettyModuleBuilderTest.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-jetty6-builder/src/test/java/org/apache/geronimo/jetty6/deployment/JettyModuleBuilderTest.java?view=diff&rev=516226&r1=516225&r2=516226
==============================================================================
--- geronimo/server/trunk/modules/geronimo-jetty6-builder/src/test/java/org/apache/geronimo/jetty6/deployment/JettyModuleBuilderTest.java
(original)
+++ geronimo/server/trunk/modules/geronimo-jetty6-builder/src/test/java/org/apache/geronimo/jetty6/deployment/JettyModuleBuilderTest.java
Thu Mar  8 15:31:23 2007
@@ -27,6 +27,7 @@
 import java.util.Iterator;
 import java.util.Map;
 import java.util.Set;
+import java.util.ArrayList;
 
 import org.apache.geronimo.testsupport.TestSupport;
 
@@ -46,6 +47,7 @@
 import org.apache.geronimo.j2ee.deployment.UnavailableWebServiceBuilder;
 import org.apache.geronimo.j2ee.deployment.WebServiceBuilder;
 import org.apache.geronimo.j2ee.deployment.NamingBuilderCollection;
+import org.apache.geronimo.j2ee.deployment.ModuleBuilderExtension;
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
 import org.apache.geronimo.j2ee.management.impl.J2EEServerImpl;
 import org.apache.geronimo.jetty6.JettyContainerImpl;
@@ -265,6 +267,7 @@
 
         defaultEnvironment.addDependency(baseId, ImportType.ALL);
         defaultEnvironment.setConfigId(webModuleArtifact);
+        Collection<ModuleBuilderExtension> moduleBuilderExtensions = new ArrayList<ModuleBuilderExtension>();
         builder = new JettyModuleBuilder(defaultEnvironment,
                 new Integer(1800),
                 Collections.EMPTY_LIST,
@@ -278,6 +281,7 @@
                 Collections.singleton(new GeronimoSecurityBuilderImpl()),
                 Collections.singleton(new GBeanBuilder(null, null)),
                 new NamingBuilderCollection(null, null),
+                moduleBuilderExtensions,
                 new MockResourceEnvironmentSetter(),
                 kernel);
     }

Modified: geronimo/server/trunk/modules/geronimo-jetty6-builder/src/test/java/org/apache/geronimo/jetty6/deployment/PlanParsingTest.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-jetty6-builder/src/test/java/org/apache/geronimo/jetty6/deployment/PlanParsingTest.java?view=diff&rev=516226&r1=516225&r2=516226
==============================================================================
--- geronimo/server/trunk/modules/geronimo-jetty6-builder/src/test/java/org/apache/geronimo/jetty6/deployment/PlanParsingTest.java
(original)
+++ geronimo/server/trunk/modules/geronimo-jetty6-builder/src/test/java/org/apache/geronimo/jetty6/deployment/PlanParsingTest.java
Thu Mar  8 15:31:23 2007
@@ -79,6 +79,7 @@
                 Collections.singleton(new GeronimoSecurityBuilderImpl()),
                 Collections.singleton(new GBeanBuilder(null, null)),
                 new NamingBuilderCollection(null, null),
+                null,
                 new MockResourceEnvironmentSetter(),
                 null);
     }

Modified: geronimo/server/trunk/modules/geronimo-tomcat6-builder/src/main/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-tomcat6-builder/src/main/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilder.java?view=diff&rev=516226&r1=516225&r2=516226
==============================================================================
--- geronimo/server/trunk/modules/geronimo-tomcat6-builder/src/main/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilder.java
(original)
+++ geronimo/server/trunk/modules/geronimo-tomcat6-builder/src/main/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilder.java
Thu Mar  8 15:31:23 2007
@@ -22,7 +22,6 @@
 import java.io.IOException;
 import java.io.FileWriter;
 import java.net.URL;
-import java.net.MalformedURLException;
 import java.security.Permission;
 import java.security.PermissionCollection;
 import java.security.Permissions;
@@ -59,6 +58,7 @@
 import org.apache.geronimo.j2ee.deployment.NamingBuilder;
 import org.apache.geronimo.j2ee.deployment.WebModule;
 import org.apache.geronimo.j2ee.deployment.WebServiceBuilder;
+import org.apache.geronimo.j2ee.deployment.ModuleBuilderExtension;
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
 import org.apache.geronimo.kernel.Kernel;
 import org.apache.geronimo.kernel.Naming;
@@ -84,13 +84,9 @@
 import org.apache.geronimo.xbeans.javaee.ServletType;
 import org.apache.geronimo.xbeans.javaee.WebAppDocument;
 import org.apache.geronimo.xbeans.javaee.WebAppType;
-import org.apache.geronimo.xbeans.javaee.ServletMappingType;
-import org.apache.geronimo.xbeans.javaee.impl.WebAppDocumentImpl;
-import org.apache.xbean.finder.ClassFinder;
 import org.apache.xmlbeans.XmlException;
 import org.apache.xmlbeans.XmlObject;
 import org.apache.xmlbeans.XmlOptions;
-import org.apache.xmlbeans.XmlCursor;
 
 /**
  * @version $Rev:385659 $ $Date$
@@ -105,14 +101,15 @@
     private static final String TOMCAT_NAMESPACE = TomcatWebAppDocument.type.getDocumentElementName().getNamespaceURI();
 
     public TomcatModuleBuilder(Environment defaultEnvironment,
-                               AbstractNameQuery tomcatContainerName,
-                               Collection webServiceBuilder,
-                               Collection securityBuilders,
-                               Collection serviceBuilders,
-                               NamingBuilder namingBuilders,
-                               ResourceEnvironmentSetter resourceEnvironmentSetter,
-                               Kernel kernel) {
-        super(kernel, securityBuilders, serviceBuilders, namingBuilders, resourceEnvironmentSetter,
webServiceBuilder);
+            AbstractNameQuery tomcatContainerName,
+            Collection webServiceBuilder,
+            Collection securityBuilders,
+            Collection serviceBuilders,
+            NamingBuilder namingBuilders,
+            Collection<ModuleBuilderExtension> moduleBuilderExtensions,
+            ResourceEnvironmentSetter resourceEnvironmentSetter,
+            Kernel kernel) {
+        super(kernel, securityBuilders, serviceBuilders, namingBuilders, resourceEnvironmentSetter,
webServiceBuilder, moduleBuilderExtensions);
         this.defaultEnvironment = defaultEnvironment;
 
         this.tomcatContainerName = tomcatContainerName;
@@ -206,7 +203,11 @@
         // Create the AnnotatedApp interface for the WebModule
         AnnotatedWebApp annotatedWebApp = new AnnotatedWebApp(webApp);
 
-        return new WebModule(standAlone, moduleName, environment, moduleFile, targetPath,
webApp, tomcatWebApp, specDD, contextRoot, new HashMap(), TOMCAT_NAMESPACE, annotatedWebApp);
+        WebModule module = new WebModule(standAlone, moduleName, environment, moduleFile,
targetPath, webApp, tomcatWebApp, specDD, contextRoot, new HashMap(), TOMCAT_NAMESPACE, annotatedWebApp);
+        for (ModuleBuilderExtension mbe: moduleBuilderExtensions) {
+            mbe.createModule(module, plan, moduleFile, targetPath, specDDUrl, environment,
contextRoot, earName, naming, idBuilder);
+        }
+        return module;
     }
 
 
@@ -270,6 +271,9 @@
         TomcatWebAppType gerWebApp = (TomcatWebAppType) module.getVendorDD();
         boolean hasSecurityRealmName = gerWebApp.isSetSecurityRealmName();
         buildSubstitutionGroups(gerWebApp, hasSecurityRealmName, module, earContext);
+        for (ModuleBuilderExtension mbe: moduleBuilderExtensions) {
+            mbe.initContext(earContext, module, cl);
+        }
     }
 
     public void addGBeans(EARContext earContext, Module module, ClassLoader cl, Collection
repository) throws DeploymentException {
@@ -503,6 +507,10 @@
         } catch (Exception e) {
             throw new DeploymentException("Unable to initialize GBean for web app " + module.getName(),
e);
         }
+        //TODO this may definitely not be the best place for this!
+        for (ModuleBuilderExtension mbe: moduleBuilderExtensions) {
+            mbe.addGBeans(earContext, module, cl, repository);
+        }
     }
 
     public String getSchemaNamespace() {
@@ -520,6 +528,7 @@
         infoBuilder.addReference("SecurityBuilders", NamespaceDrivenBuilder.class, NameFactory.MODULE_BUILDER);
         infoBuilder.addReference("ServiceBuilders", NamespaceDrivenBuilder.class, NameFactory.MODULE_BUILDER);
         infoBuilder.addReference("NamingBuilders", NamingBuilder.class, NameFactory.MODULE_BUILDER);
+        infoBuilder.addReference("ModuleBuilderExtensions", ModuleBuilderExtension.class,
NameFactory.MODULE_BUILDER);
         infoBuilder.addReference("ResourceEnvironmentSetter", ResourceEnvironmentSetter.class,
NameFactory.MODULE_BUILDER);
         infoBuilder.addAttribute("kernel", Kernel.class, false);
         infoBuilder.addInterface(ModuleBuilder.class);
@@ -531,6 +540,7 @@
                 "SecurityBuilders",
                 "ServiceBuilders",
                 "NamingBuilders",
+                "ModuleBuilderExtensions",
                 "ResourceEnvironmentSetter",
                 "kernel"});
         GBEAN_INFO = infoBuilder.getBeanInfo();

Modified: geronimo/server/trunk/modules/geronimo-tomcat6-builder/src/test/java/org/apache/geronimo/tomcat/deployment/PlanParsingTest.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-tomcat6-builder/src/test/java/org/apache/geronimo/tomcat/deployment/PlanParsingTest.java?view=diff&rev=516226&r1=516225&r2=516226
==============================================================================
--- geronimo/server/trunk/modules/geronimo-tomcat6-builder/src/test/java/org/apache/geronimo/tomcat/deployment/PlanParsingTest.java
(original)
+++ geronimo/server/trunk/modules/geronimo-tomcat6-builder/src/test/java/org/apache/geronimo/tomcat/deployment/PlanParsingTest.java
Thu Mar  8 15:31:23 2007
@@ -40,9 +40,6 @@
 import org.apache.geronimo.xbeans.geronimo.web.GerWebAppType;
 import org.apache.geronimo.xbeans.geronimo.web.tomcat.TomcatWebAppType;
 import org.apache.geronimo.security.deployment.GeronimoSecurityBuilderImpl;
-import org.apache.geronimo.naming.deployment.ResourceEnvironmentSetter;
-import org.apache.geronimo.naming.deployment.ResourceEnvironmentBuilder;
-import org.apache.xmlbeans.XmlObject;
 
 /**
  */
@@ -58,7 +55,7 @@
     private TomcatModuleBuilder builder;
 
     protected void setUp() throws Exception {
-        builder = new TomcatModuleBuilder(defaultEnvironment, tomcatContainerObjectName,
Collections.singleton(webServiceBuilder), Collections.singleton(new GeronimoSecurityBuilderImpl()),
Collections.singleton(new GBeanBuilder(null, null)), new NamingBuilderCollection(null, null),
new MockResourceEnvironmentSetter(), null);
+        builder = new TomcatModuleBuilder(defaultEnvironment, tomcatContainerObjectName,
Collections.singleton(webServiceBuilder), Collections.singleton(new GeronimoSecurityBuilderImpl()),
Collections.singleton(new GBeanBuilder(null, null)), new NamingBuilderCollection(null, null),
null, new MockResourceEnvironmentSetter(), null);
     }
 
     public void testResourceRef() throws Exception {

Modified: geronimo/server/trunk/modules/geronimo-tomcat6-builder/src/test/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilderTest.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-tomcat6-builder/src/test/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilderTest.java?view=diff&rev=516226&r1=516225&r2=516226
==============================================================================
--- geronimo/server/trunk/modules/geronimo-tomcat6-builder/src/test/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilderTest.java
(original)
+++ geronimo/server/trunk/modules/geronimo-tomcat6-builder/src/test/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilderTest.java
Thu Mar  8 15:31:23 2007
@@ -39,9 +39,9 @@
 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.UnavailableWebServiceBuilder;
 import org.apache.geronimo.j2ee.deployment.WebServiceBuilder;
 import org.apache.geronimo.j2ee.deployment.NamingBuilderCollection;
+import org.apache.geronimo.j2ee.deployment.ModuleBuilderExtension;
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
 import org.apache.geronimo.j2ee.management.impl.J2EEServerImpl;
 import org.apache.geronimo.kernel.Jsr77Naming;
@@ -317,7 +317,7 @@
         defaultEnvironment.addDependency(baseId, ImportType.ALL);
         defaultEnvironment.setConfigId(webModuleArtifact);
         ArrayList naming = new ArrayList();
-        builder = new TomcatModuleBuilder(defaultEnvironment, new AbstractNameQuery(containerName),
Collections.singleton(webServiceBuilder), Collections.singleton(new GeronimoSecurityBuilderImpl()),
Collections.singleton(new GBeanBuilder(null, null)), new NamingBuilderCollection(null, null),
new MockResourceEnvironmentSetter(), null);
+        builder = new TomcatModuleBuilder(defaultEnvironment, new AbstractNameQuery(containerName),
Collections.singleton(webServiceBuilder), Collections.singleton(new GeronimoSecurityBuilderImpl()),
Collections.singleton(new GBeanBuilder(null, null)), new NamingBuilderCollection(null, null),
null, new MockResourceEnvironmentSetter(), null);
     }
 
     protected void tearDown() throws Exception {

Modified: geronimo/server/trunk/modules/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/AbstractWebModuleBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/AbstractWebModuleBuilder.java?view=diff&rev=516226&r1=516225&r2=516226
==============================================================================
--- geronimo/server/trunk/modules/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/AbstractWebModuleBuilder.java
(original)
+++ geronimo/server/trunk/modules/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/AbstractWebModuleBuilder.java
Thu Mar  8 15:31:23 2007
@@ -60,6 +60,7 @@
 import org.apache.geronimo.j2ee.deployment.NamingBuilder;
 import org.apache.geronimo.j2ee.deployment.WebModule;
 import org.apache.geronimo.j2ee.deployment.WebServiceBuilder;
+import org.apache.geronimo.j2ee.deployment.ModuleBuilderExtension;
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
 import org.apache.geronimo.kernel.Kernel;
 import org.apache.geronimo.kernel.Naming;
@@ -118,6 +119,7 @@
     protected final Collection webServiceBuilder;
 
     protected final NamingBuilder namingBuilders;
+    protected final Collection<ModuleBuilderExtension> moduleBuilderExtensions;
 
     private static final QName SECURITY_QNAME = GerSecurityDocument.type.getDocumentElementName();
     private static final QName SERVICE_QNAME = ServiceDocument.type.getDocumentElementName();
@@ -129,13 +131,14 @@
      */
     private static final URI RELATIVE_MODULE_BASE_URI = URI.create("../");
 
-    protected AbstractWebModuleBuilder(Kernel kernel, Collection securityBuilders, Collection
serviceBuilders, NamingBuilder namingBuilders, ResourceEnvironmentSetter resourceEnvironmentSetter,
Collection webServiceBuilder) {
+    protected AbstractWebModuleBuilder(Kernel kernel, Collection securityBuilders, Collection
serviceBuilders, NamingBuilder namingBuilders, ResourceEnvironmentSetter resourceEnvironmentSetter,
Collection webServiceBuilder, Collection<ModuleBuilderExtension> moduleBuilderExtensions)
{
         this.kernel = kernel;
         this.securityBuilders = new NamespaceDrivenBuilderCollection(securityBuilders, SECURITY_QNAME);
         this.serviceBuilders = new NamespaceDrivenBuilderCollection(serviceBuilders, SERVICE_QNAME);
         this.namingBuilders = namingBuilders;
         this.resourceEnvironmentSetter = resourceEnvironmentSetter;
         this.webServiceBuilder = webServiceBuilder;
+        this.moduleBuilderExtensions = moduleBuilderExtensions == null? new ArrayList<ModuleBuilderExtension>():
moduleBuilderExtensions;
     }
 
     static {
@@ -299,6 +302,9 @@
                     throw new DeploymentException("Problem closing war context", e);
                 }
             }
+        }
+        for (ModuleBuilderExtension mbe: moduleBuilderExtensions) {
+            mbe.installModule(earFile, earContext, module, configurationStores, targetConfigurationStore,
repositories);
         }
     }
 

Modified: geronimo/server/trunk/modules/geronimo-web-2.5-builder/src/test/java/org/apache/geronimo/web25/deployment/SchemaConversionTest.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-web-2.5-builder/src/test/java/org/apache/geronimo/web25/deployment/SchemaConversionTest.java?view=diff&rev=516226&r1=516225&r2=516226
==============================================================================
--- geronimo/server/trunk/modules/geronimo-web-2.5-builder/src/test/java/org/apache/geronimo/web25/deployment/SchemaConversionTest.java
(original)
+++ geronimo/server/trunk/modules/geronimo-web-2.5-builder/src/test/java/org/apache/geronimo/web25/deployment/SchemaConversionTest.java
Thu Mar  8 15:31:23 2007
@@ -128,7 +128,7 @@
     private static class WebModuleBuilder extends AbstractWebModuleBuilder {
 
         protected WebModuleBuilder(Kernel kernel) {
-            super(kernel, null, null, null, null, Collections.EMPTY_SET);
+            super(kernel, null, null, null, null, Collections.EMPTY_SET, null);
         }
 
         protected Module createModule(Object plan, JarFile moduleFile, String targetPath,
URL specDDUrl, boolean standAlone, String contextRoot, AbstractName earName, Naming naming,
ModuleIDBuilder idBuilder) throws DeploymentException {

Modified: geronimo/server/trunk/modules/geronimo-web-2.5-builder/src/test/java/org/apache/geronimo/web25/deployment/SecurityConfigTest.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-web-2.5-builder/src/test/java/org/apache/geronimo/web25/deployment/SecurityConfigTest.java?view=diff&rev=516226&r1=516225&r2=516226
==============================================================================
--- geronimo/server/trunk/modules/geronimo-web-2.5-builder/src/test/java/org/apache/geronimo/web25/deployment/SecurityConfigTest.java
(original)
+++ geronimo/server/trunk/modules/geronimo-web-2.5-builder/src/test/java/org/apache/geronimo/web25/deployment/SecurityConfigTest.java
Thu Mar  8 15:31:23 2007
@@ -24,6 +24,7 @@
 import java.util.Map;
 import java.util.Set;
 import java.util.Collections;
+import java.util.ArrayList;
 import java.util.jar.JarFile;
 
 import org.apache.geronimo.common.DeploymentException;
@@ -34,6 +35,7 @@
 import org.apache.geronimo.gbean.AbstractName;
 import org.apache.geronimo.j2ee.deployment.EARContext;
 import org.apache.geronimo.j2ee.deployment.Module;
+import org.apache.geronimo.j2ee.deployment.ModuleBuilderExtension;
 import org.apache.geronimo.kernel.Kernel;
 import org.apache.geronimo.kernel.Naming;
 import org.apache.geronimo.security.jacc.ComponentPermissions;
@@ -85,7 +87,7 @@
     private static class WebModuleBuilder extends AbstractWebModuleBuilder {
 
         protected WebModuleBuilder(Kernel kernel) {
-            super(kernel, null, null, null, null, Collections.EMPTY_SET);
+            super(kernel, null, null, null, null, Collections.EMPTY_SET, null);
         }
 
         protected Module createModule(Object plan, JarFile moduleFile,

Modified: geronimo/server/trunk/modules/geronimo-web-2.5-builder/src/test/java/org/apache/geronimo/web25/deployment/SpecSecurityParsingTest.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-web-2.5-builder/src/test/java/org/apache/geronimo/web25/deployment/SpecSecurityParsingTest.java?view=diff&rev=516226&r1=516225&r2=516226
==============================================================================
--- geronimo/server/trunk/modules/geronimo-web-2.5-builder/src/test/java/org/apache/geronimo/web25/deployment/SpecSecurityParsingTest.java
(original)
+++ geronimo/server/trunk/modules/geronimo-web-2.5-builder/src/test/java/org/apache/geronimo/web25/deployment/SpecSecurityParsingTest.java
Thu Mar  8 15:31:23 2007
@@ -43,7 +43,6 @@
 import org.apache.geronimo.xbeans.javaee.WebAppDocument;
 import org.apache.geronimo.security.jacc.ComponentPermissions;
 import org.apache.xmlbeans.XmlOptions;
-import org.apache.xmlbeans.XmlObject;
 
 /**
  * @version $Rev$ $Date$
@@ -74,7 +73,7 @@
     public static class TestWebModuleBuilder extends AbstractWebModuleBuilder {
 
         protected TestWebModuleBuilder() {
-            super(null, null, null, null, null, Collections.EMPTY_SET);
+            super(null, null, null, null, null, Collections.EMPTY_SET, null);
         }
 
         protected Module createModule(Object plan, JarFile moduleFile, String targetPath,
URL specDDUrl, boolean standAlone, String contextRoot, AbstractName earName, Naming naming,
ModuleIDBuilder idBuilder) throws DeploymentException {



Mime
View raw message