geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r395649 - in /geronimo/branches/1.1/modules: client-builder/src/java/org/apache/geronimo/client/builder/ j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/ jetty-builder/src/java/org/apache/geronimo/jetty/deployment/ jetty-builder/s...
Date Thu, 20 Apr 2006 17:30:30 GMT
Author: djencks
Date: Thu Apr 20 10:30:28 2006
New Revision: 395649

URL: http://svn.apache.org/viewcvs?rev=395649&view=rev
Log:
GERONIMO-1875 make all the builder references in builders be 0..1 using SingleElementCollections

Modified:
    geronimo/branches/1.1/modules/client-builder/src/java/org/apache/geronimo/client/builder/AppClientModuleBuilder.java
    geronimo/branches/1.1/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder.java
    geronimo/branches/1.1/modules/jetty-builder/src/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java
    geronimo/branches/1.1/modules/jetty-builder/src/test/org/apache/geronimo/jetty/deployment/JettyModuleBuilderTest.java
    geronimo/branches/1.1/modules/jetty-builder/src/test/org/apache/geronimo/jetty/deployment/PlanParsingTest.java
    geronimo/branches/1.1/modules/tomcat-builder/src/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilder.java
    geronimo/branches/1.1/modules/tomcat-builder/src/test/org/apache/geronimo/tomcat/deployment/PlanParsingTest.java
    geronimo/branches/1.1/modules/tomcat-builder/src/test/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilderTest.java

Modified: geronimo/branches/1.1/modules/client-builder/src/java/org/apache/geronimo/client/builder/AppClientModuleBuilder.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/client-builder/src/java/org/apache/geronimo/client/builder/AppClientModuleBuilder.java?rev=395649&r1=395648&r2=395649&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/client-builder/src/java/org/apache/geronimo/client/builder/AppClientModuleBuilder.java
(original)
+++ geronimo/branches/1.1/modules/client-builder/src/java/org/apache/geronimo/client/builder/AppClientModuleBuilder.java
Thu Apr 20 10:30:28 2006
@@ -32,6 +32,7 @@
 import org.apache.geronimo.gbean.GBeanData;
 import org.apache.geronimo.gbean.GBeanInfo;
 import org.apache.geronimo.gbean.GBeanInfoBuilder;
+import org.apache.geronimo.gbean.SingleElementCollection;
 import org.apache.geronimo.j2ee.deployment.AppClientModule;
 import org.apache.geronimo.j2ee.deployment.EARContext;
 import org.apache.geronimo.j2ee.deployment.EJBReferenceBuilder;
@@ -93,10 +94,10 @@
 
     private final AbstractNameQuery transactionContextManagerObjectName;
     private final AbstractNameQuery connectionTrackerObjectName;
-    private final EJBReferenceBuilder ejbReferenceBuilder;
-    private final ModuleBuilder connectorModuleBuilder;
-    private final ResourceReferenceBuilder resourceReferenceBuilder;
-    private final ServiceReferenceBuilder serviceReferenceBuilder;
+    private final SingleElementCollection ejbReferenceBuilder;
+    private final SingleElementCollection connectorModuleBuilder;
+    private final SingleElementCollection resourceReferenceBuilder;
+    private final SingleElementCollection serviceReferenceBuilder;
     private static final String GERAPPCLIENT_NAMESPACE = GerApplicationClientDocument.type.getDocumentElementName().getNamespaceURI();
 
     public AppClientModuleBuilder(Environment defaultClientEnvironment,
@@ -108,6 +109,47 @@
             ModuleBuilder connectorModuleBuilder,
             ResourceReferenceBuilder resourceReferenceBuilder,
             ServiceReferenceBuilder serviceReferenceBuilder) {
+        this(defaultClientEnvironment,
+                defaultServerEnvironment,
+                transactionContextManagerObjectName,
+                connectionTrackerObjectName,
+                corbaGBeanObjectName,
+                new SingleElementCollection(ejbReferenceBuilder),
+                new SingleElementCollection(connectorModuleBuilder),
+                new SingleElementCollection(resourceReferenceBuilder),
+                new SingleElementCollection(serviceReferenceBuilder));
+    }
+
+    public AppClientModuleBuilder(AbstractNameQuery transactionContextManagerObjectName,
+            AbstractNameQuery connectionTrackerObjectName,
+            AbstractNameQuery corbaGBeanObjectName,
+            Collection ejbReferenceBuilder,
+            Collection connectorModuleBuilder,
+            Collection resourceReferenceBuilder,
+            Collection serviceReferenceBuilder,
+            Environment defaultClientEnvironment,
+            Environment defaultServerEnvironment
+    ) {
+        this(defaultClientEnvironment,
+                defaultServerEnvironment,
+                transactionContextManagerObjectName,
+                connectionTrackerObjectName,
+                corbaGBeanObjectName,
+                new SingleElementCollection(ejbReferenceBuilder),
+                new SingleElementCollection(connectorModuleBuilder),
+                new SingleElementCollection(resourceReferenceBuilder),
+                new SingleElementCollection(serviceReferenceBuilder));
+    }
+
+    private AppClientModuleBuilder(Environment defaultClientEnvironment,
+            Environment defaultServerEnvironment,
+            AbstractNameQuery transactionContextManagerObjectName,
+            AbstractNameQuery connectionTrackerObjectName,
+            AbstractNameQuery corbaGBeanObjectName,
+            SingleElementCollection ejbReferenceBuilder,
+            SingleElementCollection connectorModuleBuilder,
+            SingleElementCollection resourceReferenceBuilder,
+            SingleElementCollection serviceReferenceBuilder) {
         this.defaultClientEnvironment = defaultClientEnvironment;
         this.defaultServerEnvironment = defaultServerEnvironment;
         this.corbaGBeanObjectName = corbaGBeanObjectName;
@@ -119,6 +161,22 @@
         this.serviceReferenceBuilder = serviceReferenceBuilder;
     }
 
