geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r1098803 [1/3] - in /geronimo/server/branches/3.0-osgi: ./ plugins/ plugins/j2ee/geronimo-security-builder/src/main/java/org/apache/geronimo/security/deployment/model/jaspi/ plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/ger...
Date Mon, 02 May 2011 21:49:46 GMT
Author: djencks
Date: Mon May  2 21:49:44 2011
New Revision: 1098803

URL: http://svn.apache.org/viewvc?rev=1098803&view=rev
Log:
use updated geronimo-jaspi, start on tomcat

Added:
    geronimo/server/branches/3.0-osgi/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/model/WebJaxbUtil.java   (with props)
    geronimo/server/branches/3.0-osgi/plugins/j2ee/geronimo-web-2.5-builder/src/test/java/org/apache/geronimo/web25/deployment/ParsingTest.java   (with props)
    geronimo/server/branches/3.0-osgi/plugins/tomcat/geronimo-tomcat7-builder/src/main/java/org/apache/geronimo/tomcat/deployment/model/
    geronimo/server/branches/3.0-osgi/plugins/tomcat/geronimo-tomcat7-builder/src/main/java/org/apache/geronimo/tomcat/deployment/model/AuthenticationType.java
      - copied, changed from r1098802, geronimo/server/branches/3.0-osgi/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/model/AuthenticationType.java
    geronimo/server/branches/3.0-osgi/plugins/tomcat/geronimo-tomcat7-builder/src/main/java/org/apache/geronimo/tomcat/deployment/model/ContextType.java   (with props)
    geronimo/server/branches/3.0-osgi/plugins/tomcat/geronimo-tomcat7-builder/src/main/java/org/apache/geronimo/tomcat/deployment/model/EmptyType.java   (with props)
    geronimo/server/branches/3.0-osgi/plugins/tomcat/geronimo-tomcat7-builder/src/main/java/org/apache/geronimo/tomcat/deployment/model/EmptyType2.java   (with props)
    geronimo/server/branches/3.0-osgi/plugins/tomcat/geronimo-tomcat7-builder/src/main/java/org/apache/geronimo/tomcat/deployment/model/JaxbUtil.java   (with props)
    geronimo/server/branches/3.0-osgi/plugins/tomcat/geronimo-tomcat7-builder/src/main/java/org/apache/geronimo/tomcat/deployment/model/ParameterType.java   (with props)
    geronimo/server/branches/3.0-osgi/plugins/tomcat/geronimo-tomcat7-builder/src/main/java/org/apache/geronimo/tomcat/deployment/model/TomcatConfigType.java   (with props)
    geronimo/server/branches/3.0-osgi/plugins/tomcat/geronimo-tomcat7-builder/src/main/java/org/apache/geronimo/tomcat/deployment/model/TomcatObjectFactory.java
      - copied, changed from r1098802, geronimo/server/branches/3.0-osgi/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/model/ObjectFactory.java
    geronimo/server/branches/3.0-osgi/plugins/tomcat/geronimo-tomcat7-builder/src/main/java/org/apache/geronimo/tomcat/deployment/model/TomcatWebAppType.java   (with props)
    geronimo/server/branches/3.0-osgi/plugins/tomcat/geronimo-tomcat7-builder/src/main/java/org/apache/geronimo/tomcat/deployment/model/package-info.java   (contents, props changed)
      - copied, changed from r1098802, geronimo/server/branches/3.0-osgi/plugins/j2ee/geronimo-security-builder/src/main/java/org/apache/geronimo/security/deployment/model/jaspi/package-info.java
    geronimo/server/branches/3.0-osgi/plugins/tomcat/geronimo-tomcat7-builder/src/main/resources/
    geronimo/server/branches/3.0-osgi/plugins/tomcat/geronimo-tomcat7-builder/src/main/resources/META-INF/
    geronimo/server/branches/3.0-osgi/plugins/tomcat/geronimo-tomcat7-builder/src/main/resources/META-INF/sun-jaxb.episode
    geronimo/server/branches/3.0-osgi/plugins/tomcat/geronimo-tomcat7-builder/src/main/resources/catalog.cat
    geronimo/server/branches/3.0-osgi/plugins/tomcat/geronimo-tomcat7-builder/src/main/resources/geronimo-tomcat-2.0.1.xsd   (contents, props changed)
      - copied, changed from r1098802, geronimo/server/branches/3.0-osgi/plugins/tomcat/geronimo-tomcat7-builder/src/main/xsd/geronimo-tomcat-2.0.1.xsd
    geronimo/server/branches/3.0-osgi/plugins/tomcat/geronimo-tomcat7-builder/src/main/resources/geronimo-tomcat-config-1.0.xsd   (contents, props changed)
      - copied, changed from r1098802, geronimo/server/branches/3.0-osgi/plugins/tomcat/geronimo-tomcat7-builder/src/main/xsd/geronimo-tomcat-config-1.0.xsd
Removed:
    geronimo/server/branches/3.0-osgi/plugins/j2ee/geronimo-security-builder/src/main/java/org/apache/geronimo/security/deployment/model/jaspi/AuthModuleType.java
    geronimo/server/branches/3.0-osgi/plugins/j2ee/geronimo-security-builder/src/main/java/org/apache/geronimo/security/deployment/model/jaspi/ClientAuthConfigType.java
    geronimo/server/branches/3.0-osgi/plugins/j2ee/geronimo-security-builder/src/main/java/org/apache/geronimo/security/deployment/model/jaspi/ClientAuthContextType.java
    geronimo/server/branches/3.0-osgi/plugins/j2ee/geronimo-security-builder/src/main/java/org/apache/geronimo/security/deployment/model/jaspi/ConfigProviderType.java
    geronimo/server/branches/3.0-osgi/plugins/j2ee/geronimo-security-builder/src/main/java/org/apache/geronimo/security/deployment/model/jaspi/JaspiType.java
    geronimo/server/branches/3.0-osgi/plugins/j2ee/geronimo-security-builder/src/main/java/org/apache/geronimo/security/deployment/model/jaspi/MessagePolicyType.java
    geronimo/server/branches/3.0-osgi/plugins/j2ee/geronimo-security-builder/src/main/java/org/apache/geronimo/security/deployment/model/jaspi/ObjectFactory.java
    geronimo/server/branches/3.0-osgi/plugins/j2ee/geronimo-security-builder/src/main/java/org/apache/geronimo/security/deployment/model/jaspi/ProtectionPolicyType.java
    geronimo/server/branches/3.0-osgi/plugins/j2ee/geronimo-security-builder/src/main/java/org/apache/geronimo/security/deployment/model/jaspi/ServerAuthConfigType.java
    geronimo/server/branches/3.0-osgi/plugins/j2ee/geronimo-security-builder/src/main/java/org/apache/geronimo/security/deployment/model/jaspi/ServerAuthContextType.java
    geronimo/server/branches/3.0-osgi/plugins/j2ee/geronimo-security-builder/src/main/java/org/apache/geronimo/security/deployment/model/jaspi/TargetPolicyType.java
    geronimo/server/branches/3.0-osgi/plugins/j2ee/geronimo-security-builder/src/main/java/org/apache/geronimo/security/deployment/model/jaspi/TargetType.java
    geronimo/server/branches/3.0-osgi/plugins/j2ee/geronimo-security-builder/src/main/java/org/apache/geronimo/security/deployment/model/jaspi/package-info.java
    geronimo/server/branches/3.0-osgi/plugins/tomcat/geronimo-tomcat7-builder/src/main/xsd/geronimo-tomcat-2.0.1.xsd
    geronimo/server/branches/3.0-osgi/plugins/tomcat/geronimo-tomcat7-builder/src/main/xsd/geronimo-tomcat-config-1.0.xsd
Modified:
    geronimo/server/branches/3.0-osgi/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/AbstractWebModuleBuilder.java
    geronimo/server/branches/3.0-osgi/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/model/AuthenticationType.java
    geronimo/server/branches/3.0-osgi/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/model/ObjectFactory.java
    geronimo/server/branches/3.0-osgi/plugins/j2ee/geronimo-web-2.5-builder/src/test/resources/plans/tomcat-pre.xml
    geronimo/server/branches/3.0-osgi/plugins/pom.xml
    geronimo/server/branches/3.0-osgi/plugins/tomcat/geronimo-tomcat7-builder/pom.xml
    geronimo/server/branches/3.0-osgi/plugins/tomcat/geronimo-tomcat7-builder/src/main/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilder.java
    geronimo/server/branches/3.0-osgi/plugins/tomcat/geronimo-tomcat7-builder/src/test/java/org/apache/geronimo/tomcat/deployment/MockResourceEnvironmentSetter.java
    geronimo/server/branches/3.0-osgi/plugins/tomcat/geronimo-tomcat7-builder/src/test/java/org/apache/geronimo/tomcat/deployment/PlanParsingTest.java
    geronimo/server/branches/3.0-osgi/plugins/tomcat/geronimo-tomcat7-builder/src/test/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilderTest.java
    geronimo/server/branches/3.0-osgi/plugins/tomcat/geronimo-tomcat7-builder/src/test/resources/plans/plan1.xml
    geronimo/server/branches/3.0-osgi/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/TomcatManagerImpl.java
    geronimo/server/branches/3.0-osgi/plugins/tomcat/geronimo-tomcat7/src/main/java/org/apache/geronimo/tomcat/connector/ConnectorWrapperGBeanStarter.java
    geronimo/server/branches/3.0-osgi/plugins/tomcat/tomcat7/pom.xml
    geronimo/server/branches/3.0-osgi/pom.xml

Modified: geronimo/server/branches/3.0-osgi/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/AbstractWebModuleBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/3.0-osgi/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/AbstractWebModuleBuilder.java?rev=1098803&r1=1098802&r2=1098803&view=diff
==============================================================================
--- geronimo/server/branches/3.0-osgi/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/AbstractWebModuleBuilder.java (original)
+++ geronimo/server/branches/3.0-osgi/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/AbstractWebModuleBuilder.java Mon May  2 21:49:44 2011
@@ -401,19 +401,19 @@ public abstract class AbstractWebModuleB
         }
     }
 
-    protected abstract void preInitContext(EARContext earContext, WebModule module, Bundle bundle) throws DeploymentException;
+    protected abstract void preInitContext(EARContext earContext, WebModule<WebAppType> module, Bundle bundle) throws DeploymentException;
 
-    protected abstract void postInitContext(EARContext earContext, WebModule module, Bundle bundle) throws DeploymentException;
+    protected abstract void postInitContext(EARContext earContext, WebModule<WebAppType> module, Bundle bundle) throws DeploymentException;
 
     @Override
     public void initContext(EARContext earContext, Module module, Bundle bundle) throws DeploymentException {
-        WebModule webModule = (WebModule)module;
+        WebModule<WebAppType> webModule = (WebModule<WebAppType>)module;
         preInitContext(earContext, webModule, bundle);
         basicInitContext(earContext, webModule, bundle, module.getVendorDD());
         postInitContext(earContext, webModule, bundle);
     }
 
