geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From xuhaih...@apache.org
Subject svn commit: r939982 [2/3] - in /geronimo/server/trunk: framework/modules/ framework/modules/geronimo-security/src/main/java/org/apache/geronimo/security/jacc/ framework/modules/geronimo-security/src/main/java/org/apache/geronimo/security/jacc/mappingpr...
Date Sat, 01 May 2010 11:51:08 GMT
Modified: geronimo/server/trunk/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/merge/webfragment/ResourceEnvRefMergeHandler.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/merge/webfragment/ResourceEnvRefMergeHandler.java?rev=939982&r1=939981&r2=939982&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/merge/webfragment/ResourceEnvRefMergeHandler.java (original)
+++ geronimo/server/trunk/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/merge/webfragment/ResourceEnvRefMergeHandler.java Sat May  1 11:51:06 2010
@@ -22,8 +22,8 @@ import org.apache.geronimo.web25.deploym
 import org.apache.geronimo.web25.deployment.merge.MergeContext;
 import org.apache.geronimo.web25.deployment.merge.MergeItem;
 import org.apache.geronimo.web25.deployment.utils.WebDeploymentMessageUtils;
-import org.apache.geronimo.xbeans.javaee6.ResourceEnvRefType;
 import org.apache.geronimo.xbeans.javaee6.InjectionTargetType;
+import org.apache.geronimo.xbeans.javaee6.ResourceEnvRefType;
 import org.apache.geronimo.xbeans.javaee6.WebAppType;
 import org.apache.geronimo.xbeans.javaee6.WebFragmentType;
 

Modified: geronimo/server/trunk/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/merge/webfragment/ResourceRefMergeHandler.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/merge/webfragment/ResourceRefMergeHandler.java?rev=939982&r1=939981&r2=939982&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/merge/webfragment/ResourceRefMergeHandler.java (original)
+++ geronimo/server/trunk/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/merge/webfragment/ResourceRefMergeHandler.java Sat May  1 11:51:06 2010
@@ -22,8 +22,8 @@ import org.apache.geronimo.web25.deploym
 import org.apache.geronimo.web25.deployment.merge.MergeContext;
 import org.apache.geronimo.web25.deployment.merge.MergeItem;
 import org.apache.geronimo.web25.deployment.utils.WebDeploymentMessageUtils;
-import org.apache.geronimo.xbeans.javaee6.ResourceRefType;
 import org.apache.geronimo.xbeans.javaee6.InjectionTargetType;
+import org.apache.geronimo.xbeans.javaee6.ResourceRefType;
 import org.apache.geronimo.xbeans.javaee6.WebAppType;
 import org.apache.geronimo.xbeans.javaee6.WebFragmentType;
 

Modified: geronimo/server/trunk/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/merge/webfragment/ServiceRefMergeHandler.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/merge/webfragment/ServiceRefMergeHandler.java?rev=939982&r1=939981&r2=939982&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/merge/webfragment/ServiceRefMergeHandler.java (original)
+++ geronimo/server/trunk/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/merge/webfragment/ServiceRefMergeHandler.java Sat May  1 11:51:06 2010
@@ -22,8 +22,8 @@ import org.apache.geronimo.web25.deploym
 import org.apache.geronimo.web25.deployment.merge.MergeContext;
 import org.apache.geronimo.web25.deployment.merge.MergeItem;
 import org.apache.geronimo.web25.deployment.utils.WebDeploymentMessageUtils;
-import org.apache.geronimo.xbeans.javaee6.ServiceRefType;
 import org.apache.geronimo.xbeans.javaee6.InjectionTargetType;
+import org.apache.geronimo.xbeans.javaee6.ServiceRefType;
 import org.apache.geronimo.xbeans.javaee6.WebAppType;
 import org.apache.geronimo.xbeans.javaee6.WebFragmentType;
 

Modified: geronimo/server/trunk/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/merge/webfragment/ServletMappingMergeHandler.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/merge/webfragment/ServletMappingMergeHandler.java?rev=939982&r1=939981&r2=939982&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/merge/webfragment/ServletMappingMergeHandler.java (original)
+++ geronimo/server/trunk/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/merge/webfragment/ServletMappingMergeHandler.java Sat May  1 11:51:06 2010
@@ -19,6 +19,7 @@ package org.apache.geronimo.web25.deploy
 
 import java.util.ArrayList;
 import java.util.List;
+
 import org.apache.geronimo.common.DeploymentException;
 import org.apache.geronimo.web25.deployment.merge.ElementSource;
 import org.apache.geronimo.web25.deployment.merge.MergeContext;

Modified: geronimo/server/trunk/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/merge/webfragment/ServletMergeHandler.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/merge/webfragment/ServletMergeHandler.java?rev=939982&r1=939981&r2=939982&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/merge/webfragment/ServletMergeHandler.java (original)
+++ geronimo/server/trunk/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/merge/webfragment/ServletMergeHandler.java Sat May  1 11:51:06 2010
@@ -19,6 +19,7 @@ package org.apache.geronimo.web25.deploy
 
 import java.util.ArrayList;
 import java.util.List;
+
 import org.apache.geronimo.common.DeploymentException;
 import org.apache.geronimo.web25.deployment.merge.MergeContext;
 import org.apache.geronimo.xbeans.javaee6.ServletType;

Modified: geronimo/server/trunk/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/security/AuthenticationWrapper.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/security/AuthenticationWrapper.java?rev=939982&r1=939981&r2=939982&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/security/AuthenticationWrapper.java (original)
+++ geronimo/server/trunk/plugins/j2ee/geronimo-web-2.5-builder/src/main/java/org/apache/geronimo/web25/deployment/security/AuthenticationWrapper.java Sat May  1 11:51:06 2010
@@ -21,9 +21,9 @@
 package org.apache.geronimo.web25.deployment.security;
 
 import org.apache.geronimo.xbeans.geronimo.jaspi.JaspiAuthModuleType;
-import org.apache.geronimo.xbeans.geronimo.jaspi.JaspiServerAuthContextType;
-import org.apache.geronimo.xbeans.geronimo.jaspi.JaspiServerAuthConfigType;
 import org.apache.geronimo.xbeans.geronimo.jaspi.JaspiConfigProviderType;