+    private EJBReferenceBuilder getEjbReferenceBuilder() {
+        return (EJBReferenceBuilder) ejbReferenceBuilder.getElement();
+    }
+
+    private ModuleBuilder getConnectorModuleBuilder() {
+        return (ModuleBuilder) connectorModuleBuilder.getElement();
+    }
+
+    private ResourceReferenceBuilder getResourceReferenceBuilder() {
+        return (ResourceReferenceBuilder) resourceReferenceBuilder.getElement();
+    }
+
+    private ServiceReferenceBuilder getServiceReferenceBuilder() {
+        return (ServiceReferenceBuilder) serviceReferenceBuilder.getElement();
+    }
+
     public Module createModule(File plan, JarFile moduleFile, Naming naming) throws DeploymentException
{
         return createModule(plan, moduleFile, "app-client", null, null, null, naming);
     }
@@ -268,7 +326,7 @@
             clientEnvironment.setConfigId(configId);
         }
 
-        AbstractName clientBaseName = earContext.getNaming().createRootName(clientEnvironment.getConfigId(),
clientEnvironment.getConfigId().toString(), NameFactory.J2EE_APPLICATION); 
+        AbstractName clientBaseName = earContext.getNaming().createRootName(clientEnvironment.getConfigId(),
clientEnvironment.getConfigId().toString(), NameFactory.J2EE_APPLICATION);
         File appClientDir;
         try {
             appClientDir = targetConfigurationStore.createNewConfigurationDir(clientEnvironment.getConfigId());
@@ -292,7 +350,7 @@
                     null,
                     null,
                     corbaGBeanObjectName,
-                    new RefContext(ejbReferenceBuilder, resourceReferenceBuilder, serviceReferenceBuilder));
+                    new RefContext(getEjbReferenceBuilder(), getResourceReferenceBuilder(),
getServiceReferenceBuilder()));
             appClientModule.setEarContext(appClientDeploymentContext);
         } catch (DeploymentException e) {
             DeploymentUtil.recursiveDelete(appClientDir);
@@ -418,21 +476,21 @@
                                 }
                             }
                             XmlObject connectorPlan = resource.getConnector();
-                            Module connectorModule = connectorModuleBuilder.createModule(connectorPlan,
connectorFile, path, null, appClientModule.getClientEnvironment(), null, appClientDeploymentContext.getModuleName(),
earContext.getNaming());
+                            Module connectorModule = getConnectorModuleBuilder().createModule(connectorPlan,
connectorFile, path, null, appClientModule.getClientEnvironment(), null, appClientDeploymentContext.getModuleName(),
earContext.getNaming());
                             resourceModules.add(connectorModule);
                             //TODO configStore == null is fishy, consider moving these stages
