geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r233016 - in /geronimo/trunk/modules: assembly/src/plan/ jetty-builder/src/java/org/apache/geronimo/jetty/deployment/ jetty-builder/src/test/org/apache/geronimo/jetty/deployment/
Date Tue, 16 Aug 2005 16:57:54 GMT
Author: djencks
Date: Tue Aug 16 09:57:49 2005
New Revision: 233016

URL: http://svn.apache.org/viewcvs?rev=233016&view=rev
Log:
GERONIMO-790. Use references not object name patterns for default servlets etc

Modified:
    geronimo/trunk/modules/assembly/src/plan/jetty-deployer-config.xml
    geronimo/trunk/modules/assembly/src/plan/jetty-runtime-deployer-config.xml
    geronimo/trunk/modules/jetty-builder/src/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java
    geronimo/trunk/modules/jetty-builder/src/test/org/apache/geronimo/jetty/deployment/JettyModuleBuilderTest.java
    geronimo/trunk/modules/jetty-builder/src/test/org/apache/geronimo/jetty/deployment/PlanParsingTest.java

Modified: geronimo/trunk/modules/assembly/src/plan/jetty-deployer-config.xml
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/assembly/src/plan/jetty-deployer-config.xml?rev=233016&r1=233015&r2=233016&view=diff
==============================================================================
--- geronimo/trunk/modules/assembly/src/plan/jetty-deployer-config.xml (original)
+++ geronimo/trunk/modules/assembly/src/plan/jetty-deployer-config.xml Tue Aug 16 09:57:49
2005
@@ -30,7 +30,7 @@
     <attribute name="defaultSessionTimeoutSeconds">1800</attribute>
     <attribute name="defaultWelcomeFiles">index.html,index.htm,index.jsp</attribute>
     <attribute name="jettyContainerObjectName">geronimo.server:name=WebContainer,*</attribute>
-    <attribute name="defaultServlets">geronimo.deployer:j2eeType=DefaultServlet,J2EEModule=org/apache/geronimo/J2EEDeployer,*</attribute>
+    <reference name="DefaultServlets"><gbean-name>geronimo.deployer:j2eeType=DefaultServlet,J2EEModule=org/apache/geronimo/J2EEDeployer,*</gbean-name></reference>
     <reference name="PojoWebServiceTemplate"><gbean-name>geronimo.deployer:J2EEApplication=null,J2EEModule=org/apache/geronimo/J2EEDeployer,J2EEServer=deployer,j2eeType=ServletWebServiceTemplate,name=POJOTemplate</gbean-name></reference>
     <reference name="WebServiceBuilder">
         <name>WebServiceBuilder</name>

Modified: geronimo/trunk/modules/assembly/src/plan/jetty-runtime-deployer-config.xml
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/assembly/src/plan/jetty-runtime-deployer-config.xml?rev=233016&r1=233015&r2=233016&view=diff
==============================================================================
--- geronimo/trunk/modules/assembly/src/plan/jetty-runtime-deployer-config.xml (original)
+++ geronimo/trunk/modules/assembly/src/plan/jetty-runtime-deployer-config.xml Tue Aug 16
09:57:49 2005
@@ -29,7 +29,7 @@
     <attribute name="defaultSessionTimeoutSeconds">1800</attribute>
     <attribute name="defaultWelcomeFiles">index.html,index.htm,index.jsp</attribute>
     <attribute name="jettyContainerObjectName">geronimo.server:name=WebContainer,*</attribute>