+import org.apache.geronimo.xbeans.geronimo.jaspi.JaspiServerAuthConfigType;
+import org.apache.geronimo.xbeans.geronimo.jaspi.JaspiServerAuthContextType;
 
 /**
  * Wrapper interface for jetty and tomcat Authentication elemens.  Need jaxb :-)

Modified: geronimo/server/trunk/plugins/j2ee/geronimo-web-2.5-builder/src/test/java/org/apache/geronimo/web/deployment/GenericToSpecificPlanConverterTest.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/j2ee/geronimo-web-2.5-builder/src/test/java/org/apache/geronimo/web/deployment/GenericToSpecificPlanConverterTest.java?rev=939982&r1=939981&r2=939982&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/j2ee/geronimo-web-2.5-builder/src/test/java/org/apache/geronimo/web/deployment/GenericToSpecificPlanConverterTest.java (original)
+++ geronimo/server/trunk/plugins/j2ee/geronimo-web-2.5-builder/src/test/java/org/apache/geronimo/web/deployment/GenericToSpecificPlanConverterTest.java Sat May  1 11:51:06 2010
@@ -25,6 +25,7 @@ import java.util.Map;
 import javax.xml.namespace.QName;
 
 import junit.framework.TestCase;
+
 import org.apache.geronimo.deployment.xmlbeans.XmlBeansUtil;
 import org.apache.geronimo.schema.ElementConverter;
 import org.apache.geronimo.schema.NamespaceElementConverter;

Modified: geronimo/server/trunk/plugins/j2ee/geronimo-web-2.5-builder/src/test/java/org/apache/geronimo/web/deployment/WebAppDConfigTest.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/j2ee/geronimo-web-2.5-builder/src/test/java/org/apache/geronimo/web/deployment/WebAppDConfigTest.java?rev=939982&r1=939981&r2=939982&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/j2ee/geronimo-web-2.5-builder/src/test/java/org/apache/geronimo/web/deployment/WebAppDConfigTest.java (original)
+++ geronimo/server/trunk/plugins/j2ee/geronimo-web-2.5-builder/src/test/java/org/apache/geronimo/web/deployment/WebAppDConfigTest.java Sat May  1 11:51:06 2010
@@ -26,6 +26,7 @@ import javax.enterprise.deploy.model.DDB
 import javax.enterprise.deploy.spi.DeploymentConfiguration;
 
 import junit.framework.TestCase;
+
 import org.apache.geronimo.deployment.tools.loader.WebDeployable;
 import org.apache.geronimo.kernel.osgi.MockBundle;
 import org.osgi.framework.Bundle;

Modified: geronimo/server/trunk/plugins/j2ee/geronimo-web-2.5-builder/src/test/java/org/apache/geronimo/web25/deployment/SchemaConversionTest.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/j2ee/geronimo-web-2.5-builder/src/test/java/org/apache/geronimo/web25/deployment/SchemaConversionTest.java?rev=939982&r1=939981&r2=939982&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/j2ee/geronimo-web-2.5-builder/src/test/java/org/apache/geronimo/web25/deployment/SchemaConversionTest.java (original)
+++ geronimo/server/trunk/plugins/j2ee/geronimo-web-2.5-builder/src/test/java/org/apache/geronimo/web25/deployment/SchemaConversionTest.java Sat May  1 11:51:06 2010
@@ -18,23 +18,24 @@
 package org.apache.geronimo.web25.deployment;
 
 import java.net.URL;
-import java.util.List;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Collections;
+import java.util.List;
 import java.util.jar.JarFile;
 
-import org.apache.geronimo.kernel.repository.Environment;
-import org.apache.geronimo.testsupport.XmlBeansTestSupport;
-import org.apache.geronimo.j2ee.deployment.Module;
-import org.apache.geronimo.j2ee.deployment.EARContext;
+import org.apache.geronimo.common.DeploymentException;
+import org.apache.geronimo.deployment.ModuleIDBuilder;
 import org.apache.geronimo.gbean.AbstractName;
-import org.apache.geronimo.kernel.Naming;
+import org.apache.geronimo.j2ee.deployment.EARContext;
+import org.apache.geronimo.j2ee.deployment.Module;
 import org.apache.geronimo.kernel.Kernel;
-import org.apache.geronimo.deployment.ModuleIDBuilder;
-import org.apache.geronimo.common.DeploymentException;
-import org.apache.xmlbeans.XmlObject;
+import org.apache.geronimo.kernel.Naming;
+import org.apache.geronimo.kernel.repository.Environment;
+import org.apache.geronimo.schema.SchemaConversionUtils;
+import org.apache.geronimo.testsupport.XmlBeansTestSupport;
 import org.apache.xmlbeans.XmlException;
+import org.apache.xmlbeans.XmlObject;
 import org.apache.xmlbeans.XmlOptions;
 import org.osgi.framework.Bundle;
 
@@ -51,14 +52,14 @@ public class SchemaConversionTest extend
         URL srcXml = classLoader.getResource("javaee_5schema/web-2-25.xml");
         URL expectedOutputXml = classLoader.getResource("javaee_6schema/web-2-30.xml");
         XmlObject xmlObject = XmlObject.Factory.parse(srcXml, options);
-        xmlObject = webModuleBuilder.convertToServletSchema(xmlObject);
+        xmlObject = SchemaConversionUtils.convertToServletSchema(xmlObject);
         XmlObject expected = XmlObject.Factory.parse(expectedOutputXml);
         log.debug(xmlObject.toString());
         log.debug(expected.toString());
         List problems = new ArrayList();
         boolean ok = compareXmlObjects(xmlObject, expected, problems);
         assertTrue("Differences: " + problems, ok);
-        xmlObject = webModuleBuilder.convertToServletSchema(xmlObject);
+        xmlObject = SchemaConversionUtils.convertToServletSchema(xmlObject);
         boolean ok2 = compareXmlObjects(xmlObject, expected, problems);
         assertTrue("Differences: " + problems, ok2);
     }
@@ -67,14 +68,14 @@ public class SchemaConversionTest extend
         URL srcXml = classLoader.getResource("j2ee_1_4schema/web-2-24.xml");
         URL expectedOutputXml = classLoader.getResource("javaee_6schema/web-2-30.xml");
         XmlObject xmlObject = XmlObject.Factory.parse(srcXml, options);
-        xmlObject = webModuleBuilder.convertToServletSchema(xmlObject);
+        xmlObject = SchemaConversionUtils.convertToServletSchema(xmlObject);
         XmlObject expected = XmlObject.Factory.parse(expectedOutputXml);
         log.debug(xmlObject.toString());
         log.debug(expected.toString());
         List problems = new ArrayList();
         boolean ok = compareXmlObjects(xmlObject, expected, problems);
         assertTrue("Differences: " + problems, ok);
-        xmlObject = webModuleBuilder.convertToServletSchema(xmlObject);
+        xmlObject = SchemaConversionUtils.convertToServletSchema(xmlObject);
         boolean ok2 = compareXmlObjects(xmlObject, expected, problems);
         assertTrue("Differences: " + problems, ok2);
     }
@@ -83,14 +84,14 @@ public class SchemaConversionTest extend
         URL srcXml = classLoader.getResource("j2ee_1_3dtd/web-23.xml");
         URL expectedOutputXml = classLoader.getResource("j2ee_1_3dtd/web-30.xml");
         XmlObject xmlObject = XmlObject.Factory.parse(srcXml);
-        xmlObject = webModuleBuilder.convertToServletSchema(xmlObject);
+        xmlObject = SchemaConversionUtils.convertToServletSchema(xmlObject);
         XmlObject expected = XmlObject.Factory.parse(expectedOutputXml);
         log.debug(xmlObject.toString());
         log.debug(expected.toString());
         List problems = new ArrayList();
         boolean ok = compareXmlObjects(xmlObject, expected, problems);
         assertTrue("Differences: " + problems, ok);
-        xmlObject = webModuleBuilder.convertToServletSchema(xmlObject);
+        xmlObject = SchemaConversionUtils.convertToServletSchema(xmlObject);
         boolean ok2 = compareXmlObjects(xmlObject, expected, problems);
         assertTrue("Differences: " + problems, ok2);
     }
@@ -99,13 +100,13 @@ public class SchemaConversionTest extend
         URL srcXml = classLoader.getResource("j2ee_1_3dtd/web-1-23.xml");
         URL expectedOutputXml = classLoader.getResource("j2ee_1_3dtd/web-1-30.xml");
         XmlObject xmlObject = XmlObject.Factory.parse(srcXml);
-        xmlObject = webModuleBuilder.convertToServletSchema(xmlObject);
+        xmlObject = SchemaConversionUtils.convertToServletSchema(xmlObject);
 //        log.debug(xmlObject.toString());
         XmlObject expected = XmlObject.Factory.parse(expectedOutputXml);
         List problems = new ArrayList();
         boolean ok = compareXmlObjects(xmlObject, expected, problems);
         assertTrue("Differences: " + problems, ok);
-        xmlObject = webModuleBuilder.convertToServletSchema(xmlObject);
+        xmlObject = SchemaConversionUtils.convertToServletSchema(xmlObject);
         boolean ok2 = compareXmlObjects(xmlObject, expected, problems);
         assertTrue("Differences: " + problems, ok2);
     }
@@ -114,14 +115,14 @@ public class SchemaConversionTest extend
         URL srcXml = classLoader.getResource("j2ee_1_2dtd/web-1-22.xml");
         URL expectedOutputXml = classLoader.getResource("j2ee_1_2dtd/web-1-30.xml");
         XmlObject xmlObject = XmlObject.Factory.parse(srcXml);
-        xmlObject = webModuleBuilder.convertToServletSchema(xmlObject);
+        xmlObject = SchemaConversionUtils.convertToServletSchema(xmlObject);
         XmlObject expected = XmlObject.Factory.parse(expectedOutputXml);
 //        log.debug(xmlObject.toString());
 //        log.debug(expected.toString());
         List problems = new ArrayList();
         boolean ok = compareXmlObjects(xmlObject, expected, problems);
         assertTrue("Differences: " + problems, ok);
-        xmlObject = webModuleBuilder.convertToServletSchema(xmlObject);
+        xmlObject = SchemaConversionUtils.convertToServletSchema(xmlObject);
         boolean ok2 = compareXmlObjects(xmlObject, expected, problems);
         assertTrue("Differences: " + problems, ok2);
     }
@@ -130,7 +131,7 @@ public class SchemaConversionTest extend
         URL srcXml = classLoader.getResource("javaee_6schema/web-1-30.xml");
         XmlObject xmlObject = XmlObject.Factory.parse(srcXml);
         try {
-            webModuleBuilder.convertToServletSchema(xmlObject);
+            SchemaConversionUtils.convertToServletSchema(xmlObject);
             fail("doc src/test-data/javaee_5schema/web-1-30.xml is invalid, should not have validated");
         } catch (XmlException e) {
             //expected
@@ -140,7 +141,7 @@ public class SchemaConversionTest extend
     public void testParseWeb30() throws Exception {
         URL srcXml = classLoader.getResource("javaee_6schema/web-2-30.xml");
         XmlObject xmlObject = XmlObject.Factory.parse(srcXml);
-        webModuleBuilder.convertToServletSchema(xmlObject);
+        SchemaConversionUtils.convertToServletSchema(xmlObject);
     }
 
     private static class WebModuleBuilder extends AbstractWebModuleBuilder {

Added: geronimo/server/trunk/plugins/j2ee/geronimo-web/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/j2ee/geronimo-web/pom.xml?rev=939982&view=auto
==============================================================================
--- geronimo/server/trunk/plugins/j2ee/geronimo-web/pom.xml (added)
+++ geronimo/server/trunk/plugins/j2ee/geronimo-web/pom.xml Sat May  1 11:51:06 2010
@@ -0,0 +1,119 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+    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.
+-->
+
+<!-- $Rev$ $Date$ -->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+    <modelVersion>4.0.0</modelVersion>
+
+    <parent>
+        <groupId>org.apache.geronimo.plugins</groupId>
+        <artifactId>j2ee</artifactId>
+        <version>3.0-SNAPSHOT</version>
+    </parent>
+
+    <groupId>org.apache.geronimo.modules</groupId>
+    <artifactId>geronimo-web</artifactId>
+    <packaging>bundle</packaging>
+    <name>Geronimo Plugins, J2EE :: Web</name>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.geronimo.framework</groupId>
+            <artifactId>geronimo-security</artifactId>
+            <version>${version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.geronimo.modules</groupId>
+            <artifactId>geronimo-j2ee-schema</artifactId>
+            <version>${version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>org.ops4j.pax.logging</groupId>
+            <artifactId>pax-logging-api</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.geronimo.specs</groupId>
+            <artifactId>geronimo-servlet_3.0_spec</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.geronimo.modules</groupId>
+            <artifactId>geronimo-j2ee</artifactId>
+            <version>${version}</version>
+        </dependency>
+
+    </dependencies>
+    
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.codehaus.mojo</groupId>
+                <artifactId>xmlbeans-maven-plugin</artifactId>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.felix</groupId>
+                <artifactId>maven-bundle-plugin</artifactId>
+                <configuration>
+                    <instructions>                       
+                        <DynamicImport-Package>schemaorg_apache_xmlbeans.*</DynamicImport-Package>
+                        <Import-Package>
+                            org.apache.geronimo.xbeans.javaee.impl,
+                            org.apache.geronimo.xbeans.javaee,
+                            *
+                        </Import-Package>
+                        <!--<_versionpolicy>[$(version;==;$(@)),$(version;+;$(@)))</_versionpolicy>
+                        org.apache.geronimo.xbeans.javaee.impl,
+                            org.apache.geronimo.xbeans.javaee,
+                            org.apache.geronimo.xbeans.persistence.impl,
+                            org.apache.geronimo.xbeans.persistence,
+                            org.apache.geronimo.xbeans.j2ee.impl,
+                            org.apache.geronimo.xbeans.j2ee,
+                            org.w3.xml.x1998.namespace.impl,
+                            org.w3.xml.x1998.namespace,
+                            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,
+                        -->
+                    </instructions>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+</project>
+

Propchange: geronimo/server/trunk/plugins/j2ee/geronimo-web/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/plugins/j2ee/geronimo-web/pom.xml
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/plugins/j2ee/geronimo-web/pom.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: geronimo/server/trunk/plugins/j2ee/geronimo-web/src/main/java/org/apache/geronimo/web/WebAttributeName.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/j2ee/geronimo-web/src/main/java/org/apache/geronimo/web/WebAttributeName.java?rev=939982&view=auto
==============================================================================
--- geronimo/server/trunk/plugins/j2ee/geronimo-web/src/main/java/org/apache/geronimo/web/WebAttributeName.java (added)
+++ geronimo/server/trunk/plugins/j2ee/geronimo-web/src/main/java/org/apache/geronimo/web/WebAttributeName.java Sat May  1 11:51:06 2010
@@ -0,0 +1,25 @@
+/**
+ *  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.web;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public enum WebAttributeName {
+    META_COMPLETE, ORDERED_LIBS, SCHEMA_VERSION, SERVLET_CONTAINER_INITIALIZERS;
+}

Propchange: geronimo/server/trunk/plugins/j2ee/geronimo-web/src/main/java/org/apache/geronimo/web/WebAttributeName.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/plugins/j2ee/geronimo-web/src/main/java/org/apache/geronimo/web/WebAttributeName.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/plugins/j2ee/geronimo-web/src/main/java/org/apache/geronimo/web/WebAttributeName.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: geronimo/server/trunk/plugins/j2ee/geronimo-web/src/main/java/org/apache/geronimo/web/security/HTTPMethods.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/j2ee/geronimo-web/src/main/java/org/apache/geronimo/web/security/HTTPMethods.java?rev=939982&r1=939221&r2=939982&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/j2ee/geronimo-web/src/main/java/org/apache/geronimo/web/security/HTTPMethods.java (original)
+++ geronimo/server/trunk/plugins/j2ee/geronimo-web/src/main/java/org/apache/geronimo/web/security/HTTPMethods.java Sat May  1 11:51:06 2010
@@ -17,7 +17,7 @@
  * under the License.
  */
 