for connectors into the corresponding stages for this module.
-                            connectorModuleBuilder.installModule(connectorFile, appClientDeploymentContext,
connectorModule, null, null, repositories);
+                            getConnectorModuleBuilder().installModule(connectorFile, appClientDeploymentContext,
connectorModule, null, null, repositories);
                         }
                         //the install step could have added more dependencies... we need
a new cl.
                         appClientClassLoader = appClientDeploymentContext.getClassLoader();
                         for (Iterator iterator = resourceModules.iterator(); iterator.hasNext();)
{
                             Module connectorModule = (Module) iterator.next();
-                            connectorModuleBuilder.initContext(appClientDeploymentContext,
connectorModule, appClientClassLoader);
+                            getConnectorModuleBuilder().initContext(appClientDeploymentContext,
connectorModule, appClientClassLoader);
                         }
 
                         for (Iterator iterator = resourceModules.iterator(); iterator.hasNext();)
{
                             Module connectorModule = (Module) iterator.next();
-                            connectorModuleBuilder.addGBeans(appClientDeploymentContext,
connectorModule, appClientClassLoader, repositories);
+                            getConnectorModuleBuilder().addGBeans(appClientDeploymentContext,
connectorModule, appClientClassLoader, repositories);
                         }
                     } finally {
                         for (Iterator iterator = resourceModules.iterator(); iterator.hasNext();)
{
@@ -619,15 +677,16 @@
 
         infoBuilder.addInterface(ModuleBuilder.class);
 
-        infoBuilder.setConstructor(new String[]{"defaultClientEnvironment",
-                "defaultServerEnvironment",
-                "transactionContextManagerObjectName",
+        infoBuilder.setConstructor(new String[]{"transactionContextManagerObjectName",
                 "connectionTrackerObjectName",
                 "corbaGBeanObjectName",
                 "EJBReferenceBuilder",
                 "ConnectorModuleBuilder",
                 "ResourceReferenceBuilder",
-                "ServiceReferenceBuilder"});
+                "ServiceReferenceBuilder",
+                "defaultClientEnvironment",
+                "defaultServerEnvironment",
+        });
 
         GBEAN_INFO = infoBuilder.getBeanInfo();
     }
@@ -635,4 +694,5 @@
     public static GBeanInfo getGBeanInfo() {
         return GBEAN_INFO;
     }
+
 }

Modified: geronimo/branches/1.1/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder.java?rev=395649&r1=395648&r2=395649&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder.java
(original)
+++ geronimo/branches/1.1/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder.java
Thu Apr 20 10:30:28 2006
@@ -88,10 +88,10 @@
     private static final String DEFAULT_GROUPID = "defaultGroupId";
 
     private final Collection repositories;
-    private final ModuleBuilder ejbConfigBuilder;
-    private final ModuleBuilder webConfigBuilder;
-    private final ModuleBuilder connectorConfigBuilder;
-    private final ModuleBuilder appClientConfigBuilder;
+    private final SingleElementCollection ejbConfigBuilder;
+    private final SingleElementCollection webConfigBuilder;
+    private final SingleElementCollection connectorConfigBuilder;
+    private final SingleElementCollection appClientConfigBuilder;
     private final SingleElementCollection ejbReferenceBuilder;
     private final SingleElementCollection resourceReferenceBuilder;
     private final SingleElementCollection serviceReferenceBuilder;
@@ -114,12 +114,12 @@
             AbstractNameQuery corbaGBeanAbstractName,
             AbstractNameQuery serverName,
             Collection repositories,
-            ModuleBuilder ejbConfigBuilder,
+            Collection ejbConfigBuilder,
             Collection ejbReferenceBuilder,
-            ModuleBuilder webConfigBuilder,
-            ModuleBuilder connectorConfigBuilder,
+            Collection webConfigBuilder,
+            Collection connectorConfigBuilder,
             Collection resourceReferenceBuilder,
-            ModuleBuilder appClientConfigBuilder,
+            Collection appClientConfigBuilder,
             Collection serviceReferenceBuilder,
             Kernel kernel) {
         this(defaultEnvironment,
@@ -130,12 +130,12 @@
                 corbaGBeanAbstractName,
                 serverName,
                 repositories,
-                ejbConfigBuilder,
+                new SingleElementCollection(ejbConfigBuilder),
                 new SingleElementCollection(ejbReferenceBuilder),
-                webConfigBuilder,
-                connectorConfigBuilder,
+                new SingleElementCollection(webConfigBuilder),
+                new SingleElementCollection(connectorConfigBuilder),
                 new SingleElementCollection(resourceReferenceBuilder),
-                appClientConfigBuilder,
+                new SingleElementCollection(appClientConfigBuilder),
                 new SingleElementCollection(serviceReferenceBuilder),
                 kernel.getNaming());
     }