-    <attribute name="defaultServlets">geronimo.server:j2eeType=DefaultServlet,J2EEModule=org/apache/geronimo/RuntimeDeployer,*</attribute>
+    <reference name="DefaultServlets"><gbean-name>geronimo.server:j2eeType=DefaultServlet,J2EEModule=org/apache/geronimo/RuntimeDeployer,*</gbean-name></reference>
     <reference name="PojoWebServiceTemplate"><gbean-name>geronimo.server:J2EEApplication=null,J2EEModule=org/apache/geronimo/RuntimeDeployer,J2EEServer=geronimo,j2eeType=ServletWebServiceTemplate,name=POJOTemplate</gbean-name></reference>
     <reference name="WebServiceBuilder"><name>WebServiceBuilder</name></reference>
     <reference name="Repository"><gbean-name>*:name=Repository,*</gbean-name></reference>

Modified: geronimo/trunk/modules/jetty-builder/src/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/jetty-builder/src/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java?rev=233016&r1=233015&r2=233016&view=diff
==============================================================================
--- geronimo/trunk/modules/jetty-builder/src/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java
(original)
+++ geronimo/trunk/modules/jetty-builder/src/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java
Tue Aug 16 09:57:49 2005
@@ -127,9 +127,9 @@
     private final static Log log = LogFactory.getLog(JettyModuleBuilder.class);
     private final URI defaultParentId;
     private final ObjectName jettyContainerObjectName;
-    private final ObjectName defaultServlets;
-    private final ObjectName defaultFilters;
-    private final ObjectName defaultFilterMappings;
+    private final Collection defaultServlets;
+    private final Collection defaultFilters;
+    private final Collection defaultFilterMappings;
     private final GBeanData pojoWebServiceTemplate;
 
     private final WebServiceBuilder webServiceBuilder;
@@ -144,9 +144,9 @@
                               Integer defaultSessionTimeoutSeconds,
                               List defaultWelcomeFiles,
                               ObjectName jettyContainerObjectName,
-                              ObjectName defaultServlets,
-                              ObjectName defaultFilters,
-                              ObjectName defaultFilterMappings,
+                              Collection defaultServlets,
+                              Collection defaultFilters,
+                              Collection defaultFilterMappings,
                               Object pojoWebServiceTemplate,
                               WebServiceBuilder webServiceBuilder,
                               Repository repository,
@@ -157,7 +157,7 @@
         this.defaultServlets = defaultServlets;
         this.defaultFilters = defaultFilters;
         this.defaultFilterMappings = defaultFilterMappings;
-        this.pojoWebServiceTemplate = getServletData(kernel, pojoWebServiceTemplate);
+        this.pojoWebServiceTemplate = getGBeanData(kernel, pojoWebServiceTemplate);
         this.webServiceBuilder = webServiceBuilder;
         this.repository = repository;
         this.kernel = kernel;
@@ -167,7 +167,7 @@
         this.defaultWelcomeFiles = defaultWelcomeFiles;
     }
 