-package org.apache.geronimo.web25.deployment.security;
+package org.apache.geronimo.web.security;
 
 import java.util.HashSet;
 import java.util.Set;

Modified: geronimo/server/trunk/plugins/j2ee/geronimo-web/src/main/java/org/apache/geronimo/web/security/SpecSecurityBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/j2ee/geronimo-web/src/main/java/org/apache/geronimo/web/security/SpecSecurityBuilder.java?rev=939982&r1=939221&r2=939982&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/j2ee/geronimo-web/src/main/java/org/apache/geronimo/web/security/SpecSecurityBuilder.java (original)
+++ geronimo/server/trunk/plugins/j2ee/geronimo-web/src/main/java/org/apache/geronimo/web/security/SpecSecurityBuilder.java Sat May  1 11:51:06 2010
@@ -17,11 +17,13 @@
  * under the License.
  */
 
-package org.apache.geronimo.web25.deployment.security;
+package org.apache.geronimo.web.security;
 
+import java.net.URL;
 import java.security.Permission;
 import java.security.PermissionCollection;
 import java.security.Permissions;
+import java.util.Collection;
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.HashSet;
@@ -33,22 +35,43 @@ import javax.security.jacc.PolicyContext
 import javax.security.jacc.WebResourcePermission;
 import javax.security.jacc.WebRoleRefPermission;
 import javax.security.jacc.WebUserDataPermission;
-
+import javax.servlet.HttpMethodConstraintElement;
+import javax.servlet.Servlet;
+import javax.servlet.ServletSecurityElement;
+import javax.servlet.annotation.HttpConstraint;
+import javax.servlet.annotation.HttpMethodConstraint;
+import javax.servlet.annotation.ServletSecurity;
+import javax.servlet.annotation.ServletSecurity.TransportGuarantee;
+
+import org.apache.geronimo.deployment.xmlbeans.XmlBeansUtil;
+import org.apache.geronimo.kernel.util.JarUtils;
+import org.apache.geronimo.schema.SchemaConversionUtils;
 import org.apache.geronimo.security.jacc.ComponentPermissions;
+import org.apache.geronimo.xbeans.javaee6.AuthConstraintType;
 import org.apache.geronimo.xbeans.javaee6.RoleNameType;
 import org.apache.geronimo.xbeans.javaee6.SecurityConstraintType;
 import org.apache.geronimo.xbeans.javaee6.SecurityRoleRefType;
 import org.apache.geronimo.xbeans.javaee6.SecurityRoleType;
+import org.apache.geronimo.xbeans.javaee6.ServletMappingType;
 import org.apache.geronimo.xbeans.javaee6.ServletType;
 import org.apache.geronimo.xbeans.javaee6.UrlPatternType;
+import org.apache.geronimo.xbeans.javaee6.WebAppDocument;
 import org.apache.geronimo.xbeans.javaee6.WebAppType;
 import org.apache.geronimo.xbeans.javaee6.WebResourceCollectionType;