@@ -163,12 +163,12 @@
                 corbaGBeanAbstractName,
                 serverName,
                 repositories,
-                ejbConfigBuilder,
+                new SingleElementCollection(ejbConfigBuilder),
                 new SingleElementCollection(ejbReferenceBuilder),
-                webConfigBuilder,
-                connectorConfigBuilder,
+                new SingleElementCollection(webConfigBuilder),
+                new SingleElementCollection(connectorConfigBuilder),
                 new SingleElementCollection(resourceReferenceBuilder),
-                appClientConfigBuilder,
+                new SingleElementCollection(appClientConfigBuilder),
                 new SingleElementCollection(serviceReferenceBuilder),
                 naming);
     }
@@ -181,12 +181,12 @@
             AbstractNameQuery corbaGBeanAbstractName,
             AbstractNameQuery serverName,
             Collection repositories,
-            ModuleBuilder ejbConfigBuilder,
+            SingleElementCollection ejbConfigBuilder,
             SingleElementCollection ejbReferenceBuilder,
-            ModuleBuilder webConfigBuilder,
-            ModuleBuilder connectorConfigBuilder,
+            SingleElementCollection webConfigBuilder,
+            SingleElementCollection connectorConfigBuilder,
             SingleElementCollection resourceReferenceBuilder,
-            ModuleBuilder appClientConfigBuilder,
+            SingleElementCollection appClientConfigBuilder,
             SingleElementCollection serviceReferenceBuilder,
             Naming naming) {
         this.repositories = repositories;
@@ -208,6 +208,22 @@
         this.naming = naming;
     }
 
+    private ModuleBuilder getEjbConfigBuilder() {
+        return (ModuleBuilder) ejbConfigBuilder.getElement();
+    }
+
+    private ModuleBuilder getWebConfigBuilder() {
+        return (ModuleBuilder) webConfigBuilder.getElement();
+    }
+
+    private ModuleBuilder getConnectorConfigBuilder() {
+        return (ModuleBuilder) connectorConfigBuilder.getElement();
+    }
+
+    private ModuleBuilder getAppClientConfigBuilder() {
+        return (ModuleBuilder) appClientConfigBuilder.getElement();
+    }
+
     private EJBReferenceBuilder getEjbReferenceBuilder() {
         return (EJBReferenceBuilder) ejbReferenceBuilder.getElement();
     }
@@ -235,17 +251,17 @@
 
         // get the modules either the application plan or for a stand alone module from the
specific deployer
         Module module = null;