-    private static GBeanData getServletData(Kernel kernel, Object template) throws GBeanNotFoundException
{
+    private static GBeanData getGBeanData(Kernel kernel, Object template) throws GBeanNotFoundException
{
         if (template == null) {
             return null;
         }
@@ -603,10 +603,9 @@
 
             //add default filters
             if (defaultFilters != null) {
-                Set defaultFilterNames = kernel.listGBeans(defaultFilters);
-                for (Iterator iterator = defaultFilterNames.iterator(); iterator.hasNext();)
{
-
-                    GBeanData filterGBeanData = kernel.getGBeanData((ObjectName) iterator.next());
+                for (Iterator iterator = defaultFilters.iterator(); iterator.hasNext();)
{
+                    Object defaultFilter = iterator.next();
+                    GBeanData filterGBeanData = getGBeanData(kernel, defaultFilter);
                     String filterName = (String) filterGBeanData.getAttribute("filterName");
                     ObjectName defaultFilterObjectName = NameFactory.getWebComponentName(null,
null, null, null, filterName, NameFactory.WEB_FILTER, moduleJ2eeContext);
                     filterGBeanData.setName(defaultFilterObjectName);
@@ -635,10 +634,9 @@
 
             //add default filtermappings
 //            if (defaultFilterMappings != null) {
-//                Set defaultFilterMappingNames = kernel.listGBeans(defaultFilterMappings);
-//                for (Iterator iterator = defaultFilterMappingNames.iterator(); iterator.hasNext();)
{
-//
-//                    GBeanData filterMappingGBeanData = kernel.getGBeanData((ObjectName)
iterator.next());
+//                for (Iterator iterator = defaultFilterMappings.iterator(); iterator.hasNext();)
{
+//                    Object defaultFilterMapping = iterator.next();
+//                    GBeanData filterMappingGBeanData = getGBeanData(kernel, defaultFilterMapping);
 //                    String filterName = (String) filterMappingGBeanData.getAttribute("filterName");
 //                    ObjectName defaultFilterMappingObjectName;
 //                    if (filterMappingGBeanData.getAttribute("urlPattern") != null) {
@@ -729,10 +727,9 @@
 
             //add default servlets
             if (defaultServlets != null) {
-                Set defaultServletNames = kernel.listGBeans(defaultServlets);
-                for (Iterator iterator = defaultServletNames.iterator(); iterator.hasNext();)
{
-
-                    GBeanData servletGBeanData = kernel.getGBeanData((ObjectName) iterator.next());
+                for (Iterator iterator = defaultServlets.iterator(); iterator.hasNext();)
{
+                    Object defaultServlet = iterator.next();
+                    GBeanData servletGBeanData = getGBeanData(kernel, defaultServlet);
                     ObjectName defaultServletObjectName = NameFactory.getWebComponentName(null,
null, null, null, (String) servletGBeanData.getAttribute("servletName"), NameFactory.SERVLET,
moduleJ2eeContext);
                     servletGBeanData.setName(defaultServletObjectName);
                     servletGBeanData.setReferencePattern("JettyServletRegistration", webModuleName);
@@ -1344,9 +1341,9 @@
         infoBuilder.addAttribute("defaultSessionTimeoutSeconds", Integer.class, true);
         infoBuilder.addAttribute("defaultWelcomeFiles", List.class, true);
         infoBuilder.addAttribute("jettyContainerObjectName", ObjectName.class, true);
-        infoBuilder.addAttribute("defaultServlets", ObjectName.class, true);
-        infoBuilder.addAttribute("defaultFilters", ObjectName.class, true);
-        infoBuilder.addAttribute("defaultFilterMappings", ObjectName.class, true);
+        infoBuilder.addReference("DefaultServlets", Object.class);
+        infoBuilder.addReference("DefaultFilters", Object.class);
+        infoBuilder.addReference("DefaultFilterMappings", Object.class);
         infoBuilder.addReference("PojoWebServiceTemplate", Object.class);
         infoBuilder.addReference("WebServiceBuilder", WebServiceBuilder.class, NameFactory.MODULE_BUILDER);
         infoBuilder.addReference("Repository", Repository.class, NameFactory.GERONIMO_SERVICE);
@@ -1358,9 +1355,9 @@
             "defaultSessionTimeoutSeconds",
             "defaultWelcomeFiles",
             "jettyContainerObjectName",
-            "defaultServlets",
-            "defaultFilters",
-            "defaultFilterMappings",
+            "DefaultServlets",
+            "DefaultFilters",
+            "DefaultFilterMappings",
             "PojoWebServiceTemplate",
             "WebServiceBuilder",
             "Repository",

Modified: geronimo/trunk/modules/jetty-builder/src/test/org/apache/geronimo/jetty/deployment/JettyModuleBuilderTest.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/jetty-builder/src/test/org/apache/geronimo/jetty/deployment/JettyModuleBuilderTest.java?rev=233016&r1=233015&r2=233016&view=diff
==============================================================================
--- geronimo/trunk/modules/jetty-builder/src/test/org/apache/geronimo/jetty/deployment/JettyModuleBuilderTest.java
(original)
+++ geronimo/trunk/modules/jetty-builder/src/test/org/apache/geronimo/jetty/deployment/JettyModuleBuilderTest.java
Tue Aug 16 09:57:49 2005
@@ -28,6 +28,7 @@
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
+import java.util.Collection;
 
 import javax.management.MalformedObjectNameException;
 import javax.management.ObjectName;
@@ -259,7 +260,9 @@
         ObjectName baseConfigName = configurationManager.load(parentId);
         kernel.startGBean(baseConfigName);
 
-        ObjectName defaultServlets = ObjectName.getInstance("test:name=test,type=none,*");
+        Collection defaultServlets = new HashSet();
+        Collection defaultFilters = new HashSet();
+        Collection defaultFilterMappings = new HashSet();
         Object pojoWebServiceTemplate = null;
         WebServiceBuilder webServiceBuilder = new UnavailableWebServiceBuilder();
 
@@ -277,7 +280,7 @@
         start(securityServiceGBean);
 
 
-        builder = new JettyModuleBuilder(new URI("null"), new Integer(1800), Collections.EMPTY_LIST,
containerName, defaultServlets, null, null, pojoWebServiceTemplate, webServiceBuilder, null,
kernel);
+        builder = new JettyModuleBuilder(new URI("null"), new Integer(1800), Collections.EMPTY_LIST,
containerName, defaultServlets, defaultFilters, defaultFilterMappings, pojoWebServiceTemplate,
webServiceBuilder, null, kernel);
 
         container = new GBeanData(containerName, JettyContainerImpl.GBEAN_INFO);
 

Modified: geronimo/trunk/modules/jetty-builder/src/test/org/apache/geronimo/jetty/deployment/PlanParsingTest.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/jetty-builder/src/test/org/apache/geronimo/jetty/deployment/PlanParsingTest.java?rev=233016&r1=233015&r2=233016&view=diff
==============================================================================
--- geronimo/trunk/modules/jetty-builder/src/test/org/apache/geronimo/jetty/deployment/PlanParsingTest.java
(original)
+++ geronimo/trunk/modules/jetty-builder/src/test/org/apache/geronimo/jetty/deployment/PlanParsingTest.java
Tue Aug 16 09:57:49 2005
@@ -1,18 +1,18 @@
 package org.apache.geronimo.jetty.deployment;
 
 import java.io.File;
+import java.util.HashSet;
 import java.util.jar.JarFile;
-import java.util.Collections;
 import javax.management.ObjectName;
 
 import junit.framework.TestCase;
+import org.apache.geronimo.deployment.util.UnpackedJarFile;
+import org.apache.geronimo.j2ee.deployment.WebServiceBuilder;
 import org.apache.geronimo.kernel.jmx.JMXUtil;
 import org.apache.geronimo.schema.SchemaConversionUtils;
+import org.apache.geronimo.xbeans.geronimo.naming.GerResourceRefType;
 import org.apache.geronimo.xbeans.geronimo.web.GerWebAppDocument;
 import org.apache.geronimo.xbeans.geronimo.web.GerWebAppType;
-import org.apache.geronimo.xbeans.geronimo.naming.GerResourceRefType;
-import org.apache.geronimo.j2ee.deployment.WebServiceBuilder;
-import org.apache.geronimo.deployment.util.UnpackedJarFile;
 
 /**
  */
@@ -24,7 +24,7 @@
     private File basedir = new File(System.getProperty("basedir", "."));
 
     public PlanParsingTest() throws Exception {
-        builder = new JettyModuleBuilder(null, new Integer(1800), null, jettyContainerObjectName,
null, null, null, pojoWebServiceTemplate, webServiceBuilder, null, null);
+        builder = new JettyModuleBuilder(null, new Integer(1800), null, jettyContainerObjectName,
new HashSet(), new HashSet(), new HashSet(), pojoWebServiceTemplate, webServiceBuilder, null,
null);
     }
 
     public void testContents() throws Exception {



Mime
View raw message