+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.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * @version $Rev$ $Date$
  */
 public class SpecSecurityBuilder {
 
+    private static final Logger logger = LoggerFactory.getLogger(SpecSecurityBuilder.class);
+
     private final Set<String> securityRoles = new HashSet<String>();
 
     private final Map<String, URLPattern> uncheckedPatterns = new HashMap<String, URLPattern>();
@@ -67,15 +90,159 @@ public class SpecSecurityBuilder {
 
     private final RecordingPolicyConfiguration policyConfiguration = new RecordingPolicyConfiguration(true);
 
-    public ComponentPermissions buildSpecSecurityConfig(WebAppType webApp) {
-        collectRoleNames(webApp.getSecurityRoleArray());
+    /**
+     * webApp is xmlbean object of the initial web.xml ( May be merged all the web-fragment.xml files)
+     */
+    private WebAppType initialWebApp;
+
+    private Bundle bundle;
+
+    private boolean annotationScanRequired;
+
+    private Set<String> urlPatternsConfiguredInDeploymentPlans = new HashSet<String>();
+
+    /**
+     *   dynamicSecurityWebApp contains all the servlet security constraints configured by ServletRegistration.Dynamic interface
+     */
+    private WebAppType dynamicSecurityWebApp;
+
+    /**
+     * annotationSecurityWebApp contains all the servlet security constraints configured by ServletConstraint annotation
+     */
+    private WebAppType annotationSecurityWebApp;
+
+    public SpecSecurityBuilder(WebAppType webApp) {
+        this(webApp, null, false);
+    }
+
+    public SpecSecurityBuilder(WebAppType initialWebApp, Bundle bundle, boolean annotationScanRequired) {
+        this.initialWebApp = initialWebApp;
+        if (annotationScanRequired && bundle == null) {
+            throw new IllegalArgumentException("Bundle parameter could not be null while annotation scanning is required");
+        }
+        this.bundle = bundle;
+        this.annotationScanRequired = annotationScanRequired;
+        initialize();
+    }
+
+    public SpecSecurityBuilder(Bundle bundle, boolean annotationScanRequired) {
+        this.bundle = bundle;
+        this.annotationScanRequired = annotationScanRequired;
+        URL specDDUrl = BundleUtils.getEntry(bundle, "WEB-INF/web.xml");
+        if (specDDUrl == null) {
+            initialWebApp = WebAppType.Factory.newInstance();
+        } else {
+            try {
+                String specDD = JarUtils.readAll(specDDUrl);
+                XmlObject parsed = XmlBeansUtil.parse(specDD);
+                WebAppDocument webAppDoc = SchemaConversionUtils.convertToServletSchema(parsed);
+                initialWebApp = webAppDoc.getWebApp();
+            } catch (XmlException e) {
+                throw new IllegalArgumentException("Error parsing web.xml for " + bundle.getSymbolicName(), e);
+            } catch (Exception e) {
+                throw new IllegalArgumentException("Error reading web.xml for " + bundle.getSymbolicName(), e);
+            }
+        }
+        initialize();
+    }
+
+    public void declareRoles(String... roleNames) {
+        //Let's go ahead to directly add the roles to the securityRoles set. The set will be used in the collectRoleNames method.
+        for (String roleName : roleNames) {
+            if (roleName == null || roleName.trim().length() == 0) {
+                throw new IllegalArgumentException("RoleName of null value or empty string is not allowed in declareRoles method");
+            }
+            securityRoles.add(roleName.trim());
+        }
+    }
+
+    public Set<String> setServletSecurity(ServletSecurityElement constraint, Collection<String> urlPatterns) {
+        if (dynamicSecurityWebApp == null) {
+            dynamicSecurityWebApp = WebAppType.Factory.newInstance();
+        }
+        Set<String> uneffectedUrlPatterns = new HashSet<String>();
+        for (String urlPattern : urlPatterns) {
+            if (urlPatternsConfiguredInDeploymentPlans.contains(urlPattern)) {
+                uneffectedUrlPatterns.add(urlPattern);
+            }
+        }
+        Collection<String> effectedUrlPatterns = null;
+        if (uneffectedUrlPatterns.size() == 0) {
+            effectedUrlPatterns = urlPatterns;
+        } else {
+            effectedUrlPatterns = new HashSet<String>();
+            effectedUrlPatterns.addAll(urlPatterns);
+            effectedUrlPatterns.removeAll(uneffectedUrlPatterns);
+        }
+        //Update SecurityConstraint configured by ServletSecurity annotations if required
+        if (annotationSecurityWebApp != null) {
+            overrideSecurityConstraints(annotationSecurityWebApp, effectedUrlPatterns);
+        }
+        //Update SecurityConstraint configured by previous setServletSecurity invocations
+        overrideSecurityConstraints(dynamicSecurityWebApp, effectedUrlPatterns);
+        //Update Role List
+        //Roles that are implicitly declared as a result of their use within the setServletSecurity or setRunAsRole methods of the ServletRegistration interface
+        //need not be declared.
+        //Set SecurityConstraint
+        if (constraint.getHttpMethodConstraints().size() > 0) {
+            for (HttpMethodConstraintElement httpMethodConstraint : constraint.getHttpMethodConstraints()) {
+                //Generate a security-constraint for each HttpMethodConstraint
+                addNewHTTPMethodSecurityConstraint(dynamicSecurityWebApp, httpMethodConstraint.getRolesAllowed(), httpMethodConstraint.getTransportGuarantee(), httpMethodConstraint
+                        .getEmptyRoleSemantic(), httpMethodConstraint.getMethodName(), effectedUrlPatterns);
+               declareRoles(httpMethodConstraint.getRolesAllowed());
+            }
+        }
+        addNewHTTPSecurityConstraint(dynamicSecurityWebApp, constraint.getRolesAllowed(), constraint.getTransportGuarantee(), constraint.getEmptyRoleSemantic(), constraint.getMethodNames()
+                .toArray(new String[0]), effectedUrlPatterns);
+        declareRoles(constraint.getRolesAllowed());
+        return uneffectedUrlPatterns;
+    }
+
+    private void overrideSecurityConstraints(WebAppType webApp, Collection<String> urlPatterns) {
+        for (SecurityConstraintType securityConstraint : webApp.getSecurityConstraintArray()) {
+            int iCurrentWebResourceCollectionIndex = 0;
+            for (WebResourceCollectionType webResourceCollection : securityConstraint.getWebResourceCollectionArray()) {
+                Set<String> validateAnnotationUrlPatterns = new HashSet<String>();
+                for (UrlPatternType urlPattern : webResourceCollection.getUrlPatternArray()) {
+                    if (!urlPatterns.contains(urlPattern.getStringValue())) {
+                        validateAnnotationUrlPatterns.add(urlPattern.getStringValue());
+                    }
+                }
+                if (validateAnnotationUrlPatterns.size() == 0) {
+                    securityConstraint.removeWebResourceCollection(iCurrentWebResourceCollectionIndex);
+                    continue;
+                } else if (validateAnnotationUrlPatterns.size() < webResourceCollection.getUrlPatternArray().length) {
+                    for (int i = 0, iLoopSize = webResourceCollection.getUrlPatternArray().length; i < iLoopSize; i++) {
+                        webResourceCollection.removeUrlPattern(0);
+                    }
+                    for (String validateAnnotationUrlPattern : validateAnnotationUrlPatterns) {
+                        webResourceCollection.addNewUrlPattern().setStringValue(validateAnnotationUrlPattern);
+                    }
+                }
+                iCurrentWebResourceCollectionIndex++;
+            }
+        }
+    }
+
+    public ComponentPermissions buildSpecSecurityConfig() {
+        if (dynamicSecurityWebApp != null) {
+            for (SecurityConstraintType securityConstraint : dynamicSecurityWebApp.getSecurityConstraintArray()) {
+                initialWebApp.addNewSecurityConstraint().set(securityConstraint);
+            }
+        }
+        if (annotationSecurityWebApp != null) {
+            for (SecurityConstraintType securityConstraint : annotationSecurityWebApp.getSecurityConstraintArray()) {
+                initialWebApp.addNewSecurityConstraint().set(securityConstraint);
+            }
+        }
+        collectRoleNames(initialWebApp.getSecurityRoleArray());
         try {
-            for (ServletType servletType : webApp.getServletArray()) {
+            for (ServletType servletType : initialWebApp.getServletArray()) {
                 processRoleRefPermissions(servletType);
             }
             //add the role-ref permissions for unmapped jsps
             addUnmappedJSPPermissions();
-            analyzeSecurityConstraints(webApp.getSecurityConstraintArray());
+            analyzeSecurityConstraints(initialWebApp.getSecurityConstraintArray());
             removeExcludedDups();
             return buildComponentPermissions();
         } catch (PolicyContextException e) {
@@ -83,7 +250,7 @@ public class SpecSecurityBuilder {
         }
     }
 
-    public void analyzeSecurityConstraints(SecurityConstraintType[] securityConstraintArray) {
+    private void analyzeSecurityConstraints(SecurityConstraintType[] securityConstraintArray) {
         for (SecurityConstraintType securityConstraintType : securityConstraintArray) {
             Map<String, URLPattern> currentPatterns;
             if (securityConstraintType.isSetAuthConstraint()) {
@@ -154,7 +321,7 @@ public class SpecSecurityBuilder {
         }
     }
 
-    public void removeExcludedDups() {
+    private void removeExcludedDups() {
         for (Map.Entry<String, URLPattern> excluded : excludedPatterns.entrySet()) {
             String url = excluded.getKey();
             URLPattern pattern = excluded.getValue();
@@ -172,7 +339,7 @@ public class SpecSecurityBuilder {
         }
     }
 
-    public ComponentPermissions buildComponentPermissions() throws PolicyContextException {
+    private ComponentPermissions buildComponentPermissions() throws PolicyContextException {
         for (URLPattern pattern : excludedPatterns.values()) {
             String name = pattern.getQualifiedPattern(allSet);
             String actions = pattern.getMethods();
@@ -215,7 +382,6 @@ public class SpecSecurityBuilder {
             addOrUpdatePattern(uncheckedResourcePatterns, name, methods, URLPattern.NA);
             addOrUpdatePattern(uncheckedUserPatterns, name, methods, URLPattern.NA);
         }
-
         if (!allMap.containsKey("/")) {
             URLPattern pattern = new URLPattern("/", Collections.EMPTY_SET, false);
             String name = pattern.getQualifiedPattern(allSet);
@@ -284,6 +450,190 @@ public class SpecSecurityBuilder {
         }
     }
 
+    /**
+     * 1. Scan ServletConstraint annotations to build a map for conflict checking
+     * 2. Build a url-pattern
+     */
+    private void initialize() {
+        // Initialize urlPatternsConfiguredInDeploymentPlans map, which contains all the url patterns configured in portable deployment plan
+        for (SecurityConstraintType secuirtyConstrait : initialWebApp.getSecurityConstraintArray()) {
+            for (WebResourceCollectionType webResourceCollection : secuirtyConstrait.getWebResourceCollectionArray()) {
+                for (UrlPatternType urlPattern : webResourceCollection.getUrlPatternArray()) {
+                    urlPatternsConfiguredInDeploymentPlans.add(urlPattern.getStringValue());
+                }
+            }
+        }
+        //Scan ServletConstraint annotations if required
+        if (annotationScanRequired) {
+            annotationSecurityWebApp = WebAppType.Factory.newInstance();
+            scanServletConstraintAnnotations();
+        }
+    }
+
+    private void scanServletConstraintAnnotations() {
+        try {
+            Map<String, Set<String>> servletClassNameUrlPatternsMap = genetateServletClassUrlPatternsMap();
+            for (ServletType servlet : initialWebApp.getServletArray()) {
+                if (servlet.getServletClass() == null || servlet.getServletClass().getStringValue().isEmpty()) {
+                    continue;
+                }
+                String servletClassName = servlet.getServletClass().getStringValue();
+                Class<?> cls = bundle.loadClass(servletClassName);
+                if (!Servlet.class.isAssignableFrom(cls)) {
+                    continue;
+                }
+                ServletSecurity servletSecurity = cls.getAnnotation(ServletSecurity.class);
+                if (servletSecurity == null) {
+                    continue;
+                }
+                Set<String> urlPatterns = servletClassNameUrlPatternsMap.get(servletClassName);
+                if (urlPatterns == null || urlPatterns.isEmpty()) {
+                    if (logger.isDebugEnabled()) {
+                        logger.debug("No url pattern for the servlet class " + servletClassName + " is found in the deployment plan, SecurityConstraint annotation is ignored");
+                    }
+                    continue;
+                }
+                HttpConstraint httpConstraint = servletSecurity.value();
+                if (servletSecurity.httpMethodConstraints().length > 0) {
+                    String[] omissionMethods = new String[servletSecurity.httpMethodConstraints().length];
+                    int iIndex = 0;
+                    for (HttpMethodConstraint httpMethodConstraint : servletSecurity.httpMethodConstraints()) {
+                        //Generate a security-constraint for each HttpMethodConstraint
+                        String httpMethod = httpMethodConstraint.value().trim();
+                        omissionMethods[iIndex++] = httpMethod;
+                        addNewHTTPMethodSecurityConstraint(annotationSecurityWebApp, httpMethodConstraint.rolesAllowed(), httpMethodConstraint.transportGuarantee(), httpMethodConstraint
+                                .emptyRoleSemantic(), httpMethod, urlPatterns);
+                    }
+                    addNewHTTPSecurityConstraint(annotationSecurityWebApp, httpConstraint.rolesAllowed(), httpConstraint.transportGuarantee(), httpConstraint.value(), omissionMethods, urlPatterns);
+                } else {
+                    addNewHTTPSecurityConstraint(annotationSecurityWebApp, httpConstraint.rolesAllowed(), httpConstraint.transportGuarantee(), httpConstraint.value(), new String[] {}, urlPatterns);
+                }
+            }
+        } catch (ClassNotFoundException e) {
+            //Should never occur, as webservice builder  have already checked it.
+            logger.error("Fail to load class", e);
+        }
+    }
+
+    /**
+     * Create Security Constraint based on the arguments
+     * @param webApp
+     * @param rolesAllowed
+     * @param transportGuarantee
+     * @param emptyRoleSemantic
+     * @return null when emptyRoleSemantic=PERMIT AND rolesAllowed={} AND transportGuarantee=NONE
+     */
+    private SecurityConstraintType addNewSecurityConstraint(WebAppType webApp, String[] rolesAllowed, TransportGuarantee transportGuarantee, ServletSecurity.EmptyRoleSemantic emptyRoleSemantic) {
+        //IF emptyRoleSemantic=PERMIT AND rolesAllowed={} AND transportGuarantee=NONE then
+        //  No Constraint
+        //END IF
+        if (rolesAllowed.length > 0 || transportGuarantee.equals(TransportGuarantee.CONFIDENTIAL) || emptyRoleSemantic.equals(ServletSecurity.EmptyRoleSemantic.DENY)) {
+            SecurityConstraintType securityConstraint = webApp.addNewSecurityConstraint();
+            if (transportGuarantee.equals(TransportGuarantee.CONFIDENTIAL)) {
+                securityConstraint.addNewUserDataConstraint().addNewTransportGuarantee().setStringValue(TransportGuarantee.CONFIDENTIAL.name());
+            }
+            if (emptyRoleSemantic.equals(ServletSecurity.EmptyRoleSemantic.DENY)) {
+                securityConstraint.addNewAuthConstraint();
+            } else {
+                AuthConstraintType authConstraint = securityConstraint.addNewAuthConstraint();
+                for (String roleAllowed : rolesAllowed) {
+                    authConstraint.addNewRoleName().setStringValue(roleAllowed);
+                }
+            }
+            return securityConstraint;
+        }
+        return null;
+    }
+
+    private SecurityConstraintType addNewHTTPSecurityConstraint(WebAppType webApp, String[] rolesAllowed, TransportGuarantee transportGuarantee, ServletSecurity.EmptyRoleSemantic emptyRoleSemantic,
+            String[] omissionMethods, Collection<String> urlPatterns) {
+        SecurityConstraintType securityConstraint = addNewSecurityConstraint(webApp, rolesAllowed, transportGuarantee, emptyRoleSemantic);
+        if (omissionMethods.length > 0 || securityConstraint != null) {
+            if (securityConstraint == null) {
+                securityConstraint = webApp.addNewSecurityConstraint();
+            }
+            WebResourceCollectionType webResourceCollection = securityConstraint.getWebResourceCollectionArray().length == 0 ? securityConstraint.addNewWebResourceCollection() : securityConstraint
+                    .getWebResourceCollectionArray(0);
+            for (String omissionMethod : omissionMethods) {
+                webResourceCollection.addNewHttpMethodOmission().setStringValue(omissionMethod);
+            }
+            for (String urlPattern : urlPatterns) {
+                webResourceCollection.addNewUrlPattern().setStringValue(urlPattern);
+            }
+        }
+        return securityConstraint;
+    }
+
+    private SecurityConstraintType addNewHTTPMethodSecurityConstraint(WebAppType webApp, String[] rolesAllowed, TransportGuarantee transportGuarantee,
+            ServletSecurity.EmptyRoleSemantic emptyRoleSemantic, String httpMethod, Collection<String> urlPatterns) {
+        SecurityConstraintType securityConstraint = addNewSecurityConstraint(webApp, rolesAllowed, transportGuarantee, emptyRoleSemantic);
+        if (securityConstraint == null) {
+            securityConstraint = webApp.addNewSecurityConstraint();
+        }
+        WebResourceCollectionType webResourceCollection = securityConstraint.getWebResourceCollectionArray().length == 0 ? securityConstraint.addNewWebResourceCollection() : securityConstraint
+                .getWebResourceCollectionArray(0);
+        for (String urlPattern : urlPatterns) {
+            webResourceCollection.addNewUrlPattern().setStringValue(urlPattern);
+        }
+        webResourceCollection.addNewHttpMethod().setStringValue(httpMethod);
+        return securityConstraint;
+    }
+
+    /**
+     * The return map contains the servlet class -> url patterns pairs, which are not configured in the security-constraint elements in the deployment plan.
+     * Because the security-constraint configurations in the deployment plan have the highest priority, those constraints configured by annotations should not override them
+     * @return
+     */
+    private Map<String, Set<String>> genetateServletClassUrlPatternsMap() {
+        Map<String, Set<String>> servletNameUrlPatternsMap = new HashMap<String, Set<String>>();
+        for (ServletMappingType servletMapping : initialWebApp.getServletMappingArray()) {
+            String servletName = servletMapping.getServletName().getStringValue();
+            Set<String> urlPatterns = servletNameUrlPatternsMap.get(servletName);
+            if (urlPatterns == null) {
+                urlPatterns = new HashSet<String>();
+                servletNameUrlPatternsMap.put(servletName, urlPatterns);
+            }
+            for (UrlPatternType urlPattern : servletMapping.getUrlPatternArray()) {
+                if (!urlPatternsConfiguredInDeploymentPlans.contains(urlPattern.getStringValue())) {
+                    urlPatterns.add(urlPattern.getStringValue());
+                }
+            }
+        }
+        Map<String, Set<String>> servletClassUrlPatternsMap = new HashMap<String, Set<String>>();
+        for (ServletType servlet : initialWebApp.getServletArray()) {
+            if (servlet.getServletClass() == null || servlet.getServletClass().getStringValue().isEmpty()) {
+                continue;
+            }
+            String servletClassName = servlet.getServletClass().getStringValue();
+            Set<String> urlPatterns = servletClassUrlPatternsMap.get(servlet.getServletClass().getStringValue());
+            if (urlPatterns == null) {
+                urlPatterns = new HashSet<String>();
+                servletClassUrlPatternsMap.put(servletClassName, urlPatterns);
+            }
+            Set<String> servletMappingUrlPatterns = servletNameUrlPatternsMap.get(servlet.getServletName().getStringValue());
+            if (servletMappingUrlPatterns != null) {
+                urlPatterns.addAll(servletMappingUrlPatterns);
+            }
+        }
+        return servletClassUrlPatternsMap;
+    }
+
+    public void clear() {
+        securityRoles.clear();
+        uncheckedPatterns.clear();
+        uncheckedResourcePatterns.clear();
+        uncheckedUserPatterns.clear();
+        excludedPatterns.clear();
+        rolesPatterns.clear();
+        allSet.clear();
+        allMap.clear();
+        initialWebApp = null;
+        bundle = null;
+        urlPatternsConfiguredInDeploymentPlans = null;
+        dynamicSecurityWebApp = null;
+        annotationSecurityWebApp = null;
+    }
+
     private static class RecordingPolicyConfiguration implements PolicyConfiguration {
 
         private final PermissionCollection excludedPermissions = new Permissions();

Modified: geronimo/server/trunk/plugins/j2ee/geronimo-web/src/main/java/org/apache/geronimo/web/security/URLPattern.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/j2ee/geronimo-web/src/main/java/org/apache/geronimo/web/security/URLPattern.java?rev=939982&r1=939221&r2=939982&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/j2ee/geronimo-web/src/main/java/org/apache/geronimo/web/security/URLPattern.java (original)
+++ geronimo/server/trunk/plugins/j2ee/geronimo-web/src/main/java/org/apache/geronimo/web/security/URLPattern.java Sat May  1 11:51:06 2010
@@ -15,7 +15,7 @@
  *  limitations under the License.
  */
 
-package org.apache.geronimo.web25.deployment.security;
+package org.apache.geronimo.web.security;
 
 import java.util.Collection;
 import java.util.HashSet;

Modified: geronimo/server/trunk/plugins/j2ee/geronimo-web/src/main/java/org/apache/geronimo/web/security/URLPatternCheck.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/j2ee/geronimo-web/src/main/java/org/apache/geronimo/web/security/URLPatternCheck.java?rev=939982&r1=939221&r2=939982&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/j2ee/geronimo-web/src/main/java/org/apache/geronimo/web/security/URLPatternCheck.java (original)
+++ geronimo/server/trunk/plugins/j2ee/geronimo-web/src/main/java/org/apache/geronimo/web/security/URLPatternCheck.java Sat May  1 11:51:06 2010
@@ -15,13 +15,13 @@
  *  limitations under the License.
  */
 
-package org.apache.geronimo.web25.deployment.security;
-
+package org.apache.geronimo.web.security;
 
 /**
  * @version $Rev$ $Date$
  */
 public abstract class URLPatternCheck {
+
     public abstract boolean check(URLPattern base, URLPattern test);
 
     public abstract boolean matches(String base, String test);

Modified: geronimo/server/trunk/plugins/j2ee/geronimo-web/src/main/java/org/apache/geronimo/web/security/UncheckedItem.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/j2ee/geronimo-web/src/main/java/org/apache/geronimo/web/security/UncheckedItem.java?rev=939982&r1=939221&r2=939982&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/j2ee/geronimo-web/src/main/java/org/apache/geronimo/web/security/UncheckedItem.java (original)
+++ geronimo/server/trunk/plugins/j2ee/geronimo-web/src/main/java/org/apache/geronimo/web/security/UncheckedItem.java Sat May  1 11:51:06 2010
@@ -18,7 +18,7 @@
  */
 
 
-package org.apache.geronimo.web25.deployment.security;
+package org.apache.geronimo.web.security;
 
 /**
  * @version $Rev$ $Date$

Modified: geronimo/server/trunk/plugins/j2ee/geronimo-web/src/test/java/org/apache/geronimo/web/security/SecurityConfigTest.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/j2ee/geronimo-web/src/test/java/org/apache/geronimo/web/security/SecurityConfigTest.java?rev=939982&r1=939221&r2=939982&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/j2ee/geronimo-web/src/test/java/org/apache/geronimo/web/security/SecurityConfigTest.java (original)
+++ geronimo/server/trunk/plugins/j2ee/geronimo-web/src/test/java/org/apache/geronimo/web/security/SecurityConfigTest.java Sat May  1 11:51:06 2010
@@ -15,7 +15,7 @@
  *  limitations under the License.
  */
 
-package org.apache.geronimo.web25.deployment.security;
+package org.apache.geronimo.web.security;
 
 import java.net.URL;
 
@@ -35,12 +35,10 @@ public class SecurityConfigTest extends 
     private XmlOptions options = new XmlOptions();
 
     public void testNoSecConstraint() throws Exception {
-        URL srcXml = classLoader.getResource("deployables/war3/WEB-INF/web.xml");
+        URL srcXml = classLoader.getResource("security/web-nosecurity.xml");
         WebAppDocument webAppDoc = WebAppDocument.Factory.parse(srcXml, options);
         WebAppType webApp = webAppDoc.getWebApp();
-        SpecSecurityBuilder builder = new SpecSecurityBuilder();
-        ComponentPermissions componentPermissions = builder.buildSpecSecurityConfig(webApp);
+        SpecSecurityBuilder builder = new SpecSecurityBuilder(webApp);
+        ComponentPermissions componentPermissions = builder.buildSpecSecurityConfig();
     }
-
-
 }

Modified: geronimo/server/trunk/plugins/j2ee/geronimo-web/src/test/java/org/apache/geronimo/web/security/SpecSecurityParsingTest.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/j2ee/geronimo-web/src/test/java/org/apache/geronimo/web/security/SpecSecurityParsingTest.java?rev=939982&r1=939221&r2=939982&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/j2ee/geronimo-web/src/test/java/org/apache/geronimo/web/security/SpecSecurityParsingTest.java (original)
+++ geronimo/server/trunk/plugins/j2ee/geronimo-web/src/test/java/org/apache/geronimo/web/security/SpecSecurityParsingTest.java Sat May  1 11:51:06 2010
@@ -18,7 +18,7 @@
  */
 
 
-package org.apache.geronimo.web25.deployment.security;
+package org.apache.geronimo.web.security;
 
 import java.net.URL;
 import java.security.Permission;
@@ -46,8 +46,8 @@ public class SpecSecurityParsingTest ext
         URL srcXml = classLoader.getResource("security/web1.xml");
         WebAppDocument webAppDoc = WebAppDocument.Factory.parse(srcXml, options);
         WebAppType webAppType = webAppDoc.getWebApp();
-        SpecSecurityBuilder builder = new SpecSecurityBuilder();
-        ComponentPermissions permissions = builder.buildSpecSecurityConfig(webAppType);
+        SpecSecurityBuilder builder = new SpecSecurityBuilder(webAppType);
+        ComponentPermissions permissions = builder.buildSpecSecurityConfig();
         PermissionCollection unchecked = permissions.getUncheckedPermissions();
         assertTrue(unchecked.implies(new WebResourcePermission("/login.do", "!")));
         assertTrue(unchecked.implies(new WebResourcePermission("/foo", "!")));
@@ -65,8 +65,8 @@ public class SpecSecurityParsingTest ext
         URL srcXml = classLoader.getResource("security/web2.xml");
         WebAppDocument webAppDoc = WebAppDocument.Factory.parse(srcXml, options);
         WebAppType webAppType = webAppDoc.getWebApp();
-        SpecSecurityBuilder builder = new SpecSecurityBuilder();
-        ComponentPermissions permissions = builder.buildSpecSecurityConfig(webAppType);
+        SpecSecurityBuilder builder = new SpecSecurityBuilder(webAppType);
+        ComponentPermissions permissions = builder.buildSpecSecurityConfig();
         Permission p = new WebResourcePermission("/Test/Foo", "GET,POST");
         assertTrue(implies(p, permissions, "Admin"));
         assertFalse(implies(new WebResourcePermission("/Test", ""), permissions, null));
@@ -77,8 +77,8 @@ public class SpecSecurityParsingTest ext
         URL srcXml = classLoader.getResource("security/web3.xml");
         WebAppDocument webAppDoc = WebAppDocument.Factory.parse(srcXml, options);
         WebAppType webAppType = webAppDoc.getWebApp();
-        SpecSecurityBuilder builder = new SpecSecurityBuilder();
-        ComponentPermissions permissions = builder.buildSpecSecurityConfig(webAppType);
+        SpecSecurityBuilder builder = new SpecSecurityBuilder(webAppType);
+        ComponentPermissions permissions = builder.buildSpecSecurityConfig();
         Permission p = new WebResourcePermission("/Test/Foo", "GET,POST");
         assertTrue(implies(p, permissions, "Admin"));
         assertFalse(implies(p, permissions, null));
@@ -105,8 +105,8 @@ public class SpecSecurityParsingTest ext
         URL srcXml = classLoader.getResource("security/web4.xml");
         WebAppDocument webAppDoc = WebAppDocument.Factory.parse(srcXml, options);
         WebAppType webAppType = webAppDoc.getWebApp();
-        SpecSecurityBuilder builder = new SpecSecurityBuilder();
-        ComponentPermissions permissions = builder.buildSpecSecurityConfig(webAppType);
+        SpecSecurityBuilder builder = new SpecSecurityBuilder(webAppType);
+        ComponentPermissions permissions = builder.buildSpecSecurityConfig();
         // test excluding longer path than allowed
         Permission p = new WebResourcePermission("/Foo/Baz", "GET");
         assertTrue(implies(p, permissions, "Admin"));
@@ -136,8 +136,8 @@ public class SpecSecurityParsingTest ext
         URL srcXml = classLoader.getResource("security/web5.xml");
         WebAppDocument webAppDoc = WebAppDocument.Factory.parse(srcXml, options);
         WebAppType webAppType = webAppDoc.getWebApp();
-        SpecSecurityBuilder builder = new SpecSecurityBuilder();
-        ComponentPermissions permissions = builder.buildSpecSecurityConfig(webAppType);
+        SpecSecurityBuilder builder = new SpecSecurityBuilder(webAppType);
+        ComponentPermissions permissions = builder.buildSpecSecurityConfig();
         // test excluding longer path than allowed
         Permission p = new WebResourcePermission("/foo/Baz", "GET");
         assertFalse(implies(p, permissions, "user"));
@@ -154,8 +154,8 @@ public class SpecSecurityParsingTest ext
         URL srcXml = classLoader.getResource("security/web6.xml");
         WebAppDocument webAppDoc = WebAppDocument.Factory.parse(srcXml, options);
         WebAppType webAppType = webAppDoc.getWebApp();
-        SpecSecurityBuilder builder = new SpecSecurityBuilder();
-        ComponentPermissions permissions = builder.buildSpecSecurityConfig(webAppType);
+        SpecSecurityBuilder builder = new SpecSecurityBuilder(webAppType);
+        ComponentPermissions permissions = builder.buildSpecSecurityConfig();
         Permission p = new WebResourcePermission("/app/*", "GET");
         assertFalse(implies(p, permissions, null));
         p = new WebResourcePermission("/app/home", "POST");

Added: geronimo/server/trunk/plugins/j2ee/geronimo-web/src/test/resources/security/web-nosecurity.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/j2ee/geronimo-web/src/test/resources/security/web-nosecurity.xml?rev=939982&view=auto
==============================================================================
--- geronimo/server/trunk/plugins/j2ee/geronimo-web/src/test/resources/security/web-nosecurity.xml (added)
+++ geronimo/server/trunk/plugins/j2ee/geronimo-web/src/test/resources/security/web-nosecurity.xml Sat May  1 11:51:06 2010
@@ -0,0 +1,54 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+    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.
+-->
+  
+<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
+
+    <description>Test Web Deployment</description>
+
+    <security-constraint>
+        <web-resource-collection>
+            <web-resource-name>Admin Role</web-resource-name>
+            <url-pattern>*.do</url-pattern>
+        </web-resource-collection>
+        <auth-constraint>
+            <role-name>content-administrator</role-name>
+        </auth-constraint>
+    </security-constraint>
+
+    <security-constraint>
+        <web-resource-collection>
+            <web-resource-name>Unrestricted ACCESS</web-resource-name>
+            <url-pattern>/login.do</url-pattern>
+        </web-resource-collection>
+    </security-constraint>    
+
+    <login-config>
+        <auth-method>FORM</auth-method>
+        <realm-name>Test JAAS Realm</realm-name>
+        <form-login-config>
+            <form-login-page>/auth/logon.html?param=test</form-login-page>
+            <form-error-page>/auth/logonError.html?param=test</form-error-page>
+        </form-login-config>
+    </login-config>
+
+    <security-role>
+        <role-name>content-administrator</role-name>
+    </security-role>
+
+</web-app>
\ No newline at end of file

Propchange: geronimo/server/trunk/plugins/j2ee/geronimo-web/src/test/resources/security/web-nosecurity.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/plugins/j2ee/geronimo-web/src/test/resources/security/web-nosecurity.xml
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/plugins/j2ee/geronimo-web/src/test/resources/security/web-nosecurity.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Modified: geronimo/server/trunk/plugins/j2ee/geronimo-web/src/test/resources/security/web6.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/j2ee/geronimo-web/src/test/resources/security/web6.xml?rev=939982&r1=939221&r2=939982&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/j2ee/geronimo-web/src/test/resources/security/web6.xml (original)
+++ geronimo/server/trunk/plugins/j2ee/geronimo-web/src/test/resources/security/web6.xml Sat May  1 11:51:06 2010
@@ -15,7 +15,7 @@
   See the License for the specific language governing permissions and
   limitations under the License.
 -->
-<web-app xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" version="2.5" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee">
+<web-app xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" version="3.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee">
     <security-constraint>
         <web-resource-collection>
             <web-resource-name>resource1</web-resource-name>

Modified: geronimo/server/trunk/plugins/j2ee/j2ee-deployer/src/main/history/dependencies.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/j2ee/j2ee-deployer/src/main/history/dependencies.xml?rev=939982&r1=939981&r2=939982&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/j2ee/j2ee-deployer/src/main/history/dependencies.xml (original)
+++ geronimo/server/trunk/plugins/j2ee/j2ee-deployer/src/main/history/dependencies.xml Sat May  1 11:51:06 2010
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<plugin-artifact xmlns:ns2="http://geronimo.apache.org/xml/ns/attributes-1.2" xmlns="http://geronimo.apache.org/xml/ns/plugins-1.3">
+<plugin-artifact xmlns="http://geronimo.apache.org/xml/ns/plugins-1.3" xmlns:ns2="http://geronimo.apache.org/xml/ns/attributes-1.2">
     <module-id>
         <groupId>org.apache.geronimo.configs</groupId>
         <artifactId>j2ee-deployer</artifactId>
@@ -48,6 +48,11 @@
     </dependency>
     <dependency>
         <groupId>org.apache.geronimo.modules</groupId>
+        <artifactId>geronimo-web</artifactId>
+        <type>jar</type>
+    </dependency>
+    <dependency>
+        <groupId>org.apache.geronimo.modules</groupId>
         <artifactId>geronimo-web-2.5-builder</artifactId>
         <type>jar</type>
     </dependency>

Modified: geronimo/server/trunk/plugins/j2ee/jsr88-war-configurer/src/main/history/dependencies.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/j2ee/jsr88-war-configurer/src/main/history/dependencies.xml?rev=939982&r1=939981&r2=939982&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/j2ee/jsr88-war-configurer/src/main/history/dependencies.xml (original)
+++ geronimo/server/trunk/plugins/j2ee/jsr88-war-configurer/src/main/history/dependencies.xml Sat May  1 11:51:06 2010
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<plugin-artifact xmlns:ns2="http://geronimo.apache.org/xml/ns/attributes-1.2" xmlns="http://geronimo.apache.org/xml/ns/plugins-1.3">
+<plugin-artifact xmlns="http://geronimo.apache.org/xml/ns/plugins-1.3" xmlns:ns2="http://geronimo.apache.org/xml/ns/attributes-1.2">
     <module-id>
         <groupId>org.apache.geronimo.configs</groupId>
         <artifactId>jsr88-war-configurer</artifactId>
@@ -148,6 +148,11 @@
     </dependency>
     <dependency>
         <groupId>org.apache.geronimo.modules</groupId>
+        <artifactId>geronimo-web</artifactId>
+        <type>jar</type>
+    </dependency>
+    <dependency>
+        <groupId>org.apache.geronimo.modules</groupId>
         <artifactId>geronimo-web-2.5-builder</artifactId>
         <type>jar</type>
     </dependency>

Modified: geronimo/server/trunk/plugins/j2ee/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/j2ee/pom.xml?rev=939982&r1=939981&r2=939982&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/j2ee/pom.xml (original)
+++ geronimo/server/trunk/plugins/j2ee/pom.xml Sat May  1 11:51:06 2010
@@ -42,6 +42,7 @@
         <module>geronimo-naming-builder</module>
         <module>geronimo-security-builder</module>
         <module>geronimo-test-ddbean</module>
+        <module>geronimo-web</module>
         <module>geronimo-web-2.5-builder</module>
         <module>j2ee-server</module>
         <module>jsr88-ear-configurer</module>

Modified: geronimo/server/trunk/plugins/jetty8/geronimo-jetty8-builder/src/main/java/org/apache/geronimo/jetty8/deployment/JettyModuleBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/jetty8/geronimo-jetty8-builder/src/main/java/org/apache/geronimo/jetty8/deployment/JettyModuleBuilder.java?rev=939982&r1=939981&r2=939982&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/jetty8/geronimo-jetty8-builder/src/main/java/org/apache/geronimo/jetty8/deployment/JettyModuleBuilder.java (original)
+++ geronimo/server/trunk/plugins/jetty8/geronimo-jetty8-builder/src/main/java/org/apache/geronimo/jetty8/deployment/JettyModuleBuilder.java Sat May  1 11:51:06 2010
@@ -84,7 +84,6 @@ import org.apache.geronimo.kernel.GBeanA
 import org.apache.geronimo.kernel.GBeanNotFoundException;
 import org.apache.geronimo.kernel.Kernel;
 import org.apache.geronimo.kernel.Naming;
-import org.apache.xbean.osgi.bundle.util.BundleUtils;
 import org.apache.geronimo.kernel.repository.Environment;
 import org.apache.geronimo.kernel.util.FileUtils;
 import org.apache.geronimo.kernel.util.JarUtils;
@@ -129,6 +128,7 @@ import org.apache.geronimo.xbeans.javaee
 import org.apache.geronimo.xbeans.javaee6.WebAppDocument;
 import org.apache.geronimo.xbeans.javaee6.WebAppType;
 import org.apache.geronimo.xbeans.javaee6.WelcomeFileListType;
+import org.apache.xbean.osgi.bundle.util.BundleUtils;
 import org.apache.xmlbeans.XmlException;
 import org.apache.xmlbeans.XmlObject;
 import org.osgi.framework.Bundle;
@@ -259,7 +259,7 @@ public class JettyModuleBuilder extends 
             try {
                 specDD = JarUtils.readAll(specDDUrl);
                 XmlObject parsed = XmlBeansUtil.parse(specDD);
-                WebAppDocument webAppDoc = convertToServletSchema(parsed);
+                WebAppDocument webAppDoc = SchemaConversionUtils.convertToServletSchema(parsed);
                 webApp = webAppDoc.getWebApp();
                 WebDeploymentValidationUtils.validateWebApp(webApp);
             } catch (XmlException e) {
@@ -301,7 +301,7 @@ public class JettyModuleBuilder extends 
         if (name == null) {
             name = bundle.getSymbolicName();
         }
-        
+
         WebModule module = new WebModule(standAlone, moduleName, name, environment, deployable, targetPath, webApp, jettyWebApp, specDD, contextPath, JETTY_NAMESPACE, annotatedWebApp);
         for (ModuleBuilderExtension mbe : moduleBuilderExtensions) {
             mbe.createModule(module, bundle, naming, idBuilder);
@@ -328,7 +328,7 @@ public class JettyModuleBuilder extends 
 
             // we found web.xml, if it won't parse that's an error.
             XmlObject parsed = XmlBeansUtil.parse(specDD);
-            WebAppDocument webAppDoc = convertToServletSchema(parsed);
+            WebAppDocument webAppDoc = SchemaConversionUtils.convertToServletSchema(parsed);
             webApp = webAppDoc.getWebApp();
             WebDeploymentValidationUtils.validateWebApp(webApp);
         } catch (XmlException e) {
@@ -392,7 +392,7 @@ public class JettyModuleBuilder extends 
                 name = FileUtils.removeExtension(targetPath, ".war");
             }
         }
-        
+
         WebModule module = new WebModule(standAlone, moduleName, name, environment, deployable, targetPath, webApp, jettyWebApp, specDD, contextRoot, JETTY_NAMESPACE, annotatedWebApp);
         for (ModuleBuilderExtension mbe : moduleBuilderExtensions) {
             mbe.createModule(module, plan, moduleFile, targetPath, specDDUrl, environment, contextRoot, earName, naming, idBuilder);
@@ -635,7 +635,7 @@ public class JettyModuleBuilder extends 
             addServlets(moduleName, webModule, servletTypes, servletMappings, moduleContext);
 
             if (jettyWebApp.isSetSecurityRealmName()) {
-                configureSecurityRealm(earContext, webApp, jettyWebApp, webModuleData);
+                configureSecurityRealm(earContext, webApp, jettyWebApp, bundle, webModuleData);
             }
 
             //See Jetty-386, GERONIMO-3738
@@ -677,7 +677,7 @@ public class JettyModuleBuilder extends 
 //        moduleContext.addGBean(beanData);
     }
 
-    private void configureSecurityRealm(EARContext earContext, WebAppType webApp, JettyWebAppType jettyWebApp, GBeanData webModuleData) throws DeploymentException {
+    private void configureSecurityRealm(EARContext earContext, WebAppType webApp, JettyWebAppType jettyWebApp, Bundle bundle, GBeanData webModuleData) throws DeploymentException {
         AbstractName moduleName = webModuleData.getAbstractName();
         if (earContext.getSecurityConfiguration() == null) {
             throw new DeploymentException(
@@ -694,9 +694,10 @@ public class JettyModuleBuilder extends 
         //String policyContextID = webModuleName.getCanonicalName();
         webModuleData.setAttribute("policyContextID", policyContextID);
 
-        ComponentPermissions componentPermissions = buildSpecSecurityConfig(webApp);
 
+        ComponentPermissions componentPermissions = buildSpecSecurityConfig(earContext, webApp, bundle);
         earContext.addSecurityContext(policyContextID, componentPermissions);
+
     }
 
     private void addDefaultServletsGBeans(EARContext earContext, EARContext moduleContext, AbstractName moduleName, Set knownServletMappings) throws GBeanNotFoundException, GBeanAlreadyExistsException {

Modified: geronimo/server/trunk/plugins/jetty8/geronimo-jetty8/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/jetty8/geronimo-jetty8/pom.xml?rev=939982&r1=939981&r2=939982&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/jetty8/geronimo-jetty8/pom.xml (original)
+++ geronimo/server/trunk/plugins/jetty8/geronimo-jetty8/pom.xml Sat May  1 11:51:06 2010
@@ -55,6 +55,12 @@
             <artifactId>geronimo-wab</artifactId>
             <version>${version}</version>
         </dependency>
+        
+        <dependency>
+            <groupId>org.apache.geronimo.modules</groupId>
+            <artifactId>geronimo-web</artifactId>
+            <version>${version}</version>
+        </dependency>
 
         <dependency>
             <groupId>org.apache.geronimo.framework</groupId>

Modified: geronimo/server/trunk/plugins/jetty8/jetty8-clustering-wadi/src/main/history/dependencies.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/jetty8/jetty8-clustering-wadi/src/main/history/dependencies.xml?rev=939982&r1=939981&r2=939982&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/jetty8/jetty8-clustering-wadi/src/main/history/dependencies.xml (original)
+++ geronimo/server/trunk/plugins/jetty8/jetty8-clustering-wadi/src/main/history/dependencies.xml Sat May  1 11:51:06 2010
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<plugin-artifact xmlns:ns2="http://geronimo.apache.org/xml/ns/attributes-1.2" xmlns="http://geronimo.apache.org/xml/ns/plugins-1.3">
+<plugin-artifact xmlns="http://geronimo.apache.org/xml/ns/plugins-1.3" xmlns:ns2="http://geronimo.apache.org/xml/ns/attributes-1.2">
     <module-id>
         <groupId>org.apache.geronimo.configs</groupId>
         <artifactId>jetty8-clustering-wadi</artifactId>
@@ -28,6 +28,11 @@
     </dependency>
     <dependency>
         <groupId>org.apache.geronimo.modules</groupId>
+        <artifactId>geronimo-j2ee-schema</artifactId>
+        <type>jar</type>
+    </dependency>
+    <dependency>
+        <groupId>org.apache.geronimo.modules</groupId>
         <artifactId>geronimo-jetty8-clustering-wadi</artifactId>
         <type>jar</type>
     </dependency>
@@ -37,6 +42,11 @@
         <type>jar</type>
     </dependency>
     <dependency>
+        <groupId>org.apache.geronimo.modules</groupId>
+        <artifactId>geronimo-web</artifactId>
+        <type>jar</type>
+    </dependency>
+    <dependency>
         <groupId>org.eclipse.jetty</groupId>
         <artifactId>jetty-jaspi</artifactId>
         <type>jar</type>

Modified: geronimo/server/trunk/plugins/jetty8/jetty8/src/main/history/dependencies.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/jetty8/jetty8/src/main/history/dependencies.xml?rev=939982&r1=939981&r2=939982&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/jetty8/jetty8/src/main/history/dependencies.xml (original)
+++ geronimo/server/trunk/plugins/jetty8/jetty8/src/main/history/dependencies.xml Sat May  1 11:51:06 2010
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<plugin-artifact xmlns:ns2="http://geronimo.apache.org/xml/ns/attributes-1.2" xmlns="http://geronimo.apache.org/xml/ns/plugins-1.3">
+<plugin-artifact xmlns="http://geronimo.apache.org/xml/ns/plugins-1.3" xmlns:ns2="http://geronimo.apache.org/xml/ns/attributes-1.2">
     <module-id>
         <groupId>org.apache.geronimo.configs</groupId>
         <artifactId>jetty8</artifactId>
@@ -33,6 +33,11 @@
     </dependency>
     <dependency>
         <groupId>org.apache.geronimo.modules</groupId>
+        <artifactId>geronimo-j2ee-schema</artifactId>
+        <type>jar</type>
+    </dependency>
+    <dependency>
+        <groupId>org.apache.geronimo.modules</groupId>
         <artifactId>geronimo-jetty8</artifactId>
         <type>jar</type>
     </dependency>
@@ -42,6 +47,11 @@
         <type>jar</type>
     </dependency>
     <dependency>
+        <groupId>org.apache.geronimo.modules</groupId>
+        <artifactId>geronimo-web</artifactId>
+        <type>jar</type>
+    </dependency>
+    <dependency>
         <groupId>org.eclipse.jetty</groupId>
         <artifactId>jetty-ajp</artifactId>
         <type>jar</type>

Modified: geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7-builder/src/main/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7-builder/src/main/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilder.java?rev=939982&r1=939981&r2=939982&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7-builder/src/main/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilder.java (original)
+++ geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7-builder/src/main/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilder.java Sat May  1 11:51:06 2010
@@ -61,16 +61,15 @@ import org.apache.geronimo.j2ee.deployme
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
 import org.apache.geronimo.kernel.Kernel;
 import org.apache.geronimo.kernel.Naming;
-import org.apache.xbean.osgi.bundle.util.BundleUtils;
 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.schema.SchemaConversionUtils;
 import org.apache.geronimo.security.deployment.GeronimoSecurityBuilderImpl;
 import org.apache.geronimo.security.jaas.ConfigurationFactory;
-import org.apache.geronimo.security.jacc.ComponentPermissions;
 import org.apache.geronimo.tomcat.LifecycleListenerGBean;
 import org.apache.geronimo.tomcat.ManagerGBean;
 import org.apache.geronimo.tomcat.RealmGBean;
@@ -78,6 +77,7 @@ import org.apache.geronimo.tomcat.Tomcat
 import org.apache.geronimo.tomcat.ValveGBean;
 import org.apache.geronimo.tomcat.cluster.CatalinaClusterGBean;
 import org.apache.geronimo.tomcat.util.SecurityHolder;
+import org.apache.geronimo.web.WebAttributeName;
 import org.apache.geronimo.web.deployment.GenericToSpecificPlanConverter;
 import org.apache.geronimo.web25.deployment.AbstractWebModuleBuilder;
 import org.apache.geronimo.web25.deployment.security.AuthenticationWrapper;
@@ -93,6 +93,7 @@ import org.apache.geronimo.xbeans.geroni
 import org.apache.geronimo.xbeans.javaee6.ServletType;
 import org.apache.geronimo.xbeans.javaee6.WebAppDocument;
 import org.apache.geronimo.xbeans.javaee6.WebAppType;
+import org.apache.xbean.osgi.bundle.util.BundleUtils;
 import org.apache.xmlbeans.XmlException;
 import org.apache.xmlbeans.XmlObject;
 import org.osgi.framework.Bundle;
@@ -171,7 +172,7 @@ public class TomcatModuleBuilder extends
             try {
                 specDD = JarUtils.readAll(specDDUrl);
                 XmlObject parsed = XmlBeansUtil.parse(specDD);
-                WebAppDocument webAppDoc = convertToServletSchema(parsed);
+                WebAppDocument webAppDoc = SchemaConversionUtils.convertToServletSchema(parsed);
                 webApp = webAppDoc.getWebApp();
                 WebDeploymentValidationUtils.validateWebApp(webApp);
             } catch (XmlException e) {
@@ -213,7 +214,7 @@ public class TomcatModuleBuilder extends
         if (name == null) {
             name = bundle.getSymbolicName();
         }
-        
+
         WebModule module = new WebModule(standAlone, moduleName, name, environment, deployable, targetPath, webApp, tomcatWebApp, specDD, contextPath, TOMCAT_NAMESPACE, annotatedWebApp);
         for (ModuleBuilderExtension mbe : moduleBuilderExtensions) {
             mbe.createModule(module, bundle, naming, idBuilder);
@@ -241,7 +242,7 @@ public class TomcatModuleBuilder extends
             // we found web.xml, if it won't parse that's an error.
             XmlObject parsed = XmlBeansUtil.parse(specDD);
 
-            WebAppDocument webAppDoc = convertToServletSchema(parsed);
+            WebAppDocument webAppDoc = SchemaConversionUtils.convertToServletSchema(parsed);
             webApp = webAppDoc.getWebApp();
             WebDeploymentValidationUtils.validateWebApp(webApp);
         } catch (XmlException e) {
@@ -305,14 +306,14 @@ public class TomcatModuleBuilder extends
                 name = FileUtils.removeExtension(targetPath, ".war");
             }
         }
-        
+
         WebModule module = new WebModule(standAlone, moduleName, name, environment, deployable, targetPath, webApp, tomcatWebApp, specDD, contextRoot, TOMCAT_NAMESPACE, annotatedWebApp);
         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, WebAppType webApp, boolean standAlone, JarFile moduleFile, String targetPath) {
         //If we have a context root, override everything
         if (tomcatWebApp.isSetContextRoot()) {
@@ -551,8 +552,11 @@ public class TomcatModuleBuilder extends
                 String policyContextID = moduleName.toString().replaceAll("[, :]", "_");
                 securityHolder.setPolicyContextID(policyContextID);
 
+                /*
+                 * For web applications, we would not calculate permissions in the deployment time, as it is allowed to update in Servlet 3.0 on the initialize step
                 ComponentPermissions componentPermissions = buildSpecSecurityConfig(webApp);
                 earContext.addSecurityContext(policyContextID, componentPermissions);
+                */
                 //TODO WTF is this for?
                 securityHolder.setSecurity(true);
 
@@ -562,14 +566,24 @@ public class TomcatModuleBuilder extends
                     AuthenticationWrapper authType = new TomcatAuthenticationWrapper(tomcatWebApp.getAuthentication());
                     configureLocalJaspicProvider(authType, contextPath, module, webModuleData);
                 }
-
             }
 
+            //Save Deployment Attributes
+            Map<String, Object> deploymentAttributes = new HashMap<String, Object>();
+            deploymentAttributes.put(WebAttributeName.META_COMPLETE.name(), webApp.getMetadataComplete());
+            deploymentAttributes.put(WebAttributeName.SCHEMA_VERSION.name(), INITIAL_WEB_XML_SCHEMA_VERSION.get(earContext.getGeneralData()));
+            deploymentAttributes.put(WebAttributeName.ORDERED_LIBS.name(), AbstractWebModuleBuilder.ORDERED_LIBS.get(earContext.getGeneralData()));
+            deploymentAttributes.put(WebAttributeName.SERVLET_CONTAINER_INITIALIZERS.name(), AbstractWebModuleBuilder.SERVLET_CONTAINER_INITIALIZERS.get(earContext.getGeneralData()));
+            webModuleData.setAttribute("deploymentAttributes", deploymentAttributes);
+
             //listeners added directly to the StandardContext will get loaded by the tomcat classloader, not the app classloader!
             //TODO this may definitely not be the best place for this!
             for (ModuleBuilderExtension mbe : moduleBuilderExtensions) {
                 mbe.addGBeans(earContext, module, bundle, repository);
             }
+            if(tomcatWebApp.isSetSecurityRealmName()) {
+                webModuleData.setReferencePattern("applicationPolicyConfigurationManager", EARContext.JACC_MANAGER_NAME_KEY.get(earContext.getGeneralData()));
+            }
             //not truly metadata complete until MBEs have run
             if (!webApp.getMetadataComplete()) {
                 webApp.setMetadataComplete(true);
@@ -580,7 +594,6 @@ public class TomcatModuleBuilder extends
                 }
             }
             webModuleData.setAttribute("deploymentDescriptor", module.getOriginalSpecDD());
-
             module.addAsChildConfiguration();
         } catch (DeploymentException de) {
             throw de;

Modified: geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/pom.xml?rev=939982&r1=939981&r2=939982&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/pom.xml (original)
+++ geronimo/server/trunk/plugins/tomcat/geronimo-tomcat7/pom.xml Sat May  1 11:51:06 2010
@@ -52,6 +52,12 @@
             <artifactId>geronimo-wab</artifactId>
             <version>${version}</version>
         </dependency>
+        
+        <dependency>
+            <groupId>org.apache.geronimo.modules</groupId>
+            <artifactId>geronimo-web</artifactId>
+            <version>${version}</version>
+        </dependency>
 
         <!-- g-security comes from this -->
         <dependency>
@@ -77,12 +83,6 @@
             <scope>test</scope>
         </dependency>
 
-        <!--<dependency>-->
-        <!--<groupId>${tomcatGroupId}</groupId>-->
-        <!--<artifactId>jasper-jdt</artifactId>-->
-        <!--<scope>test</scope>-->
-        <!--</dependency>-->
-
         <dependency>
             <groupId>org.ops4j.pax.logging</groupId>
             <artifactId>pax-logging-api</artifactId>



Mime
View raw message