-        if (webConfigBuilder != null) {
-            module = webConfigBuilder.createModule(planFile, jarFile, naming);
+        if (getWebConfigBuilder() != null) {
+            module = getWebConfigBuilder().createModule(planFile, jarFile, naming);
         }
-        if (module == null && ejbConfigBuilder != null) {
-            module = ejbConfigBuilder.createModule(planFile, jarFile, naming);
+        if (module == null && getEjbConfigBuilder() != null) {
+            module = getEjbConfigBuilder().createModule(planFile, jarFile, naming);
         }
-        if (module == null && connectorConfigBuilder != null) {
-            module = connectorConfigBuilder.createModule(planFile, jarFile, naming);
+        if (module == null && getConnectorConfigBuilder() != null) {
+            module = getConnectorConfigBuilder().createModule(planFile, jarFile, naming);
         }
-        if (module == null && appClientConfigBuilder != null) {
-            module = appClientConfigBuilder.createModule(planFile, jarFile, naming);
+        if (module == null && getAppClientConfigBuilder() != null) {
+            module = getAppClientConfigBuilder().createModule(planFile, jarFile, naming);
         }
         if (module == null) {
             return null;
@@ -601,32 +617,32 @@
                     String moduleTypeName;
                     if (moduleXml.isSetEjb()) {
                         modulePath = moduleXml.getEjb().getStringValue();
-                        if (ejbConfigBuilder == null) {
+                        builder = getEjbConfigBuilder();
+                        if (builder == null) {
                             throw new DeploymentException("Cannot deploy ejb application;
No ejb deployer defined: " + modulePath);
                         }
-                        builder = ejbConfigBuilder;
                         moduleTypeName = "an EJB";
                     } else if (moduleXml.isSetWeb()) {
                         modulePath = moduleXml.getWeb().getWebUri().getStringValue();
-                        if (webConfigBuilder == null) {
+                        if (getWebConfigBuilder() == null) {
                             throw new DeploymentException("Cannot deploy web application;
No war deployer defined: " + modulePath);
                         }
-                        builder = webConfigBuilder;
+                        builder = getWebConfigBuilder();
                         moduleTypeName = "a war";
                         moduleContextInfo = moduleXml.getWeb().getContextRoot().getStringValue().trim();
                     } else if (moduleXml.isSetConnector()) {
                         modulePath = moduleXml.getConnector().getStringValue();
-                        if (connectorConfigBuilder == null) {
+                        if (getConnectorConfigBuilder() == null) {
                             throw new DeploymentException("Cannot deploy resource adapter;
No rar deployer defined: " + modulePath);
                         }
-                        builder = connectorConfigBuilder;
+                        builder = getConnectorConfigBuilder();
                         moduleTypeName = "a connector";
                     } else if (moduleXml.isSetJava()) {
                         modulePath = moduleXml.getJava().getStringValue();
-                        if (appClientConfigBuilder == null) {
+                        if (getAppClientConfigBuilder() == null) {
                             throw new DeploymentException("Cannot deploy app client; No app
client deployer defined: " + modulePath);
                         }
-                        builder = appClientConfigBuilder;
+                        builder = getAppClientConfigBuilder();
                         moduleTypeName = "an application client";
                     } else {
                         throw new DeploymentException("Could not find a module builder for
module: " + moduleXml);
@@ -678,33 +694,33 @@
 
                 if (gerExtModule.isSetEjb()) {
                     moduleName = gerExtModule.getEjb().getStringValue();
-                    if (ejbConfigBuilder == null) {
+                    builder = getEjbConfigBuilder();
+                    if (builder == null) {
                         throw new DeploymentException("Cannot deploy ejb application; No
ejb deployer defined: " + moduleName);
                     }
-                    builder = ejbConfigBuilder;
                     moduleTypeName = "an EJB";
                 } else if (gerExtModule.isSetWeb()) {
                     moduleName = gerExtModule.getWeb().getStringValue();
-                    if (webConfigBuilder == null) {
+                    if (getWebConfigBuilder() == null) {
                         throw new DeploymentException("Cannot deploy web application; No
war deployer defined: " + moduleName);
                     }
-                    builder = webConfigBuilder;
+                    builder = getWebConfigBuilder();
                     moduleTypeName = "a war";
                     //ext modules must use vendor plan to set context-root
 //                    moduleContextInfo = gerExtModule.getWeb().getContextRoot().getStringValue().trim();
                 } else if (gerExtModule.isSetConnector()) {
                     moduleName = gerExtModule.getConnector().getStringValue();
-                    if (connectorConfigBuilder == null) {
+                    if (getConnectorConfigBuilder() == null) {
                         throw new DeploymentException("Cannot deploy resource adapter; No
rar deployer defined: " + moduleName);
                     }
-                    builder = connectorConfigBuilder;
+                    builder = getConnectorConfigBuilder();
                     moduleTypeName = "a connector";
                 } else if (gerExtModule.isSetJava()) {
                     moduleName = gerExtModule.getJava().getStringValue();
-                    if (appClientConfigBuilder == null) {
+                    if (getAppClientConfigBuilder() == null) {
                         throw new DeploymentException("Cannot deploy app client; No app client
deployer defined: " + moduleName);
                     }
-                    builder = appClientConfigBuilder;
+                    builder = getAppClientConfigBuilder();
                     moduleTypeName = "an application client";
                 } else {
                     throw new DeploymentException("Could not find a module builder for module:
" + gerExtModule);
@@ -789,25 +805,25 @@
 
     private ModuleBuilder getBuilder(Module module) throws DeploymentException {
         if (module instanceof EJBModule) {
-            if (ejbConfigBuilder == null) {
+            if (getEjbConfigBuilder() == null) {
                 throw new DeploymentException("Cannot deploy ejb application; No ejb deployer
defined: " + module.getModuleURI());
             }
-            return ejbConfigBuilder;
+            return getEjbConfigBuilder();
         } else if (module instanceof WebModule) {
-            if (webConfigBuilder == null) {
+            if (getWebConfigBuilder() == null) {
                 throw new DeploymentException("Cannot deploy web application; No war deployer
defined: " + module.getModuleURI());
             }
-            return webConfigBuilder;
+            return getWebConfigBuilder();
         } else if (module instanceof ConnectorModule) {
-            if (connectorConfigBuilder == null) {
+            if (getConnectorConfigBuilder() == null) {
                 throw new DeploymentException("Cannot deploy resource adapter; No rar deployer
defined: " + module.getModuleURI());
             }
-            return connectorConfigBuilder;
+            return getConnectorConfigBuilder();
         } else if (module instanceof AppClientModule) {
-            if (appClientConfigBuilder == null) {
+            if (getAppClientConfigBuilder() == null) {
                 throw new DeploymentException("Cannot deploy app client; No app client deployer
defined: " + module.getModuleURI());
             }
-            return appClientConfigBuilder;
+            return getAppClientConfigBuilder();
         }
         throw new IllegalArgumentException("Unknown module type: " + module.getClass().getName());
     }

Modified: geronimo/branches/1.1/modules/jetty-builder/src/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/jetty-builder/src/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java?rev=395649&r1=395648&r2=395649&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/jetty-builder/src/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java
(original)
+++ geronimo/branches/1.1/modules/jetty-builder/src/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java
Thu Apr 20 10:30:28 2006
@@ -57,6 +57,7 @@
 import org.apache.geronimo.gbean.GBeanData;
 import org.apache.geronimo.gbean.GBeanInfo;
 import org.apache.geronimo.gbean.GBeanInfoBuilder;
+import org.apache.geronimo.gbean.SingleElementCollection;
 import org.apache.geronimo.j2ee.deployment.EARContext;
 import org.apache.geronimo.j2ee.deployment.Module;
 import org.apache.geronimo.j2ee.deployment.ModuleBuilder;
@@ -129,7 +130,7 @@
     private final GBeanData pojoWebServiceTemplate;
     private final boolean defaultContextPriorityClassloader;
 
-    private final WebServiceBuilder webServiceBuilder;
+    private final SingleElementCollection webServiceBuilder;
 
     private final List defaultWelcomeFiles;
     private final Integer defaultSessionTimeoutSeconds;
@@ -145,7 +146,7 @@
             Collection defaultFilters,
             Collection defaultFilterMappings,
             Object pojoWebServiceTemplate,
-            WebServiceBuilder webServiceBuilder,
+            Collection webServiceBuilder,
             Kernel kernel) throws GBeanNotFoundException {
         super(kernel);
         this.defaultEnvironment = defaultEnvironment;
@@ -156,13 +157,17 @@
         this.defaultFilters = defaultFilters;
         this.defaultFilterMappings = defaultFilterMappings;
         this.pojoWebServiceTemplate = getGBeanData(kernel, pojoWebServiceTemplate);
-        this.webServiceBuilder = webServiceBuilder;
+        this.webServiceBuilder = new SingleElementCollection(webServiceBuilder);
 
         //todo locale mappings
 
         this.defaultWelcomeFiles = defaultWelcomeFiles;
     }
 
+    private WebServiceBuilder getWebServiceBuilder() {
+        return (WebServiceBuilder) webServiceBuilder.getElement();
+    }
+
     private static GBeanData getGBeanData(Kernel kernel, Object template) throws GBeanNotFoundException
{
         if (template == null) {
             return null;
@@ -234,7 +239,7 @@
         Map portMap = Collections.EMPTY_MAP;
         try {
             URL wsDDUrl = DeploymentUtil.createJarURL(moduleFile, "WEB-INF/webservices.xml");
-            portMap = webServiceBuilder.parseWebServiceDescriptor(wsDDUrl, moduleFile, false,
servletNameToPathMap);
+            portMap = getWebServiceBuilder().parseWebServiceDescriptor(wsDDUrl, moduleFile,
false, servletNameToPathMap);
         } catch (MalformedURLException e) {
             //no descriptor
         }
@@ -830,7 +835,7 @@
                 if (portInfo == null) {
                     throw new DeploymentException("No web service deployment info for servlet
name " + servletName);
                 }
-                webServiceBuilder.configurePOJO(servletData, moduleFile, portInfo, servletClassName,
webClassLoader);
+                getWebServiceBuilder().configurePOJO(servletData, moduleFile, portInfo, servletClassName,
webClassLoader);
             }
         } else if (servletType.isSetJspFile()) {
             servletData = new GBeanData(servletAbstractName, JettyServletHolder.GBEAN_INFO);

Modified: geronimo/branches/1.1/modules/jetty-builder/src/test/org/apache/geronimo/jetty/deployment/JettyModuleBuilderTest.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/jetty-builder/src/test/org/apache/geronimo/jetty/deployment/JettyModuleBuilderTest.java?rev=395649&r1=395648&r2=395649&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/jetty-builder/src/test/org/apache/geronimo/jetty/deployment/JettyModuleBuilderTest.java
(original)
+++ geronimo/branches/1.1/modules/jetty-builder/src/test/org/apache/geronimo/jetty/deployment/JettyModuleBuilderTest.java
Thu Apr 20 10:30:28 2006
@@ -287,7 +287,7 @@
 
         defaultEnvironment.addDependency(baseId, ImportType.ALL);
         defaultEnvironment.setConfigId(webModuleArtifact);
-        builder = new JettyModuleBuilder(defaultEnvironment, new Integer(1800), false, Collections.EMPTY_LIST,
new AbstractNameQuery(containerName), defaultServlets, defaultFilters, defaultFilterMappings,
pojoWebServiceTemplate, webServiceBuilder, kernel);
+        builder = new JettyModuleBuilder(defaultEnvironment, new Integer(1800), false, Collections.EMPTY_LIST,
new AbstractNameQuery(containerName), defaultServlets, defaultFilters, defaultFilterMappings,
pojoWebServiceTemplate, Collections.singleton(webServiceBuilder), kernel);
     }
 
     protected void tearDown() throws Exception {

Modified: geronimo/branches/1.1/modules/jetty-builder/src/test/org/apache/geronimo/jetty/deployment/PlanParsingTest.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/jetty-builder/src/test/org/apache/geronimo/jetty/deployment/PlanParsingTest.java?rev=395649&r1=395648&r2=395649&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/jetty-builder/src/test/org/apache/geronimo/jetty/deployment/PlanParsingTest.java
(original)
+++ geronimo/branches/1.1/modules/jetty-builder/src/test/org/apache/geronimo/jetty/deployment/PlanParsingTest.java
Thu Apr 20 10:30:28 2006
@@ -30,6 +30,7 @@
 import java.util.ArrayList;
 import java.util.HashSet;
 import java.util.List;
+import java.util.Collections;
 import java.util.jar.JarFile;
 
 /**
@@ -47,7 +48,7 @@
     private JettyModuleBuilder builder;
 
     public PlanParsingTest() throws Exception {
-        builder = new JettyModuleBuilder(defaultEnvironment, new Integer(1800), false, null,
jettyContainerObjectName, new HashSet(), new HashSet(), new HashSet(), pojoWebServiceTemplate,
webServiceBuilder, null);
+        builder = new JettyModuleBuilder(defaultEnvironment, new Integer(1800), false, null,
jettyContainerObjectName, new HashSet(), new HashSet(), new HashSet(), pojoWebServiceTemplate,
Collections.singleton(webServiceBuilder), null);
     }
 
     public void testContents() throws Exception {

Modified: geronimo/branches/1.1/modules/tomcat-builder/src/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilder.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/tomcat-builder/src/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilder.java?rev=395649&r1=395648&r2=395649&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/tomcat-builder/src/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilder.java
(original)
+++ geronimo/branches/1.1/modules/tomcat-builder/src/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilder.java
Thu Apr 20 10:30:28 2006
@@ -50,6 +50,7 @@
 import org.apache.geronimo.gbean.GBeanInfo;
 import org.apache.geronimo.gbean.GBeanInfoBuilder;
 import org.apache.geronimo.gbean.AbstractNameQuery;
+import org.apache.geronimo.gbean.SingleElementCollection;
 import org.apache.geronimo.j2ee.deployment.EARContext;
 import org.apache.geronimo.j2ee.deployment.Module;
 import org.apache.geronimo.j2ee.deployment.ModuleBuilder;
@@ -101,21 +102,25 @@
     private final boolean defaultContextPriorityClassloader;
     private final AbstractNameQuery tomcatContainerName;
 
-    private final WebServiceBuilder webServiceBuilder;
+    private final SingleElementCollection webServiceBuilder;
 
     private static final String TOMCAT_NAMESPACE = TomcatWebAppDocument.type.getDocumentElementName().getNamespaceURI();
 
     public TomcatModuleBuilder(Environment defaultEnvironment,
                                boolean defaultContextPriorityClassloader,
                                AbstractNameQuery tomcatContainerName,
-                               WebServiceBuilder webServiceBuilder,
+                               Collection webServiceBuilder,
                                Kernel kernel) {
         super(kernel);
         this.defaultEnvironment = defaultEnvironment;
 
         this.defaultContextPriorityClassloader = defaultContextPriorityClassloader;
         this.tomcatContainerName = tomcatContainerName;
-        this.webServiceBuilder = webServiceBuilder;
+        this.webServiceBuilder = new SingleElementCollection(webServiceBuilder);
+    }
+
+    private WebServiceBuilder getWebServiceBuilder() {
+        return (WebServiceBuilder) webServiceBuilder.getElement();
     }
 
     protected Module createModule(Object plan, JarFile moduleFile, String targetPath, URL
specDDUrl, boolean standAlone, String contextRoot, AbstractName earName, Naming naming) throws
DeploymentException {
@@ -182,7 +187,7 @@
         Map portMap = Collections.EMPTY_MAP;
         try {
             URL wsDDUrl = DeploymentUtil.createJarURL(moduleFile, "WEB-INF/webservices.xml");
-            portMap = webServiceBuilder.parseWebServiceDescriptor(wsDDUrl, moduleFile, false,
servletNameToPathMap);
+            portMap = getWebServiceBuilder().parseWebServiceDescriptor(wsDDUrl, moduleFile,
false, servletNameToPathMap);
         } catch (MalformedURLException e) {
             //no descriptor
         }
@@ -445,7 +450,7 @@
         //web container and ws implementation while assuming almost nothing about their relationship.
 
         GBeanData fakeData = new GBeanData();
-        webServiceBuilder.configurePOJO(fakeData, moduleFile, portInfoObject, seiClassName,
classLoader);
+        getWebServiceBuilder().configurePOJO(fakeData, moduleFile, portInfoObject, seiClassName,
classLoader);
         return (WebServiceContainer) fakeData.getAttribute("webServiceContainer");
     }
 

Modified: geronimo/branches/1.1/modules/tomcat-builder/src/test/org/apache/geronimo/tomcat/deployment/PlanParsingTest.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/tomcat-builder/src/test/org/apache/geronimo/tomcat/deployment/PlanParsingTest.java?rev=395649&r1=395648&r2=395649&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/tomcat-builder/src/test/org/apache/geronimo/tomcat/deployment/PlanParsingTest.java
(original)
+++ geronimo/branches/1.1/modules/tomcat-builder/src/test/org/apache/geronimo/tomcat/deployment/PlanParsingTest.java
Thu Apr 20 10:30:28 2006
@@ -2,6 +2,7 @@
 
 import java.io.File;
 import java.net.URL;
+import java.util.Collections;
 
 import junit.framework.TestCase;
 import org.apache.geronimo.deployment.xbeans.ArtifactType;
@@ -34,7 +35,7 @@
     private TomcatModuleBuilder builder;
 
     protected void setUp() throws Exception {
-        builder = new TomcatModuleBuilder(defaultEnvironment, false, tomcatContainerObjectName,
webServiceBuilder, null);
+        builder = new TomcatModuleBuilder(defaultEnvironment, false, tomcatContainerObjectName,
Collections.singleton(webServiceBuilder), null);
     }
 
     public void testResourceRef() throws Exception {

Modified: geronimo/branches/1.1/modules/tomcat-builder/src/test/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilderTest.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/tomcat-builder/src/test/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilderTest.java?rev=395649&r1=395648&r2=395649&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/tomcat-builder/src/test/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilderTest.java
(original)
+++ geronimo/branches/1.1/modules/tomcat-builder/src/test/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilderTest.java
Thu Apr 20 10:30:28 2006
@@ -364,7 +364,7 @@
 
         defaultEnvironment.addDependency(baseId, ImportType.ALL);
         defaultEnvironment.setConfigId(webModuleArtifact);
-        builder = new TomcatModuleBuilder(defaultEnvironment, true, new AbstractNameQuery(containerName),
webServiceBuilder, null);
+        builder = new TomcatModuleBuilder(defaultEnvironment, true, new AbstractNameQuery(containerName),
Collections.singleton(webServiceBuilder), null);
     }
 
     protected void tearDown() throws Exception {



Mime
View raw message