-    protected void basicInitContext(EARContext earContext, WebModule webModule, Bundle bundle, Object gerWebApp) throws DeploymentException {
+    protected void basicInitContext(EARContext earContext, WebModule<WebAppType> webModule, Bundle bundle, Object gerWebApp) throws DeploymentException {
         //complete manifest classpath
         EARContext moduleContext = webModule.getEarContext();
         Collection<String> manifestcp = webModule.getClassPath();
@@ -422,7 +422,7 @@ public abstract class AbstractWebModuleB
         URI resolutionUri = invertURI(baseUri);
         earContext.getCompleteManifestClassPath(webModule.getDeployable(), baseUri, resolutionUri, manifestcp, moduleLocations);
         //Security Configuration Validation
-        WebApp webApp = (WebApp) webModule.getSpecDD();
+        WebApp webApp = webModule.getSpecDD();
         boolean hasSecurityRealmName = (Boolean) webModule.getEarContext().getGeneralData().get(WEB_MODULE_HAS_SECURITY_REALM);
         if ((!webApp.getSecurityConstraint().isEmpty() || !webApp.getSecurityRole().isEmpty())) {
             if (!hasSecurityRealmName) {
@@ -440,7 +440,7 @@ public abstract class AbstractWebModuleB
 //        }
 
         //Process Naming
-        getNamingBuilders().buildEnvironment(webApp, (JndiPlan)webModule.getVendorDD(), webModule.getEnvironment());
+        getNamingBuilders().buildEnvironment(webApp, webModule.getVendorDD(), webModule.getEnvironment());
         getNamingBuilders().initContext(webApp, (JndiPlan)gerWebApp, webModule);
 
         float originalSpecDDVersion;

Modified: geronimo/server/branches/3.0-osgi/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/model/AuthenticationType.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/3.0-osgi/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/model/AuthenticationType.java?rev=1098803&r1=1098802&r2=1098803&view=diff
==============================================================================
--- geronimo/server/branches/3.0-osgi/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/model/AuthenticationType.java (original)
+++ geronimo/server/branches/3.0-osgi/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/model/AuthenticationType.java Mon May  2 21:49:44 2011
@@ -41,30 +41,31 @@ import org.apache.geronimo.components.ja
  * 
  */
 @XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "authenticationType", propOrder = {
-    "configProvider",
-    "serverAuthConfig",
-    "serverAuthContext",
-    "serverAuthModule"
+@XmlType(name = "authenticationType",
+        propOrder = {
+//    "configProvider",
+//    "serverAuthConfig",
+//    "serverAuthContext",
+//    "serverAuthModule"
 })
 public class AuthenticationType {
 
-    @XmlElement(namespace = "http://geronimo.apache.org/xml/ns/geronimo-jaspi")
+//    @XmlElement(namespace = "http://geronimo.apache.org/xml/ns/geronimo-jaspi")
     protected ConfigProviderType configProvider;
-    @XmlElement(namespace = "http://geronimo.apache.org/xml/ns/geronimo-jaspi")
+//    @XmlElement(namespace = "http://geronimo.apache.org/xml/ns/geronimo-jaspi")
     protected ServerAuthConfigType serverAuthConfig;
-    @XmlElement(namespace = "http://geronimo.apache.org/xml/ns/geronimo-jaspi")
+//    @XmlElement(namespace = "http://geronimo.apache.org/xml/ns/geronimo-jaspi")
     protected ServerAuthContextType serverAuthContext;
-    @XmlElement(namespace = "http://geronimo.apache.org/xml/ns/geronimo-jaspi")
+//    @XmlElement(namespace = "http://geronimo.apache.org/xml/ns/geronimo-jaspi")
     protected AuthModuleType serverAuthModule;
 
     /**
      * Gets the value of the configProvider property.
-     * 
+     *
      * @return
      *     possible object is
      *     {@link ConfigProviderType }
-     *     
+     *
      */
     public ConfigProviderType getConfigProvider() {
         return configProvider;
@@ -72,11 +73,11 @@ public class AuthenticationType {
 
     /**
      * Sets the value of the configProvider property.
-     * 
+     *
      * @param value
      *     allowed object is
      *     {@link ConfigProviderType }
-     *     
+     *
      */
     public void setConfigProvider(ConfigProviderType value) {
         this.configProvider = value;
@@ -84,11 +85,11 @@ public class AuthenticationType {
 
     /**
      * Gets the value of the serverAuthConfig property.
-     * 
+     *
      * @return
      *     possible object is
      *     {@link ServerAuthConfigType }
-     *     
+     *
      */
     public ServerAuthConfigType getServerAuthConfig() {
         return serverAuthConfig;
@@ -96,11 +97,11 @@ public class AuthenticationType {
 
     /**
      * Sets the value of the serverAuthConfig property.
-     * 
+     *
      * @param value
      *     allowed object is
      *     {@link ServerAuthConfigType }
-     *     
+     *
      */
     public void setServerAuthConfig(ServerAuthConfigType value) {
         this.serverAuthConfig = value;
@@ -108,11 +109,11 @@ public class AuthenticationType {
 
     /**
      * Gets the value of the serverAuthContext property.
-     * 
+     *
      * @return
      *     possible object is
      *     {@link ServerAuthContextType }
-     *     
+     *
      */
     public ServerAuthContextType getServerAuthContext() {
         return serverAuthContext;
@@ -120,11 +121,11 @@ public class AuthenticationType {
 
     /**
      * Sets the value of the serverAuthContext property.
-     * 
+     *
      * @param value
      *     allowed object is
      *     {@link ServerAuthContextType }
-     *     
+     *
      */
     public void setServerAuthContext(ServerAuthContextType value) {
         this.serverAuthContext = value;
@@ -132,11 +133,11 @@ public class AuthenticationType {
 
     /**
      * Gets the value of the serverAuthModule property.
-     * 
+     *
      * @return
      *     possible object is
      *     {@link AuthModuleType }
-     *     
+     *
      */
     public AuthModuleType getServerAuthModule() {
         return serverAuthModule;
@@ -144,11 +145,11 @@ public class AuthenticationType {
 
     /**
      * Sets the value of the serverAuthModule property.
-     * 
+     *
      * @param value
      *     allowed object is
      *     {@link AuthModuleType }
-     *     
+     *
      */
     public void setServerAuthModule(AuthModuleType value) {
         this.serverAuthModule = value;

Modified: geronimo/server/branches/3.0-osgi/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/model/ObjectFactory.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/3.0-osgi/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/model/ObjectFactory.java?rev=1098803&r1=1098802&r2=1098803&view=diff
==============================================================================
--- geronimo/server/branches/3.0-osgi/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/model/ObjectFactory.java (original)
+++ geronimo/server/branches/3.0-osgi/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/model/ObjectFactory.java Mon May  2 21:49:44 2011
@@ -12,13 +12,13 @@ import javax.xml.bind.JAXBElement;
 import javax.xml.bind.annotation.XmlElementDecl;
 import javax.xml.bind.annotation.XmlRegistry;
 import javax.xml.namespace.QName;
+import org.apache.geronimo.components.jaspi.model.AuthModuleType;
+import org.apache.geronimo.components.jaspi.model.ConfigProviderType;
+import org.apache.geronimo.components.jaspi.model.ServerAuthConfigType;
+import org.apache.geronimo.components.jaspi.model.ServerAuthContextType;
 import org.apache.geronimo.deployment.service.plan.EnvironmentType;
 import org.apache.geronimo.j2ee.deployment.model.naming.AbstractNamingEntryType;
 import org.apache.geronimo.j2ee.deployment.model.naming.MessageDestinationType;
-import org.apache.geronimo.security.deployment.model.jaspi.AuthModuleType;
-import org.apache.geronimo.security.deployment.model.jaspi.ConfigProviderType;
-import org.apache.geronimo.security.deployment.model.jaspi.ServerAuthConfigType;
-import org.apache.geronimo.security.deployment.model.jaspi.ServerAuthContextType;
 import org.apache.geronimo.security.deployment.model.security.SecurityRefType;
 import org.apache.geronimo.security.deployment.model.security.SecurityType;
 

Added: geronimo/server/branches/3.0-osgi/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/model/WebJaxbUtil.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/3.0-osgi/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/model/WebJaxbUtil.java?rev=1098803&view=auto
==============================================================================
--- geronimo/server/branches/3.0-osgi/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/model/WebJaxbUtil.java (added)
+++ geronimo/server/branches/3.0-osgi/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/model/WebJaxbUtil.java Mon May  2 21:49:44 2011
@@ -0,0 +1,65 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+
+package org.apache.geronimo.web25.deployment.model;
+
+import java.io.InputStream;
+import java.io.Writer;
+
+import javax.xml.bind.JAXBContext;
+import javax.xml.bind.JAXBElement;
+import javax.xml.bind.JAXBException;
+import javax.xml.bind.Marshaller;
+import javax.xml.bind.Unmarshaller;
+import javax.xml.stream.XMLInputFactory;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+
+/**
+ * @version $Rev:$ $Date:$
+ */
+public class WebJaxbUtil {
+    public static final XMLInputFactory XMLINPUT_FACTORY = XMLInputFactory.newInstance();
+    private static  JAXBContext WEB_APP_CONTEXT;
+    static {
+        try {
+            WEB_APP_CONTEXT = JAXBContext.newInstance(WebAppType.class);
+        } catch (JAXBException e) {
+            throw new RuntimeException(e);
+        }
+    }
+
+
+    public static WebAppType unmarshalWebApp(InputStream in, boolean validate) throws XMLStreamException, JAXBException {
+        XMLStreamReader xmlStream = XMLINPUT_FACTORY.createXMLStreamReader(in);
+        Unmarshaller unmarshaller = WEB_APP_CONTEXT.createUnmarshaller();
+        JAXBElement<WebAppType> element = unmarshaller.unmarshal(xmlStream, WebAppType.class);
+        WebAppType moduleType = element.getValue();
+        return moduleType;
+    }
+
+    public static void marshalWebApp(WebAppType object, Writer out) throws JAXBException {
+        Marshaller marshaller = WEB_APP_CONTEXT.createMarshaller();
+
+        marshaller.setProperty("jaxb.formatted.output", true);
+
+        marshaller.marshal(object, out);
+    }
+}

Propchange: geronimo/server/branches/3.0-osgi/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/model/WebJaxbUtil.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/branches/3.0-osgi/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/model/WebJaxbUtil.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/branches/3.0-osgi/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/model/WebJaxbUtil.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/server/branches/3.0-osgi/plugins/j2ee/geronimo-web-2.5-builder/src/test/java/org/apache/geronimo/web25/deployment/ParsingTest.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/3.0-osgi/plugins/j2ee/geronimo-web-2.5-builder/src/test/java/org/apache/geronimo/web25/deployment/ParsingTest.java?rev=1098803&view=auto
==============================================================================
--- geronimo/server/branches/3.0-osgi/plugins/j2ee/geronimo-web-2.5-builder/src/test/java/org/apache/geronimo/web25/deployment/ParsingTest.java (added)
+++ geronimo/server/branches/3.0-osgi/plugins/j2ee/geronimo-web-2.5-builder/src/test/java/org/apache/geronimo/web25/deployment/ParsingTest.java Mon May  2 21:49:44 2011
@@ -0,0 +1,40 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+
+package org.apache.geronimo.web25.deployment;
+
+import java.io.InputStream;
+
+import org.apache.geronimo.web25.deployment.model.WebAppType;
+import org.apache.geronimo.web25.deployment.model.WebJaxbUtil;
+import org.junit.Test;
+
+/**
+ * @version $Rev:$ $Date:$
+ */
+public class ParsingTest {
+
+    @Test
+    public void testParsing() throws Exception {
+        ClassLoader cl = getClass().getClassLoader();
+        InputStream in = cl.getResourceAsStream("plans/tomcat-pre.xml");
+        WebAppType webAppType = WebJaxbUtil.unmarshalWebApp(in, false);
+    }
+}

Propchange: geronimo/server/branches/3.0-osgi/plugins/j2ee/geronimo-web-2.5-builder/src/test/java/org/apache/geronimo/web25/deployment/ParsingTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/branches/3.0-osgi/plugins/j2ee/geronimo-web-2.5-builder/src/test/java/org/apache/geronimo/web25/deployment/ParsingTest.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/branches/3.0-osgi/plugins/j2ee/geronimo-web-2.5-builder/src/test/java/org/apache/geronimo/web25/deployment/ParsingTest.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: geronimo/server/branches/3.0-osgi/plugins/j2ee/geronimo-web-2.5-builder/src/test/resources/plans/tomcat-pre.xml
URL: http://svn.apache.org/viewvc/geronimo/server/branches/3.0-osgi/plugins/j2ee/geronimo-web-2.5-builder/src/test/resources/plans/tomcat-pre.xml?rev=1098803&r1=1098802&r2=1098803&view=diff
==============================================================================
--- geronimo/server/branches/3.0-osgi/plugins/j2ee/geronimo-web-2.5-builder/src/test/resources/plans/tomcat-pre.xml (original)
+++ geronimo/server/branches/3.0-osgi/plugins/j2ee/geronimo-web-2.5-builder/src/test/resources/plans/tomcat-pre.xml Mon May  2 21:49:44 2011
@@ -24,26 +24,20 @@
             <dep:artifactId>testclient</dep:artifactId>
             <dep:version>1</dep:version>
         </dep:moduleId>
-        <dep:dependencies>
-            <dep:dependency>
-                <dep:groupId>geronimo</dep:groupId>
-                <dep:artifactId>j2ee-system</dep:artifactId>
-            </dep:dependency>
-        </dep:dependencies>
     </dep:environment>
-    <context-priority-classloader>false</context-priority-classloader>
-    <container-config>
-        <tomcat xmlns="http://geronimo.apache.org/xml/ns/web/tomcat/config-1.0">
-            <cross-context/>
-            <tomcat-realm>TomcatJAASRealm</tomcat-realm>
-        </tomcat>
-    </container-config>
+    <!--<context-priority-classloader>false</context-priority-classloader>-->
+    <!--<container-config>-->
+        <!--<tomcat xmlns="http://geronimo.apache.org/xml/ns/web/tomcat/config-1.0">-->
+            <!--<cross-context/>-->
+            <!--<tomcat-realm>TomcatJAASRealm</tomcat-realm>-->
+        <!--</tomcat>-->
+    <!--</container-config>-->
     <resource-ref>
       <ref-name>jdbc/DB1</ref-name>
       <target-name>DefaultDatabase</target-name>
     </resource-ref>
     <security-realm-name>jetspeed-realm</security-realm-name>
-    <security>
+    <security xmlns="http://geronimo.apache.org/xml/ns/security-2.0">
         <default-subject>
             <realm>foo</realm>
             <id>guest</id>
@@ -54,21 +48,21 @@
             </role>
         </role-mappings>
     </security>
-    <gbean name="jetspeed-realm" class="org.apache.geronimo.security.realm.GenericSecurityRealm">
-        <attribute name="realmName">jetspeed-realm</attribute>
-        <xml-reference name="LoginModuleConfiguration">
-            <lc:login-config xmlns:lc="http://geronimo.apache.org/xml/ns/loginconfig-1.0">
-                <lc:login-module control-flag="REQUIRED" server-side="true">
-                    <lc:login-domain-name>jetspeed-realm</lc:login-domain-name>
-                    <lc:login-module-class>org.apache.jetspeed.security.impl.DefaultLoginModule</lc:login-module-class>
-                </lc:login-module>
-            </lc:login-config>
-        </xml-reference>
-        <reference name="ServerInfo">
-            <name>ServerInfo</name>
-        </reference>
-        <reference name="LoginService">
-            <name>JaasLoginService</name>
-        </reference>
-    </gbean>
+    <!--<gbean name="jetspeed-realm" class="org.apache.geronimo.security.realm.GenericSecurityRealm">-->
+        <!--<attribute name="realmName">jetspeed-realm</attribute>-->
+        <!--<xml-reference name="LoginModuleConfiguration">-->
+            <!--<lc:login-config xmlns:lc="http://geronimo.apache.org/xml/ns/loginconfig-1.0">-->
+                <!--<lc:login-module control-flag="REQUIRED" server-side="true">-->
+                    <!--<lc:login-domain-name>jetspeed-realm</lc:login-domain-name>-->
+                    <!--<lc:login-module-class>org.apache.jetspeed.security.impl.DefaultLoginModule</lc:login-module-class>-->
+                <!--</lc:login-module>-->
+            <!--</lc:login-config>-->
+        <!--</xml-reference>-->
+        <!--<reference name="ServerInfo">-->
+            <!--<name>ServerInfo</name>-->
+        <!--</reference>-->
+        <!--<reference name="LoginService">-->
+            <!--<name>JaasLoginService</name>-->
+        <!--</reference>-->
+    <!--</gbean>-->
 </web-app>

Modified: geronimo/server/branches/3.0-osgi/plugins/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/branches/3.0-osgi/plugins/pom.xml?rev=1098803&r1=1098802&r2=1098803&view=diff
==============================================================================
--- geronimo/server/branches/3.0-osgi/plugins/pom.xml (original)
+++ geronimo/server/branches/3.0-osgi/plugins/pom.xml Mon May  2 21:49:44 2011
@@ -159,7 +159,7 @@
         <module>axis2</module>
         <module>client</module>
         <module>clustering</module>
-        <module>connector-1_6</module>
+        <!--<module>connector-1_6</module>-->
         <module>console</module>
         <module>corba</module>
         <module>cxf</module>

Modified: geronimo/server/branches/3.0-osgi/plugins/tomcat/geronimo-tomcat7-builder/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/branches/3.0-osgi/plugins/tomcat/geronimo-tomcat7-builder/pom.xml?rev=1098803&r1=1098802&r2=1098803&view=diff
==============================================================================
--- geronimo/server/branches/3.0-osgi/plugins/tomcat/geronimo-tomcat7-builder/pom.xml (original)
+++ geronimo/server/branches/3.0-osgi/plugins/tomcat/geronimo-tomcat7-builder/pom.xml Mon May  2 21:49:44 2011
@@ -35,19 +35,37 @@
 
     <dependencies>
         <dependency>
-            <groupId>${pom.groupId}</groupId>
+            <groupId>org.apache.geronimo.modules</groupId>
             <artifactId>geronimo-tomcat7</artifactId>
             <version>${project.version}</version>
         </dependency>
 
-        <!-- g-j2ee-builder and hence g-service-builder comes via g-naming-builder -->
-        <!-- g-security-builder comes from this -->
         <dependency>
-            <groupId>${pom.groupId}</groupId>
+            <groupId>org.apache.geronimo.modules</groupId>
             <artifactId>geronimo-web-2.5-builder</artifactId>
             <version>${project.version}</version>
         </dependency>
         <dependency>
+            <groupId>org.apache.geronimo.modules</groupId>
+            <artifactId>geronimo-j2ee-builder</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <!--<dependency>-->
+            <!--<groupId>org.apache.geronimo.modules</groupId>-->
+            <!--<artifactId>geronimo-naming-builder</artifactId>-->
+            <!--<version>${project.version}</version>-->
+        <!--</dependency>-->
+        <dependency>
+            <groupId>org.apache.geronimo.modules</groupId>
+            <artifactId>geronimo-security-builder</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.geronimo.framework</groupId>
+            <artifactId>geronimo-service-builder</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
             <groupId>org.apache.openejb</groupId>
             <artifactId>openejb-jee</artifactId>
         </dependency>
@@ -110,10 +128,10 @@
                 </configuration>
             </plugin>
 
-            <plugin>
-                <groupId>org.codehaus.mojo</groupId>
-                <artifactId>xmlbeans-maven-plugin</artifactId>
-            </plugin>
+            <!--<plugin>-->
+                <!--<groupId>org.codehaus.mojo</groupId>-->
+                <!--<artifactId>xmlbeans-maven-plugin</artifactId>-->
+            <!--</plugin>-->
 
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
@@ -167,44 +185,93 @@
                 <groupId>org.apache.felix</groupId>
                 <artifactId>maven-bundle-plugin</artifactId>
                 <configuration>
-                    <instructions>
-                        <!--<_versionpolicy>[$(version;==;$(@)),$(version;+;$(@)))</_versionpolicy>-->
-                        <Import-Package>
-                            org.apache.geronimo.deployment.xbeans.impl,
-                            org.apache.geronimo.deployment.javabean.xbeans.impl,
-                            org.apache.geronimo.deployment.xbeans,
-                            org.apache.geronimo.deployment.javabean.xbeans,
-                            org.apache.geronimo.deployment.dconfigbean,
-                            org.apache.geronimo.deployment.service,
-                            org.apache.geronimo.deployment.service.jsr88,
-                            org.apache.xmlbeans.impl.schema;version="2.4",
-                            org.apache.geronimo.xbeans.geronimo.j2ee,
-                            org.apache.geronimo.xbeans.geronimo.j2ee.impl,
-                            org.apache.geronimo.j2ee.deployment,
-                            org.apache.geronimo.j2ee.deployment.annotation,
-                            org.apache.geronimo.j2ee.jsr88,
-                            org.apache.geronimo.xbeans.geronimo.naming,
-                            org.apache.geronimo.xbeans.geronimo.naming.impl,
-                            org.apache.geronimo.naming.deployment,
-                            org.apache.geronimo.naming.deployment.jsr88,
-                            org.apache.geronimo.xbeans.geronimo.jaspi,
-                            org.apache.geronimo.xbeans.geronimo.jaspi.impl,
-                            *
-                        </Import-Package>
-                        <Export-Package>
-                            org.apache.geronimo.tomcat.deployment,
-                            org.apache.geronimo.xbeans.geronimo.web.tomcat,
-                            org.apache.geronimo.xbeans.geronimo.web.tomcat.impl
-                            org.apache.geronimo.xbeans.geronimo.web.tomcat.config,
-                            org.apache.geronimo.xbeans.geronimo.web.tomcat.config.impl
-                        </Export-Package>
-                        <_exportcontents>schemaorg_apache_xmlbeans*</_exportcontents>
-                        <DynamicImport-Package>schemaorg_apache_xmlbeans.*</DynamicImport-Package>
-                    </instructions>
+                    <!--<instructions>-->
+                        <!--&lt;!&ndash;<_versionpolicy>[$(version;==;$(@)),$(version;+;$(@)))</_versionpolicy>&ndash;&gt;-->
+                        <!--<Import-Package>-->
+                            <!--org.apache.geronimo.deployment.xbeans.impl,-->
+                            <!--org.apache.geronimo.deployment.javabean.xbeans.impl,-->
+                            <!--org.apache.geronimo.deployment.xbeans,-->
+                            <!--org.apache.geronimo.deployment.javabean.xbeans,-->
+                            <!--org.apache.geronimo.deployment.dconfigbean,-->
+                            <!--org.apache.geronimo.deployment.service,-->
+                            <!--org.apache.geronimo.deployment.service.jsr88,-->
+                            <!--org.apache.xmlbeans.impl.schema;version="2.4",-->
+                            <!--org.apache.geronimo.xbeans.geronimo.j2ee,-->
+                            <!--org.apache.geronimo.xbeans.geronimo.j2ee.impl,-->
+                            <!--org.apache.geronimo.j2ee.deployment,-->
+                            <!--org.apache.geronimo.j2ee.deployment.annotation,-->
+                            <!--org.apache.geronimo.j2ee.jsr88,-->
+                            <!--org.apache.geronimo.xbeans.geronimo.naming,-->
+                            <!--org.apache.geronimo.xbeans.geronimo.naming.impl,-->
+                            <!--org.apache.geronimo.naming.deployment,-->
+                            <!--org.apache.geronimo.naming.deployment.jsr88,-->
+                            <!--org.apache.geronimo.xbeans.geronimo.jaspi,-->
+                            <!--org.apache.geronimo.xbeans.geronimo.jaspi.impl,-->
+                            <!--*-->
+                        <!--</Import-Package>-->
+                        <!--<Export-Package>-->
+                            <!--org.apache.geronimo.tomcat.deployment,-->
+                            <!--org.apache.geronimo.xbeans.geronimo.web.tomcat,-->
+                            <!--org.apache.geronimo.xbeans.geronimo.web.tomcat.impl-->
+                            <!--org.apache.geronimo.xbeans.geronimo.web.tomcat.config,-->
+                            <!--org.apache.geronimo.xbeans.geronimo.web.tomcat.config.impl-->
+                        <!--</Export-Package>-->
+                        <!--<_exportcontents>schemaorg_apache_xmlbeans*</_exportcontents>-->
+                        <!--<DynamicImport-Package>schemaorg_apache_xmlbeans.*</DynamicImport-Package>-->
+                    <!--</instructions>-->
                 </configuration>
             </plugin>
         </plugins>
     </build>
+    <profiles>
+        <profile>
+            <id>jaxb</id>
+            <build>
+                <plugins>
+                    <plugin>
+                        <groupId>org.jvnet.jaxb2.maven2</groupId>
+                        <artifactId>maven-jaxb2-plugin</artifactId>
+                        <configuration>
+                            <debug>true</debug>
+                            <verbose>true</verbose>
+                            <generatePackage>org.apache.geronimo.tocat.deployment.model</generatePackage>
+                            <catalog>src/main/resources/catalog.cat</catalog>
+                            <catalogResolver>org.jvnet.jaxb2.maven2.resolver.tools.ClasspathCatalogResolver</catalogResolver>
+                            <episodes>
+                                <episode>
+                                    <groupId>org.apache.geronimo.framework</groupId>
+                                    <artifactId>geronimo-service-builder</artifactId>
+                                </episode>
+                                <episode>
+                                    <groupId>org.apache.geronimo.modules</groupId>
+                                    <artifactId>geronimo-j2ee-builder</artifactId>
+                                </episode>
+                                <episode>
+                                    <groupId>org.apache.geronimo.modules</groupId>
+                                    <artifactId>geronimo-security-builder</artifactId>
+                                </episode>
+                            </episodes>
+                            <plugins>
+                                <plugin>
+                                    <groupId>org.apache.geronimo.framework</groupId>
+                                    <artifactId>geronimo-service-builder</artifactId>
+                                </plugin>
+                                <plugin>
+                                    <groupId>org.apache.geronimo.modules</groupId>
+                                    <artifactId>geronimo-j2ee-builder</artifactId>
+                                </plugin>
+                                <plugin>
+                                    <groupId>org.apache.geronimo.modules</groupId>
+                                    <artifactId>geronimo-security-builder</artifactId>
+                                </plugin>
+                            </plugins>
+                        </configuration>
+                    </plugin>
+
+                </plugins>
+            </build>
+        </profile>
+    </profiles>
 
 </project>
 

Modified: geronimo/server/branches/3.0-osgi/plugins/tomcat/geronimo-tomcat7-builder/src/main/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/3.0-osgi/plugins/tomcat/geronimo-tomcat7-builder/src/main/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilder.java?rev=1098803&r1=1098802&r2=1098803&view=diff
==============================================================================
--- geronimo/server/branches/3.0-osgi/plugins/tomcat/geronimo-tomcat7-builder/src/main/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilder.java (original)
+++ geronimo/server/branches/3.0-osgi/plugins/tomcat/geronimo-tomcat7-builder/src/main/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilder.java Mon May  2 21:49:44 2011
@@ -17,8 +17,6 @@
 
 package org.apache.geronimo.tomcat.deployment;
 
-import static java.lang.Boolean.TRUE;
-
 import java.io.File;
 import java.io.IOException;
 import java.io.InputStream;
@@ -26,15 +24,13 @@ import java.net.URL;
 import java.util.Collection;
 import java.util.Collections;
 import java.util.HashMap;
-import java.util.HashSet;
 import java.util.LinkedHashSet;
 import java.util.Map;
-import java.util.Set;
 import java.util.jar.JarFile;
 
 import javax.servlet.Servlet;
 import javax.xml.bind.JAXBException;
-
+import javax.xml.stream.XMLStreamException;
 import org.apache.geronimo.common.DeploymentException;
 import org.apache.geronimo.deployment.Deployable;
 import org.apache.geronimo.deployment.DeployableBundle;
@@ -43,12 +39,10 @@ import org.apache.geronimo.deployment.Mo
 import org.apache.geronimo.deployment.NamespaceDrivenBuilder;
 import org.apache.geronimo.deployment.NamespaceDrivenBuilderCollection;
 import org.apache.geronimo.deployment.service.EnvironmentBuilder;
-import org.apache.geronimo.deployment.xbeans.EnvironmentType;
-import org.apache.geronimo.deployment.xmlbeans.XmlBeansUtil;
+import org.apache.geronimo.deployment.service.plan.EnvironmentType;
 import org.apache.geronimo.gbean.AbstractName;
 import org.apache.geronimo.gbean.AbstractNameQuery;
 import org.apache.geronimo.gbean.GBeanData;
-import org.apache.geronimo.gbean.GBeanInfoBuilder;
 import org.apache.geronimo.gbean.GBeanLifecycle;
 import org.apache.geronimo.gbean.ReferencePatterns;
 import org.apache.geronimo.gbean.annotation.GBean;
@@ -68,7 +62,6 @@ import org.apache.geronimo.kernel.Naming
 import org.apache.geronimo.kernel.repository.Environment;
 import org.apache.geronimo.kernel.util.FileUtils;
 import org.apache.geronimo.kernel.util.JarUtils;
-import org.apache.geronimo.naming.deployment.ENCConfigBuilder;
 import org.apache.geronimo.naming.deployment.GBeanResourceEnvironmentBuilder;
 import org.apache.geronimo.naming.deployment.ResourceEnvironmentSetter;
 import org.apache.geronimo.openwebbeans.SharedOwbContext;
@@ -80,37 +73,31 @@ import org.apache.geronimo.tomcat.RealmG
 import org.apache.geronimo.tomcat.TomcatWebAppContext;
 import org.apache.geronimo.tomcat.ValveGBean;
 import org.apache.geronimo.tomcat.cluster.CatalinaClusterGBean;
+import org.apache.geronimo.tomcat.deployment.model.ContextType;
+import org.apache.geronimo.tomcat.deployment.model.JaxbUtil;
+import org.apache.geronimo.tomcat.deployment.model.ParameterType;
+import org.apache.geronimo.tomcat.deployment.model.TomcatConfigType;
+import org.apache.geronimo.tomcat.deployment.model.TomcatObjectFactory;
+import org.apache.geronimo.tomcat.deployment.model.TomcatWebAppType;
 import org.apache.geronimo.tomcat.util.SecurityHolder;
 import org.apache.geronimo.web.WebAttributeName;
-import org.apache.geronimo.web.deployment.GenericToSpecificPlanConverter;
 import org.apache.geronimo.web.info.ServletInfo;
 import org.apache.geronimo.web.info.WebAppInfo;
 import org.apache.geronimo.web25.deployment.AbstractWebModuleBuilder;
 import org.apache.geronimo.web25.deployment.StandardWebAppInfoFactory;
 import org.apache.geronimo.web25.deployment.WebAppInfoBuilder;
 import org.apache.geronimo.web25.deployment.WebAppInfoFactory;
-import org.apache.geronimo.web25.deployment.security.AuthenticationWrapper;
-import org.apache.geronimo.xbeans.geronimo.jaspi.JaspiAuthModuleType;
-import org.apache.geronimo.xbeans.geronimo.jaspi.JaspiConfigProviderType;
-import org.apache.geronimo.xbeans.geronimo.jaspi.JaspiServerAuthConfigType;
-import org.apache.geronimo.xbeans.geronimo.jaspi.JaspiServerAuthContextType;
-import org.apache.geronimo.xbeans.geronimo.web.tomcat.TomcatAuthenticationType;
-import org.apache.geronimo.xbeans.geronimo.web.tomcat.TomcatContextType;
-import org.apache.geronimo.xbeans.geronimo.web.tomcat.TomcatParameterType;
-import org.apache.geronimo.xbeans.geronimo.web.tomcat.TomcatWebAppDocument;
-import org.apache.geronimo.xbeans.geronimo.web.tomcat.TomcatWebAppType;
-import org.apache.geronimo.xbeans.geronimo.web.tomcat.config.GerTomcatDocument;
+import org.apache.geronimo.web25.deployment.model.ObjectFactory;
+import org.apache.geronimo.web25.deployment.model.WebAppType;
 import org.apache.openejb.jee.JaxbJavaee;
 import org.apache.openejb.jee.WebApp;
 import org.apache.xbean.osgi.bundle.util.BundleUtils;
-import org.apache.xmlbeans.XmlException;
-import org.apache.xmlbeans.XmlObject;
 import org.osgi.framework.Bundle;
 import org.osgi.framework.BundleContext;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
+
+import static java.lang.Boolean.TRUE;
 
 /**
  * @version $Rev:385659 $ $Date$
@@ -120,49 +107,48 @@ public class TomcatModuleBuilder extends
 
     private static final Logger log = LoggerFactory.getLogger(TomcatModuleBuilder.class);
 
-    private static final String TOMCAT_NAMESPACE = TomcatWebAppDocument.type.getDocumentElementName().getNamespaceURI();
-    private static final Map<String, String> NAMESPACE_UPDATES = new HashMap<String, String>();
-    private static final Set<String> INGORED_ELEMENT_NAMES = new HashSet<String>();
-    private static final Set<String> INGORED_CONTEXT_ATTRIBUTE_NAMES = new HashSet<String>();
-    static {
-        NAMESPACE_UPDATES.put("http://geronimo.apache.org/xml/ns/web", "http://geronimo.apache.org/xml/ns/j2ee/web-2.0.1");
-        NAMESPACE_UPDATES.put("http://geronimo.apache.org/xml/ns/j2ee/web-1.1", "http://geronimo.apache.org/xml/ns/j2ee/web-2.0.1");
-        NAMESPACE_UPDATES.put("http://geronimo.apache.org/xml/ns/j2ee/web-1.2", "http://geronimo.apache.org/xml/ns/j2ee/web-2.0.1");
-        NAMESPACE_UPDATES.put("http://geronimo.apache.org/xml/ns/j2ee/web-2.0", "http://geronimo.apache.org/xml/ns/j2ee/web-2.0.1");
-        NAMESPACE_UPDATES.put("http://geronimo.apache.org/xml/ns/web/tomcat", "http://geronimo.apache.org/xml/ns/j2ee/web/tomcat-2.0.1");
-        NAMESPACE_UPDATES.put("http://geronimo.apache.org/xml/ns/j2ee/web/tomcat-1.1", "http://geronimo.apache.org/xml/ns/j2ee/web/tomcat-2.0.1");
-        NAMESPACE_UPDATES.put("http://geronimo.apache.org/xml/ns/j2ee/web/tomcat-1.2", "http://geronimo.apache.org/xml/ns/j2ee/web/tomcat-2.0.1");
-        NAMESPACE_UPDATES.put("http://geronimo.apache.org/xml/ns/j2ee/web/tomcat-2.0", "http://geronimo.apache.org/xml/ns/j2ee/web/tomcat-2.0.1");
-        NAMESPACE_UPDATES.put("http://geronimo.apache.org/xml/ns/web/tomcat/config", "http://geronimo.apache.org/xml/ns/j2ee/web/tomcat/config-1.0");
-
-        INGORED_ELEMENT_NAMES.add("context-priority-classloader");
-        INGORED_ELEMENT_NAMES.add("configId");
-        INGORED_ELEMENT_NAMES.add("parentId");
-
-        INGORED_CONTEXT_ATTRIBUTE_NAMES.add("className".toLowerCase());
-        INGORED_CONTEXT_ATTRIBUTE_NAMES.add("xmlNamespaceAware".toLowerCase());
-        INGORED_CONTEXT_ATTRIBUTE_NAMES.add("processTlds".toLowerCase());
-        INGORED_CONTEXT_ATTRIBUTE_NAMES.add("unpackWAR".toLowerCase());
-        INGORED_CONTEXT_ATTRIBUTE_NAMES.add("xmlValidation".toLowerCase());
-        INGORED_CONTEXT_ATTRIBUTE_NAMES.add("path");
-        INGORED_CONTEXT_ATTRIBUTE_NAMES.add("useNaming".toLowerCase());
-        INGORED_CONTEXT_ATTRIBUTE_NAMES.add("javaVMs".toLowerCase());
-        INGORED_CONTEXT_ATTRIBUTE_NAMES.add("server");
-        INGORED_CONTEXT_ATTRIBUTE_NAMES.add("j2EEApplication".toLowerCase());
-        INGORED_CONTEXT_ATTRIBUTE_NAMES.add("j2EEServer".toLowerCase());
-        INGORED_CONTEXT_ATTRIBUTE_NAMES.add("path");
-        INGORED_CONTEXT_ATTRIBUTE_NAMES.add("delegate");
-        INGORED_CONTEXT_ATTRIBUTE_NAMES.add("docBase".toLowerCase());
-    }
+    private static final String TOMCAT_NAMESPACE = TomcatObjectFactory._Tomcat_QNAME.getNamespaceURI();
+////    private static final Map<String, String> NAMESPACE_UPDATES = new HashMap<String, String>();
+////    private static final Set<String> INGORED_ELEMENT_NAMES = new HashSet<String>();
+////    private static final Set<String> INGORED_CONTEXT_ATTRIBUTE_NAMES = new HashSet<String>();
+//    static {
+//        NAMESPACE_UPDATES.put("http://geronimo.apache.org/xml/ns/web", "http://geronimo.apache.org/xml/ns/j2ee/web-2.0.1");
+//        NAMESPACE_UPDATES.put("http://geronimo.apache.org/xml/ns/j2ee/web-1.1", "http://geronimo.apache.org/xml/ns/j2ee/web-2.0.1");
+//        NAMESPACE_UPDATES.put("http://geronimo.apache.org/xml/ns/j2ee/web-1.2", "http://geronimo.apache.org/xml/ns/j2ee/web-2.0.1");
+//        NAMESPACE_UPDATES.put("http://geronimo.apache.org/xml/ns/j2ee/web-2.0", "http://geronimo.apache.org/xml/ns/j2ee/web-2.0.1");
+//        NAMESPACE_UPDATES.put("http://geronimo.apache.org/xml/ns/web/tomcat", "http://geronimo.apache.org/xml/ns/j2ee/web/tomcat-2.0.1");
+//        NAMESPACE_UPDATES.put("http://geronimo.apache.org/xml/ns/j2ee/web/tomcat-1.1", "http://geronimo.apache.org/xml/ns/j2ee/web/tomcat-2.0.1");
+//        NAMESPACE_UPDATES.put("http://geronimo.apache.org/xml/ns/j2ee/web/tomcat-1.2", "http://geronimo.apache.org/xml/ns/j2ee/web/tomcat-2.0.1");
+//        NAMESPACE_UPDATES.put("http://geronimo.apache.org/xml/ns/j2ee/web/tomcat-2.0", "http://geronimo.apache.org/xml/ns/j2ee/web/tomcat-2.0.1");
+//        NAMESPACE_UPDATES.put("http://geronimo.apache.org/xml/ns/web/tomcat/config", "http://geronimo.apache.org/xml/ns/j2ee/web/tomcat/config-1.0");
+//
+//        INGORED_ELEMENT_NAMES.add("context-priority-classloader");
+//        INGORED_ELEMENT_NAMES.add("configId");
+//        INGORED_ELEMENT_NAMES.add("parentId");
+//
+//        INGORED_CONTEXT_ATTRIBUTE_NAMES.add("className".toLowerCase());
+//        INGORED_CONTEXT_ATTRIBUTE_NAMES.add("xmlNamespaceAware".toLowerCase());
+//        INGORED_CONTEXT_ATTRIBUTE_NAMES.add("processTlds".toLowerCase());
+//        INGORED_CONTEXT_ATTRIBUTE_NAMES.add("unpackWAR".toLowerCase());
+//        INGORED_CONTEXT_ATTRIBUTE_NAMES.add("xmlValidation".toLowerCase());
+//        INGORED_CONTEXT_ATTRIBUTE_NAMES.add("path");
+//        INGORED_CONTEXT_ATTRIBUTE_NAMES.add("useNaming".toLowerCase());
+//        INGORED_CONTEXT_ATTRIBUTE_NAMES.add("javaVMs".toLowerCase());
+//        INGORED_CONTEXT_ATTRIBUTE_NAMES.add("server");
+//        INGORED_CONTEXT_ATTRIBUTE_NAMES.add("j2EEApplication".toLowerCase());
+//        INGORED_CONTEXT_ATTRIBUTE_NAMES.add("j2EEServer".toLowerCase());
+//        INGORED_CONTEXT_ATTRIBUTE_NAMES.add("path");
+//        INGORED_CONTEXT_ATTRIBUTE_NAMES.add("delegate");
+//        INGORED_CONTEXT_ATTRIBUTE_NAMES.add("docBase".toLowerCase());
+//    }
 
-    private final Environment defaultEnvironment;
     private final AbstractNameQuery tomcatContainerName;
     protected final NamespaceDrivenBuilderCollection clusteringBuilders;
 
     public static final String GBEAN_REF_CLUSTERING_BUILDERS = "ClusteringBuilders";
     private final WebAppInfoFactory webAppInfoFactory;
 
-    public TomcatModuleBuilder(@ParamAttribute(name = "defaultEnvironment") Environment defaultEnvironment,
+    public TomcatModuleBuilder(
             @ParamAttribute(name = "tomcatContainerName") AbstractNameQuery tomcatContainerName,
             @ParamAttribute(name = "defaultWebApp") WebAppInfo defaultWebApp,
             @ParamAttribute(name = "jspServlet") WebAppInfo jspServlet,
@@ -175,7 +161,6 @@ public class TomcatModuleBuilder extends
             @ParamSpecial(type = SpecialAttributeType.kernel) Kernel kernel,
             @ParamSpecial(type = SpecialAttributeType.bundleContext) BundleContext bundleContext) {
         super(kernel, serviceBuilders, namingBuilders, resourceEnvironmentSetter, webServiceBuilder, moduleBuilderExtensions, bundleContext);
-        this.defaultEnvironment = defaultEnvironment;
         this.clusteringBuilders = new NamespaceDrivenBuilderCollection(clusteringBuilders);
         this.tomcatContainerName = tomcatContainerName;
         ServletInfo jspServletInfo;
@@ -189,11 +174,11 @@ public class TomcatModuleBuilder extends
     }
 
     public void doStart() throws Exception {
-        XmlBeansUtil.registerNamespaceUpdates(NAMESPACE_UPDATES);
+//        XmlBeansUtil.registerNamespaceUpdates(NAMESPACE_UPDATES);
     }
 
     public void doStop() {
-        XmlBeansUtil.unregisterNamespaceUpdates(NAMESPACE_UPDATES);
+//        XmlBeansUtil.unregisterNamespaceUpdates(NAMESPACE_UPDATES);
     }
 
     public void doFail() {
@@ -238,10 +223,10 @@ public class TomcatModuleBuilder extends
 
         Deployable deployable = new DeployableBundle(bundle);
         // parse vendor dd
-        TomcatWebAppType tomcatWebApp = getTomcatWebApp(null, deployable, standAlone, targetPath, webApp);
+        WebAppType tomcatWebApp = getTomcatWebApp(null, deployable, standAlone, targetPath, webApp);
 
         EnvironmentType environmentType = tomcatWebApp.getEnvironment();
-        Environment environment = EnvironmentBuilder.buildEnvironment(environmentType, defaultEnvironment);
+        Environment environment = EnvironmentBuilder.buildEnvironment(environmentType);
 
         if (webApp.getDistributable().size() == 1) {
             clusteringBuilders.buildEnvironment(tomcatWebApp, environment);
@@ -262,7 +247,7 @@ public class TomcatModuleBuilder extends
             name = bundle.getSymbolicName();
         }
 
-        WebModule module = new WebModule(standAlone, moduleName, name, environment, deployable, targetPath, webApp, tomcatWebApp, specDD, contextPath, TOMCAT_NAMESPACE, shareJndi(null), null);
+        WebModule<WebAppType> module = new WebModule<WebAppType>(standAlone, moduleName, name, environment, deployable, targetPath, webApp, tomcatWebApp, specDD, contextPath, TOMCAT_NAMESPACE, shareJndi(null), null);
         for (ModuleBuilderExtension mbe : moduleBuilderExtensions) {
             mbe.createModule(module, bundle, naming, idBuilder);
         }
@@ -314,11 +299,11 @@ public class TomcatModuleBuilder extends
         Deployable deployable = new DeployableJarFile(moduleFile);
         // parse vendor dd
         boolean standAlone = earEnvironment == null;
-        TomcatWebAppType tomcatWebApp = getTomcatWebApp(plan, deployable, standAlone, targetPath, webApp);
+        WebAppType tomcatWebApp = getTomcatWebApp(plan, deployable, standAlone, targetPath, webApp);
         contextRoot = getContextRoot(tomcatWebApp, contextRoot, webApp, standAlone, moduleFile, targetPath);
 
         EnvironmentType environmentType = tomcatWebApp.getEnvironment();
-        Environment environment = EnvironmentBuilder.buildEnvironment(environmentType, defaultEnvironment);
+        Environment environment = EnvironmentBuilder.buildEnvironment(environmentType);
 
         if (webApp.getDistributable().size() == 1) {
             clusteringBuilders.buildEnvironment(tomcatWebApp, environment);
@@ -355,16 +340,16 @@ public class TomcatModuleBuilder extends
             }
         }
 
-        WebModule module = new WebModule(standAlone, moduleName, name, environment, deployable, targetPath, webApp, tomcatWebApp, specDD, contextRoot, TOMCAT_NAMESPACE, shareJndi(parentModule), parentModule);
+        WebModule<WebAppType> module = new WebModule<WebAppType>(standAlone, moduleName, name, environment, deployable, targetPath, webApp, tomcatWebApp, specDD, contextRoot, TOMCAT_NAMESPACE, shareJndi(parentModule), parentModule);
         for (ModuleBuilderExtension mbe : moduleBuilderExtensions) {
             mbe.createModule(module, plan, moduleFile, targetPath, specDDUrl, environment, contextRoot, earName, naming, idBuilder);
         }
         return module;
     }
 
-    private String getContextRoot(TomcatWebAppType tomcatWebApp, String contextRoot, WebApp webApp, boolean standAlone, JarFile moduleFile, String targetPath) {
+    private String getContextRoot(WebAppType tomcatWebApp, String contextRoot, WebApp webApp, boolean standAlone, JarFile moduleFile, String targetPath) {
         //If we have a context root, override everything
-        if (tomcatWebApp.isSetContextRoot()) {
+        if (tomcatWebApp.getContextRoot() != null) {
             contextRoot = tomcatWebApp.getContextRoot();
         } else if (contextRoot == null || contextRoot.trim().equals("")) {
             //Otherwise if no contextRoot was passed in from the ear, then make up a default
@@ -383,16 +368,16 @@ public class TomcatModuleBuilder extends
     }
 
 
-    TomcatWebAppType getTomcatWebApp(Object plan, Deployable deployable, boolean standAlone, String targetPath, WebApp webApp) throws DeploymentException {
-        XmlObject rawPlan = null;
+    WebAppType getTomcatWebApp(Object plan, Deployable deployable, boolean standAlone, String targetPath, WebApp webApp) throws DeploymentException {
         try {
-            // load the geronimo-web.xml from either the supplied plan or from the earFile
+            // load the geronimo-web.xml from either the supplied plan or from the earFile  '
+            WebAppType rawPlan = null;
             try {
-                if (plan instanceof XmlObject) {
-                    rawPlan = (XmlObject) plan;
+                if (plan instanceof WebAppType) {
+                    rawPlan = (WebAppType) plan;
                 } else {
                     if (plan != null) {
-                        rawPlan = XmlBeansUtil.parse(((File) plan).toURI().toURL(), getClass().getClassLoader());
+                        rawPlan = parse(((File) plan).toURI().toURL());
                     } else {
                         URL path = deployable.getResource("WEB-INF/geronimo-web.xml");
                         if (path == null) {
@@ -401,7 +386,7 @@ public class TomcatModuleBuilder extends
                         if (path == null) {
                             log.warn("Web application " + targetPath + " does not contain a WEB-INF/geronimo-web.xml deployment plan.  This may or may not be a problem, depending on whether you have things like resource references that need to be resolved.  You can also give the deployer a separate deployment plan file on the command line.");
                         } else {
-                            rawPlan = XmlBeansUtil.parse(path, getClass().getClassLoader());
+                            rawPlan = parse(path);
                         }
                     }
                 }
@@ -409,27 +394,57 @@ public class TomcatModuleBuilder extends
                 log.warn("Failed to load geronimo-web.xml", e);
             }
 
-            TomcatWebAppType tomcatWebApp;
-            if (rawPlan != null) {
-                XmlObject webPlan = new GenericToSpecificPlanConverter(GerTomcatDocument.type.getDocumentElementName().getNamespaceURI(),
-                        TomcatWebAppDocument.type.getDocumentElementName().getNamespaceURI(), "tomcat").convertToSpecificPlan(rawPlan);
-                tomcatWebApp = (TomcatWebAppType) webPlan.changeType(TomcatWebAppType.type);
-                XmlBeansUtil.validateDD(tomcatWebApp, INGORED_ELEMENT_NAMES);
+            if (rawPlan == null) {
+                rawPlan = createDefaultPlan();
+            }
+
+            TomcatConfigType tomcatConfigType;
+            if (rawPlan.getContainerConfig() instanceof TomcatConfigType) {
+                tomcatConfigType = (TomcatConfigType) rawPlan.getContainerConfig();
             } else {
-                tomcatWebApp = createDefaultPlan();
+                tomcatConfigType = new TomcatConfigType();
+                rawPlan.setContainerConfig(tomcatConfigType);
+            }
+            if (rawPlan instanceof TomcatWebAppType) {
+                TomcatWebAppType tomcatPlan = (TomcatWebAppType) rawPlan;
+                tomcatConfigType.setCluster(tomcatPlan.getCluster());
+                tomcatConfigType.setContext(tomcatPlan.getContext());
+                tomcatConfigType.setCrossContext(tomcatPlan.getCrossContext());
+                tomcatConfigType.setDisableCookies(tomcatPlan.getDisableCookies());
+                tomcatConfigType.setHost(tomcatPlan.getHost());
+                tomcatConfigType.setListenerChain(tomcatPlan.getListenerChain());
+                tomcatConfigType.setManager(tomcatPlan.getManager());
+                tomcatConfigType.setTomcatRealm(tomcatPlan.getTomcatRealm());
+                tomcatConfigType.setValveChain(tomcatPlan.getValveChain());
             }
-            return tomcatWebApp;
-        } catch (XmlException e) {
+            return rawPlan;
+        } catch (Exception e) {
             throw new DeploymentException("xml problem for web app " + targetPath, e);
         }
     }
 
-    private TomcatWebAppType createDefaultPlan() {
-        return TomcatWebAppType.Factory.newInstance();
+    private WebAppType parse(URL path) throws IOException, XMLStreamException, JAXBException {
+        InputStream in = path.openStream();
+        try {
+            return JaxbUtil.unmarshalTomcatWebApp(in, false);
+        } catch (JAXBException e) {
+            InputStream in2 = path.openStream();
+            try {
+                return JaxbUtil.unmarshalWebApp(in2, false);
+            } finally {
+                in2.close();
+            }
+        } finally {
+            in.close();
+        }
+    }
+
+    private WebAppType createDefaultPlan() {
+        return new ObjectFactory().createWebAppType();
     }
 
     @Override
-    protected void postInitContext(EARContext earContext, WebModule webModule, Bundle bundle) throws DeploymentException {
+    protected void postInitContext(EARContext earContext, WebModule<WebAppType> webModule, Bundle bundle) throws DeploymentException {
         for (ModuleBuilderExtension mbe : moduleBuilderExtensions) {
             mbe.initContext(earContext, webModule, bundle);
         }
@@ -441,9 +456,9 @@ public class TomcatModuleBuilder extends
     }
 
     @Override
-    protected void preInitContext(EARContext earContext, WebModule webModule, Bundle bundle) throws DeploymentException {
-        TomcatWebAppType gerWebApp = (TomcatWebAppType) webModule.getVendorDD();
-        boolean hasSecurityRealmName = gerWebApp.isSetSecurityRealmName();
+    protected void preInitContext(EARContext earContext, WebModule<WebAppType> webModule, Bundle bundle) throws DeploymentException {
+        WebAppType gerWebApp = webModule.getVendorDD();
+        boolean hasSecurityRealmName = gerWebApp.getSecurityRealmName() != null;
         webModule.getEarContext().getGeneralData().put(WEB_MODULE_HAS_SECURITY_REALM, hasSecurityRealmName);
     }
 
@@ -451,11 +466,11 @@ public class TomcatModuleBuilder extends
         EARContext moduleContext = module.getEarContext();
         Bundle webBundle = moduleContext.getDeploymentBundle();
         AbstractName moduleName = module.getModuleName();
-        WebModule webModule = (WebModule) module;
+        WebModule<WebAppType> webModule = (WebModule<WebAppType>) module;
 
         WebApp webApp = webModule.getSpecDD();
 
-        TomcatWebAppType tomcatWebApp = (TomcatWebAppType) webModule.getVendorDD();
+        WebAppType tomcatWebApp = webModule.getVendorDD();
 
         GBeanData webModuleData = new GBeanData(moduleName, TomcatWebAppContext.class);
         configureBasicWebModuleAttributes(webApp, tomcatWebApp, moduleContext, earContext, webModule, webModuleData);
@@ -470,61 +485,101 @@ public class TomcatModuleBuilder extends
             // unsharableResources, applicationManagedSecurityResources
             GBeanResourceEnvironmentBuilder rebuilder = new GBeanResourceEnvironmentBuilder(webModuleData);
             //N.B. use earContext not moduleContext
-            resourceEnvironmentSetter.setResourceEnvironment(rebuilder, webApp.getResourceRef(), tomcatWebApp.getResourceRefArray());
+            resourceEnvironmentSetter.setResourceEnvironment(rebuilder, webApp.getResourceRef(), tomcatWebApp.getResourceRef());
 
-            if (tomcatWebApp.isSetWebContainer()) {
-                AbstractNameQuery webContainerName = ENCConfigBuilder.getGBeanQuery(GBeanInfoBuilder.DEFAULT_J2EE_TYPE, tomcatWebApp.getWebContainer());
-                webModuleData.setReferencePattern("Container", webContainerName);
+            if (tomcatWebApp.getWebContainer() != null) {
+                //TODO osgi filter
+//                AbstractNameQuery webContainerName = ENCConfigBuilder.getGBeanQuery(GBeanInfoBuilder.DEFAULT_J2EE_TYPE, tomcatWebApp.getWebContainer());
+//                webModuleData.setReferencePattern("Container", webContainerName);
             } else {
                 webModuleData.setReferencePattern("Container", tomcatContainerName);
             }
 
-            // Process the Tomcat container-config elements
-            if (tomcatWebApp.isSetHost()) {
-                String virtualServer = tomcatWebApp.getHost().trim();
-                webModuleData.setAttribute("virtualServer", virtualServer);
-            }
-
-            if (tomcatWebApp.isSetCrossContext()) {
-                contextAttributes.put("crossContext", "true");
-            }
-
-            if (tomcatWebApp.isSetWorkDir()) {
+            if (tomcatWebApp.getWorkDir() != null) {
                 String workDir = tomcatWebApp.getWorkDir();
                 contextAttributes.put("workDir", workDir);
             }
 
-            if (tomcatWebApp.isSetDisableCookies()) {
-                contextAttributes.put("cookies", "false");
-            }
-
-            if (tomcatWebApp.isSetTomcatRealm()) {
-                String tomcatRealm = tomcatWebApp.getTomcatRealm().trim();
-                AbstractName realmName = earContext.getNaming().createChildName(moduleName, tomcatRealm, RealmGBean.GBEAN_INFO.getJ2eeType());
-                webModuleData.setReferencePattern("TomcatRealm", realmName);
-            }
-            if (tomcatWebApp.isSetValveChain()) {
-                String valveChain = tomcatWebApp.getValveChain().trim();
-                AbstractName valveName = earContext.getNaming().createChildName(moduleName, valveChain, ValveGBean.J2EE_TYPE);
-                webModuleData.setReferencePattern("TomcatValveChain", valveName);
-            }
-
-            if (tomcatWebApp.isSetListenerChain()) {
-                String listenerChain = tomcatWebApp.getListenerChain().trim();
-                AbstractName listenerName = earContext.getNaming().createChildName(moduleName, listenerChain, LifecycleListenerGBean.J2EE_TYPE);
-                webModuleData.setReferencePattern("LifecycleListenerChain", listenerName);
-            }
-
-            if (tomcatWebApp.isSetCluster()) {
-                String cluster = tomcatWebApp.getCluster().trim();
-                AbstractName clusterName = earContext.getNaming().createChildName(moduleName, cluster, CatalinaClusterGBean.J2EE_TYPE);
-                webModuleData.setReferencePattern("Cluster", clusterName);
-            }
+            WebAppInfoBuilder webAppInfoBuilder = new WebAppInfoBuilder(webApp, webAppInfoFactory);
+            WebAppInfo webAppInfo = webAppInfoBuilder.build();
 
-            if (tomcatWebApp.isSetManager()) {
-                String manager = tomcatWebApp.getManager().trim();
-                AbstractName managerName = earContext.getNaming().createChildName(moduleName, manager, ManagerGBean.J2EE_TYPE);
-                webModuleData.setReferencePattern(TomcatWebAppContext.GBEAN_REF_MANAGER_RETRIEVER, managerName);
+            // Process the Tomcat container-config elements
+            TomcatConfigType config = (TomcatConfigType) tomcatWebApp.getContainerConfig();
+            if (config != null) {
+                if (config.getHost() != null) {
+                    String virtualServer = config.getHost().trim();
+                    webModuleData.setAttribute("virtualServer", virtualServer);
+                }
+
+                if (config.getCrossContext() != null) {
+                    contextAttributes.put("crossContext", "true");
+                }
+
+                if (config.getDisableCookies() != null) {
+                    contextAttributes.put("cookies", "false");
+                }
+
+                if (config.getTomcatRealm() != null) {
+                    String tomcatRealm = config.getTomcatRealm().trim();
+                    AbstractName realmName = earContext.getNaming().createChildName(moduleName, tomcatRealm, RealmGBean.GBEAN_INFO.getJ2eeType());
+                    webModuleData.setReferencePattern("TomcatRealm", realmName);
+                }
+                if (config.getValveChain() != null) {
+                    String valveChain = config.getValveChain().trim();
+                    AbstractName valveName = earContext.getNaming().createChildName(moduleName, valveChain, ValveGBean.J2EE_TYPE);
+                    webModuleData.setReferencePattern("TomcatValveChain", valveName);
+                }
+
+                if (config.getListenerChain() != null) {
+                    String listenerChain = config.getListenerChain().trim();
+                    AbstractName listenerName = earContext.getNaming().createChildName(moduleName, listenerChain, LifecycleListenerGBean.J2EE_TYPE);
+                    webModuleData.setReferencePattern("LifecycleListenerChain", listenerName);
+                }
+
+                if (config.getCluster() != null) {
+                    String cluster = config.getCluster().trim();
+                    AbstractName clusterName = earContext.getNaming().createChildName(moduleName, cluster, CatalinaClusterGBean.J2EE_TYPE);
+                    webModuleData.setReferencePattern("Cluster", clusterName);
+                }
+
+                if (config.getManager() != null) {
+                    String manager = config.getManager().trim();
+                    AbstractName managerName = earContext.getNaming().createChildName(moduleName, manager, ManagerGBean.J2EE_TYPE);
+                    webModuleData.setReferencePattern(TomcatWebAppContext.GBEAN_REF_MANAGER_RETRIEVER, managerName);
+                }
+                //Add context attributes and parameters
+                if (config.getContext() != null) {
+                    ContextType context = config.getContext();
+//                    NamedNodeMap namedNodeMap = context.getDomNode().getAttributes();
+//                    for (int i = 0; i < namedNodeMap.getLength(); i++) {
+//                        Node node = namedNodeMap.item(i);
+//                        String attributeName = node.getNodeName();
+//                        if (INGORED_CONTEXT_ATTRIBUTE_NAMES.contains(attributeName.toLowerCase())) {
+//                            if (log.isWarnEnabled()) {
+//                                log.warn("Context attribute " + attributeName + " in the geronimo-web.xml is ignored, as it is not support or Geronimo has already configured it");
+//                            }
+//                            continue;
+//                        }
+//                        if (contextAttributes.containsKey(attributeName)) {
+//                            if (log.isWarnEnabled()) {
+//                                log.warn("Context attribute " + attributeName
+//                                        + " on the context element in geronimo-web.xml is ignored, as it has been explicitly configured with other elements in the geronimo-web.xml file");
+//                            }
+//                            continue;
+//                        }
+//                        contextAttributes.put(node.getNodeName(), node.getNodeValue());
+//                    }
+                    for (ParameterType parameterType : context.getParameter()) {
+                        if (webAppInfo.contextParams.containsKey(parameterType.getName()) && !parameterType.isOverride()) {
+                            if (log.isWarnEnabled()) {
+                                log.warn("Context parameter from geronimo-web.xml is ignored, as a same name context paramter " + parameterType.getName() + " = "
+                                        + webAppInfo.contextParams.get(parameterType.getName()) + " in web.xml, configure override with true to make the value take effect.");
+                            }
+                            continue;
+                        }
+                        webAppInfo.contextParams.put(parameterType.getName(), parameterType.getValue());
+                    }
+                }
             }
 
             Boolean distributable = !webApp.getDistributable().isEmpty();
@@ -535,46 +590,10 @@ public class TomcatModuleBuilder extends
                 }
             }
 
-            WebAppInfoBuilder webAppInfoBuilder = new WebAppInfoBuilder(webApp, webAppInfoFactory);
-            WebAppInfo webAppInfo = webAppInfoBuilder.build();
-
             webModuleData.setAttribute("webAppInfo", webAppInfo);
 
             webModule.getSharedContext().put(WebModule.WEB_APP_INFO, webAppInfoBuilder);
 
-            //Add context attributes and parameters
-            if (tomcatWebApp.isSetContext()) {
-                TomcatContextType context = tomcatWebApp.getContext();
-                NamedNodeMap namedNodeMap = context.getDomNode().getAttributes();
-                for (int i = 0; i < namedNodeMap.getLength(); i++) {
-                    Node node = namedNodeMap.item(i);
-                    String attributeName = node.getNodeName();
-                    if (INGORED_CONTEXT_ATTRIBUTE_NAMES.contains(attributeName.toLowerCase())) {
-                        if (log.isWarnEnabled()) {
-                            log.warn("Context attribute " + attributeName + " in the geronimo-web.xml is ignored, as it is not support or Geronimo has already configured it");
-                        }
-                        continue;
-                    }
-                    if (contextAttributes.containsKey(attributeName)) {
-                        if (log.isWarnEnabled()) {
-                            log.warn("Context attribute " + attributeName
-                                    + " on the context element in geronimo-web.xml is ignored, as it has been explicitly configured with other elements in the geronimo-web.xml file");
-                        }
-                        continue;
-                    }
-                    contextAttributes.put(node.getNodeName(), node.getNodeValue());
-                }
-                for (TomcatParameterType parameterType : context.getParameterArray()) {
-                    if (webAppInfo.contextParams.containsKey(parameterType.getName()) && !parameterType.getOverride()) {
-                        if (log.isWarnEnabled()) {
-                            log.warn("Context parameter from geronimo-web.xml is ignored, as a same name context paramter " + parameterType.getName() + " = "
-                                    + webAppInfo.contextParams.get(parameterType.getName()) + " in web.xml, configure override with true to make the value take effect.");
-                        }
-                        continue;
-                    }
-                    webAppInfo.contextParams.put(parameterType.getName(), parameterType.getValue());
-                }
-            }
             /**
              * The old geronimo-web.xml also support to configure some context attributes individually,
              * let's override them in the contextAttributes
@@ -631,7 +650,7 @@ public class TomcatModuleBuilder extends
 
             webModuleData.setAttribute("webServices", webServices);
 
-            if (tomcatWebApp.isSetSecurityRealmName()) {
+            if (tomcatWebApp.getSecurityRealmName() != null) {
                 if (earContext.getSecurityConfiguration() == null) {
                     throw new DeploymentException("You have specified a <security-realm-name> for the webapp " + moduleName + " but no <security> configuration (role mapping) is supplied in the Geronimo plan for the web application (or the Geronimo plan for the EAR if the web app is in an EAR)");
                 }
@@ -658,9 +677,8 @@ public class TomcatModuleBuilder extends
 
                 webModuleData.setAttribute("securityHolder", securityHolder);
                 //local jaspic configuration
-                if (tomcatWebApp.isSetAuthentication()) {
-                    AuthenticationWrapper authType = new TomcatAuthenticationWrapper(tomcatWebApp.getAuthentication());
-                    configureLocalJaspicProvider(authType, contextPath, module, webModuleData);
+                if (tomcatWebApp.getAuthentication() != null) {
+                    configureLocalJaspicProvider(tomcatWebApp.getAuthentication(), contextPath, module, webModuleData);
                 }
             }
 
@@ -685,7 +703,7 @@ public class TomcatModuleBuilder extends
                     webModuleData.setReferencePattern("SharedOwbContext", name);
                 }
             }
-            if(tomcatWebApp.isSetSecurityRealmName()) {
+            if(tomcatWebApp.getSecurityRealmName() != null) {
                 webModuleData.setReferencePattern("applicationPolicyConfigurationManager", EARContext.JACC_MANAGER_NAME_KEY.get(earContext.getGeneralData()));
             }
             //not truly metadata complete until MBEs have run
@@ -708,46 +726,4 @@ public class TomcatModuleBuilder extends
         return TOMCAT_NAMESPACE;
     }
 
-    private static class TomcatAuthenticationWrapper implements AuthenticationWrapper {
-        private final TomcatAuthenticationType authType;
-
-        private TomcatAuthenticationWrapper(TomcatAuthenticationType authType) {
-            this.authType = authType;
-        }
-
-        public JaspiConfigProviderType getConfigProvider() {
-            return authType.getConfigProvider();
-        }
-
-        public boolean isSetConfigProvider() {
-            return authType.isSetConfigProvider();
-        }
-
-        public JaspiServerAuthConfigType getServerAuthConfig() {
-            return authType.getServerAuthConfig();
-        }
-
-        public boolean isSetServerAuthConfig() {
-            return authType.isSetServerAuthConfig();
-        }
-
-        public JaspiServerAuthContextType getServerAuthContext() {
-            return authType.getServerAuthContext();
-        }
-
-        public boolean isSetServerAuthContext() {
-            return authType.isSetServerAuthContext();
-        }
-
-        public JaspiAuthModuleType getServerAuthModule() {
-            return authType.getServerAuthModule();
-        }
-
-        public boolean isSetServerAuthModule() {
-            return authType.isSetServerAuthModule();
-        }
-    }
-
-
-
 }

Copied: geronimo/server/branches/3.0-osgi/plugins/tomcat/geronimo-tomcat7-builder/src/main/java/org/apache/geronimo/tomcat/deployment/model/AuthenticationType.java (from r1098802, geronimo/server/branches/3.0-osgi/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/model/AuthenticationType.java)
URL: http://svn.apache.org/viewvc/geronimo/server/branches/3.0-osgi/plugins/tomcat/geronimo-tomcat7-builder/src/main/java/org/apache/geronimo/tomcat/deployment/model/AuthenticationType.java?p2=geronimo/server/branches/3.0-osgi/plugins/tomcat/geronimo-tomcat7-builder/src/main/java/org/apache/geronimo/tomcat/deployment/model/AuthenticationType.java&p1=geronimo/server/branches/3.0-osgi/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/model/AuthenticationType.java&r1=1098802&r2=1098803&rev=1098803&view=diff
==============================================================================
--- geronimo/server/branches/3.0-osgi/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/model/AuthenticationType.java (original)
+++ geronimo/server/branches/3.0-osgi/plugins/tomcat/geronimo-tomcat7-builder/src/main/java/org/apache/geronimo/tomcat/deployment/model/AuthenticationType.java Mon May  2 21:49:44 2011
@@ -2,11 +2,11 @@
 // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-2 
 // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
 // Any modifications to this file will be lost upon recompilation of the source schema. 
-// Generated on: 2011.04.27 at 07:52:24 PM PDT 
+// Generated on: 2011.04.29 at 10:50:34 AM PDT 
 //
 
 
-package org.apache.geronimo.web25.deployment.model;
+package org.apache.geronimo.tomcat.deployment.model;
 
 import javax.xml.bind.annotation.XmlAccessType;
 import javax.xml.bind.annotation.XmlAccessorType;
@@ -27,7 +27,7 @@ import org.apache.geronimo.components.ja
  * &lt;complexType name="authenticationType">
  *   &lt;complexContent>
  *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- *       &lt;choice>
+ *       &lt;choice minOccurs="0">
  *         &lt;element ref="{http://geronimo.apache.org/xml/ns/geronimo-jaspi}configProvider"/>
  *         &lt;element ref="{http://geronimo.apache.org/xml/ns/geronimo-jaspi}serverAuthConfig"/>
  *         &lt;element ref="{http://geronimo.apache.org/xml/ns/geronimo-jaspi}serverAuthContext"/>
@@ -47,7 +47,7 @@ import org.apache.geronimo.components.ja
     "serverAuthContext",
     "serverAuthModule"
 })
-public class AuthenticationType {
+public class AuthenticationType extends org.apache.geronimo.web25.deployment.model.AuthenticationType {
 
     @XmlElement(namespace = "http://geronimo.apache.org/xml/ns/geronimo-jaspi")
     protected ConfigProviderType configProvider;

Added: geronimo/server/branches/3.0-osgi/plugins/tomcat/geronimo-tomcat7-builder/src/main/java/org/apache/geronimo/tomcat/deployment/model/ContextType.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/3.0-osgi/plugins/tomcat/geronimo-tomcat7-builder/src/main/java/org/apache/geronimo/tomcat/deployment/model/ContextType.java?rev=1098803&view=auto
==============================================================================
--- geronimo/server/branches/3.0-osgi/plugins/tomcat/geronimo-tomcat7-builder/src/main/java/org/apache/geronimo/tomcat/deployment/model/ContextType.java (added)
+++ geronimo/server/branches/3.0-osgi/plugins/tomcat/geronimo-tomcat7-builder/src/main/java/org/apache/geronimo/tomcat/deployment/model/ContextType.java Mon May  2 21:49:44 2011
@@ -0,0 +1,100 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-2 
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
+// Any modifications to this file will be lost upon recompilation of the source schema. 
+// Generated on: 2011.04.29 at 10:50:34 AM PDT 
+//
+
+
+package org.apache.geronimo.tomcat.deployment.model;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAnyAttribute;
+import javax.xml.bind.annotation.XmlType;
+import javax.xml.namespace.QName;
+
+
+/**
+ * <p>Java class for contextType complex type.
+ * 
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ * 
+ * <pre>
+ * &lt;complexType name="contextType">
+ *   &lt;complexContent>
+ *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       &lt;sequence>
+ *         &lt;element name="parameter" type="{http://geronimo.apache.org/xml/ns/j2ee/web/tomcat-2.0.1}parameterType" maxOccurs="unbounded" minOccurs="0"/>
+ *       &lt;/sequence>
+ *       &lt;anyAttribute processContents='skip'/>
+ *     &lt;/restriction>
+ *   &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ * 
+ * 
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "contextType", propOrder = {
+    "parameter"
+})
+public class ContextType {
+
+    protected List<ParameterType> parameter;
+    @XmlAnyAttribute
+    private Map<QName, String> otherAttributes = new HashMap<QName, String>();
+
+    /**
+     * Gets the value of the parameter property.
+     * 
+     * <p>
+     * This accessor method returns a reference to the live list,
+     * not a snapshot. Therefore any modification you make to the
+     * returned list will be present inside the JAXB object.
+     * This is why there is not a <CODE>set</CODE> method for the parameter property.
+     * 
+     * <p>
+     * For example, to add a new item, do as follows:
+     * <pre>
+     *    getParameter().add(newItem);
+     * </pre>
+     * 
+     * 
+     * <p>
+     * Objects of the following type(s) are allowed in the list
+     * {@link ParameterType }
+     * 
+     * 
+     */
+    public List<ParameterType> getParameter() {
+        if (parameter == null) {
+            parameter = new ArrayList<ParameterType>();
+        }
+        return this.parameter;
+    }
+
+    /**
+     * Gets a map that contains attributes that aren't bound to any typed property on this class.
+     * 
+     * <p>
+     * the map is keyed by the name of the attribute and 
+     * the value is the string value of the attribute.
+     * 
+     * the map returned by this method is live, and you can add new attribute
+     * by updating the map directly. Because of this design, there's no setter.
+     * 
+     * 
+     * @return
+     *     always non-null
+     */
+    public Map<QName, String> getOtherAttributes() {
+        return otherAttributes;
+    }
+
+}

Propchange: geronimo/server/branches/3.0-osgi/plugins/tomcat/geronimo-tomcat7-builder/src/main/java/org/apache/geronimo/tomcat/deployment/model/ContextType.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/branches/3.0-osgi/plugins/tomcat/geronimo-tomcat7-builder/src/main/java/org/apache/geronimo/tomcat/deployment/model/ContextType.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/branches/3.0-osgi/plugins/tomcat/geronimo-tomcat7-builder/src/main/java/org/apache/geronimo/tomcat/deployment/model/ContextType.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/server/branches/3.0-osgi/plugins/tomcat/geronimo-tomcat7-builder/src/main/java/org/apache/geronimo/tomcat/deployment/model/EmptyType.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/3.0-osgi/plugins/tomcat/geronimo-tomcat7-builder/src/main/java/org/apache/geronimo/tomcat/deployment/model/EmptyType.java?rev=1098803&view=auto
==============================================================================
--- geronimo/server/branches/3.0-osgi/plugins/tomcat/geronimo-tomcat7-builder/src/main/java/org/apache/geronimo/tomcat/deployment/model/EmptyType.java (added)
+++ geronimo/server/branches/3.0-osgi/plugins/tomcat/geronimo-tomcat7-builder/src/main/java/org/apache/geronimo/tomcat/deployment/model/EmptyType.java Mon May  2 21:49:44 2011
@@ -0,0 +1,37 @@
+//
+// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.1-2 
+// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
+// Any modifications to this file will be lost upon recompilation of the source schema. 
+// Generated on: 2011.04.29 at 10:50:34 AM PDT 
+//
+
+
+package org.apache.geronimo.tomcat.deployment.model;
+
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlType;
+
+
+/**
+ * <p>Java class for emptyType complex type.
+ * 
+ * <p>The following schema fragment specifies the expected content contained within this class.
+ * 
+ * <pre>
+ * &lt;complexType name="emptyType">
+ *   &lt;complexContent>
+ *     &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *     &lt;/restriction>
+ *   &lt;/complexContent>
+ * &lt;/complexType>
+ * </pre>
+ * 
+ * 
+ */
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "emptyType")
+public class EmptyType {
+
+
+}



Mime
View raw message