geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jgenen...@apache.org
Subject svn commit: r164651 [1/3] - in /geronimo/trunk/modules/tomcat-builder: ./ src/ src/java/ src/java/org/ src/java/org/apache/ src/java/org/apache/geronimo/ src/java/org/apache/geronimo/tomcat/ src/java/org/apache/geronimo/tomcat/deployment/ src/schema/ src/test-resources/ src/test-resources/data/ src/test-resources/deployables/ src/test-resources/deployables/cltest/ src/test-resources/deployables/cltest/javax/ src/test-resources/deployables/cltest/javax/foo/ src/test-resources/deployables/cltest/javax/servlet/ src/test-resources/deployables/cltest/mx4j/ src/test-resources/deployables/war1/ src/test-resources/deployables/war1/WEB-INF/ src/test-resources/deployables/war3/ src/test-resources/deployables/war3/WEB-INF/ src/test-resources/deployables/war3/auth/ src/test-resources/deployables/war3/protected/ src/test-resources/deployables/war4/ src/test-resources/deployables/war4/WEB-INF/ src/test-resources/deployables/war4/WEB-INF/classes/ src/test-resources/deployables/war4/WEB-INF/classes/org/ src/test-resources/deployables/war4/WEB-INF/classes/org/apache/ src/test-resources/deployables/war4/WEB-INF/classes/org/apache/geronimo/ src/test-resources/deployables/war4/WEB-INF/classes/org/apache/geronimo/tomcat/ src/test-resources/deployables/war4/WEB-INF/classes/org/apache/geronimo/tomcat/app/ src/test-resources/plans/ src/test-resources/services/ src/test/ src/test/org/ src/test/org/apache/ src/test/org/apache/geronimo/ src/test/org/apache/geronimo/tomcat/ src/test/org/apache/geronimo/tomcat/app/ src/test/org/apache/geronimo/tomcat/deployment/ src/var/
Date Mon, 25 Apr 2005 21:09:29 GMT
Author: jgenender
Date: Mon Apr 25 14:09:26 2005
New Revision: 164651

URL: http://svn.apache.org/viewcvs?rev=164651&view=rev
Log:
New tomcat-builder

Added:
    geronimo/trunk/modules/tomcat-builder/
    geronimo/trunk/modules/tomcat-builder/LICENSE.txt
    geronimo/trunk/modules/tomcat-builder/NOTICE.txt
    geronimo/trunk/modules/tomcat-builder/maven.xml
    geronimo/trunk/modules/tomcat-builder/project.properties
    geronimo/trunk/modules/tomcat-builder/project.xml
    geronimo/trunk/modules/tomcat-builder/src/
    geronimo/trunk/modules/tomcat-builder/src/java/
    geronimo/trunk/modules/tomcat-builder/src/java/org/
    geronimo/trunk/modules/tomcat-builder/src/java/org/apache/
    geronimo/trunk/modules/tomcat-builder/src/java/org/apache/geronimo/
    geronimo/trunk/modules/tomcat-builder/src/java/org/apache/geronimo/tomcat/
    geronimo/trunk/modules/tomcat-builder/src/java/org/apache/geronimo/tomcat/deployment/
    geronimo/trunk/modules/tomcat-builder/src/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilder.java
    geronimo/trunk/modules/tomcat-builder/src/java/org/apache/geronimo/tomcat/deployment/WARConfiguration.java
    geronimo/trunk/modules/tomcat-builder/src/java/org/apache/geronimo/tomcat/deployment/WARConfigurer.java
    geronimo/trunk/modules/tomcat-builder/src/java/org/apache/geronimo/tomcat/deployment/WebAppDConfigBean.java
    geronimo/trunk/modules/tomcat-builder/src/java/org/apache/geronimo/tomcat/deployment/WebAppDConfigRoot.java
    geronimo/trunk/modules/tomcat-builder/src/schema/
    geronimo/trunk/modules/tomcat-builder/src/schema/geronimo-tomcat.xsd
    geronimo/trunk/modules/tomcat-builder/src/schema/xmlconfig.xml
    geronimo/trunk/modules/tomcat-builder/src/test/
    geronimo/trunk/modules/tomcat-builder/src/test-resources/
    geronimo/trunk/modules/tomcat-builder/src/test-resources/data/
    geronimo/trunk/modules/tomcat-builder/src/test-resources/data/groups.properties
    geronimo/trunk/modules/tomcat-builder/src/test-resources/data/login.config
    geronimo/trunk/modules/tomcat-builder/src/test-resources/data/users.properties
    geronimo/trunk/modules/tomcat-builder/src/test-resources/deployables/
    geronimo/trunk/modules/tomcat-builder/src/test-resources/deployables/cltest/
    geronimo/trunk/modules/tomcat-builder/src/test-resources/deployables/cltest/javax/
    geronimo/trunk/modules/tomcat-builder/src/test-resources/deployables/cltest/javax/foo/
    geronimo/trunk/modules/tomcat-builder/src/test-resources/deployables/cltest/javax/foo/Foo.class   (with props)
    geronimo/trunk/modules/tomcat-builder/src/test-resources/deployables/cltest/javax/servlet/
    geronimo/trunk/modules/tomcat-builder/src/test-resources/deployables/cltest/javax/servlet/Servlet.class   (with props)
    geronimo/trunk/modules/tomcat-builder/src/test-resources/deployables/cltest/mx4j/
    geronimo/trunk/modules/tomcat-builder/src/test-resources/deployables/cltest/mx4j/MBeanDescription.class   (with props)
    geronimo/trunk/modules/tomcat-builder/src/test-resources/deployables/war1/
    geronimo/trunk/modules/tomcat-builder/src/test-resources/deployables/war1/WEB-INF/
    geronimo/trunk/modules/tomcat-builder/src/test-resources/deployables/war1/WEB-INF/geronimo-tomcat.xml
    geronimo/trunk/modules/tomcat-builder/src/test-resources/deployables/war1/WEB-INF/web.xml
    geronimo/trunk/modules/tomcat-builder/src/test-resources/deployables/war1/hello.txt
    geronimo/trunk/modules/tomcat-builder/src/test-resources/deployables/war2.war   (with props)
    geronimo/trunk/modules/tomcat-builder/src/test-resources/deployables/war3/
    geronimo/trunk/modules/tomcat-builder/src/test-resources/deployables/war3/WEB-INF/
    geronimo/trunk/modules/tomcat-builder/src/test-resources/deployables/war3/WEB-INF/geronimo-tomcat.xml
    geronimo/trunk/modules/tomcat-builder/src/test-resources/deployables/war3/WEB-INF/web.xml
    geronimo/trunk/modules/tomcat-builder/src/test-resources/deployables/war3/auth/
    geronimo/trunk/modules/tomcat-builder/src/test-resources/deployables/war3/auth/logon.html
    geronimo/trunk/modules/tomcat-builder/src/test-resources/deployables/war3/auth/logonError.html
    geronimo/trunk/modules/tomcat-builder/src/test-resources/deployables/war3/protected/
    geronimo/trunk/modules/tomcat-builder/src/test-resources/deployables/war3/protected/hello.txt
    geronimo/trunk/modules/tomcat-builder/src/test-resources/deployables/war4/
    geronimo/trunk/modules/tomcat-builder/src/test-resources/deployables/war4/WEB-INF/
    geronimo/trunk/modules/tomcat-builder/src/test-resources/deployables/war4/WEB-INF/classes/
    geronimo/trunk/modules/tomcat-builder/src/test-resources/deployables/war4/WEB-INF/classes/org/
    geronimo/trunk/modules/tomcat-builder/src/test-resources/deployables/war4/WEB-INF/classes/org/apache/
    geronimo/trunk/modules/tomcat-builder/src/test-resources/deployables/war4/WEB-INF/classes/org/apache/geronimo/
    geronimo/trunk/modules/tomcat-builder/src/test-resources/deployables/war4/WEB-INF/classes/org/apache/geronimo/tomcat/
    geronimo/trunk/modules/tomcat-builder/src/test-resources/deployables/war4/WEB-INF/classes/org/apache/geronimo/tomcat/app/
    geronimo/trunk/modules/tomcat-builder/src/test-resources/deployables/war4/WEB-INF/classes/org/apache/geronimo/tomcat/app/Filter1.class   (with props)
    geronimo/trunk/modules/tomcat-builder/src/test-resources/deployables/war4/WEB-INF/classes/org/apache/geronimo/tomcat/app/Filter2.class   (with props)
    geronimo/trunk/modules/tomcat-builder/src/test-resources/deployables/war4/WEB-INF/classes/org/apache/geronimo/tomcat/app/Servlet1.class   (with props)
    geronimo/trunk/modules/tomcat-builder/src/test-resources/deployables/war4/WEB-INF/classes/org/apache/geronimo/tomcat/app/Servlet2.class   (with props)
    geronimo/trunk/modules/tomcat-builder/src/test-resources/deployables/war4/WEB-INF/web.xml
    geronimo/trunk/modules/tomcat-builder/src/test-resources/plans/
    geronimo/trunk/modules/tomcat-builder/src/test-resources/plans/plan1.xml
    geronimo/trunk/modules/tomcat-builder/src/test-resources/services/
    geronimo/trunk/modules/tomcat-builder/src/test-resources/services/local.xml
    geronimo/trunk/modules/tomcat-builder/src/test/org/
    geronimo/trunk/modules/tomcat-builder/src/test/org/apache/
    geronimo/trunk/modules/tomcat-builder/src/test/org/apache/geronimo/
    geronimo/trunk/modules/tomcat-builder/src/test/org/apache/geronimo/tomcat/
    geronimo/trunk/modules/tomcat-builder/src/test/org/apache/geronimo/tomcat/app/
    geronimo/trunk/modules/tomcat-builder/src/test/org/apache/geronimo/tomcat/app/Filter1.java
    geronimo/trunk/modules/tomcat-builder/src/test/org/apache/geronimo/tomcat/app/Filter2.java
    geronimo/trunk/modules/tomcat-builder/src/test/org/apache/geronimo/tomcat/app/Servlet1.java
    geronimo/trunk/modules/tomcat-builder/src/test/org/apache/geronimo/tomcat/app/Servlet2.java
    geronimo/trunk/modules/tomcat-builder/src/test/org/apache/geronimo/tomcat/deployment/
    geronimo/trunk/modules/tomcat-builder/src/test/org/apache/geronimo/tomcat/deployment/PlanParsingTest.java
    geronimo/trunk/modules/tomcat-builder/src/test/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilderTest.java
    geronimo/trunk/modules/tomcat-builder/src/test/org/apache/geronimo/tomcat/deployment/WebAppDConfigTest.java
    geronimo/trunk/modules/tomcat-builder/src/var/
    geronimo/trunk/modules/tomcat-builder/src/var/web.xml   (with props)

Added: geronimo/trunk/modules/tomcat-builder/LICENSE.txt
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/tomcat-builder/LICENSE.txt?rev=164651&view=auto
==============================================================================
--- geronimo/trunk/modules/tomcat-builder/LICENSE.txt (added)
+++ geronimo/trunk/modules/tomcat-builder/LICENSE.txt Mon Apr 25 14:09:26 2005
@@ -0,0 +1,203 @@
+
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   Licensed 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.
+

Added: geronimo/trunk/modules/tomcat-builder/NOTICE.txt
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/tomcat-builder/NOTICE.txt?rev=164651&view=auto
==============================================================================
--- geronimo/trunk/modules/tomcat-builder/NOTICE.txt (added)
+++ geronimo/trunk/modules/tomcat-builder/NOTICE.txt Mon Apr 25 14:09:26 2005
@@ -0,0 +1,3 @@
+This product includes software developed by
+The Apache Software Foundation (http://www.apache.org/).
+

Added: geronimo/trunk/modules/tomcat-builder/maven.xml
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/tomcat-builder/maven.xml?rev=164651&view=auto
==============================================================================
--- geronimo/trunk/modules/tomcat-builder/maven.xml (added)
+++ geronimo/trunk/modules/tomcat-builder/maven.xml Mon Apr 25 14:09:26 2005
@@ -0,0 +1,62 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+
+    Copyright 2004 The Apache Software Foundation
+
+    Licensed 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: 56771 $ $Date: 2004-11-06 12:58:54 -0700 (Sat, 06 Nov 2004) $ -->
+
+<project default="default"
+    xmlns:j="jelly:core"
+    xmlns:ant="jelly:ant"
+    xmlns:maven="jelly:maven"
+    xmlns:xmlbeans="geronimo:xmlbeans">
+
+    <preGoal name="java:compile">
+        <xmlbeans:schema2java
+            sourcedir="${basedir}/src"
+            sourceschema="schema/geronimo-tomcat.xsd"
+            xmlconfigs="${basedir}/src/schema/xmlconfig.xml"
+            targetdir="${basedir}/target/xmlbeans"
+            cataloglocation="${basedir}/../j2ee-schema/src/catalog/resolver-catalog.xml"/>
+    </preGoal>
+
+    <preGoal name="test:test">
+    
+        <j:set var="endorsed.dir" value="${maven.build.dir}/endorsed"/>
+        
+        <mkdir dir="${endorsed.dir}"/>
+        <mkdir dir="${maven.build.dir}/var"/>
+        <mkdir dir="${maven.build.dir}/var/catalina"/>
+        <mkdir dir="${maven.build.dir}/var/catalina/webapps"/>
+        <mkdir dir="${maven.build.dir}/var/catalina/conf"/>
+        <copy todir="${maven.build.dir}/var/catalina/conf" file="src/var/web.xml"/>
+        <copy todir="${maven.build.dir}/var/catalina/webapps">
+            <fileset dir="src/test-resources/deployables">
+                <include name="war1/**"/>
+                <include name="war3/**"/>
+                <include name="war4/**"/>
+            </fileset>
+        </copy>
+
+        <j:forEach var="dep" items="${pom.dependencies}">
+            <j:if test="${dep.artifactId.equals('xercesImpl') || dep.artifactId.equals('xml-apis')}">
+                <copy file="${maven.repo.local}/${dep.groupId}/jars/${dep.artifact}" todir="${endorsed.dir}"/>
+            </j:if>
+        </j:forEach>
+    </preGoal>
+
+</project>

Added: geronimo/trunk/modules/tomcat-builder/project.properties
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/tomcat-builder/project.properties?rev=164651&view=auto
==============================================================================
--- geronimo/trunk/modules/tomcat-builder/project.properties (added)
+++ geronimo/trunk/modules/tomcat-builder/project.properties Mon Apr 25 14:09:26 2005
@@ -0,0 +1,15 @@
+##
+## $Rev: 151530 $ $Date: 2005-02-05 16:47:24 -0700 (Sat, 05 Feb 2005) $
+##
+
+# the directory containing the geronimo website in CVS
+
+#maven.repo.remote=http://www.apache.org/~jboynes, http://www.mortbay.org/maven, http://www.openejb.org/maven, http://dist.codehaus.org, http://www.ibiblio.org/maven, http://www.apache.org/dist/java-repository/
+
+maven.junit.jvmargs=-Djava.security.auth.login.config=src/test-resources/data/login.config -ea
+maven.junit.fork=true
+
+# Include the generated xmlbean classes in the eclipse classpath
+maven.eclipse.classpath.include=target/xmlbeans
+
+maven.idea.generated.source=xmlbeans

Added: geronimo/trunk/modules/tomcat-builder/project.xml
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/tomcat-builder/project.xml?rev=164651&view=auto
==============================================================================
--- geronimo/trunk/modules/tomcat-builder/project.xml (added)
+++ geronimo/trunk/modules/tomcat-builder/project.xml Mon Apr 25 14:09:26 2005
@@ -0,0 +1,442 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+
+    Copyright 2004 The Apache Software Foundation
+
+    Licensed 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: 160134 $ $Date: 2005-04-05 00:20:16 -0600 (Tue, 05 Apr 2005) $ -->
+
+<project>
+    <pomVersion>3</pomVersion>
+    <extend>../../etc/project.xml</extend>
+
+    <!-- ===================== -->
+    <!-- Module Identification -->
+    <!-- ===================== -->
+
+    <name>Geronimo :: Tomcat :: Builder</name>
+    <id>geronimo-tomcat-builder</id>
+    <shortDescription>Tomcat Deployer</shortDescription>
+    <description>Geronimo Tomcat Deployer</description>
+    <url>http://geronimo.apache.org/modules/tomcat-builder/</url>
+    <siteDirectory>/www/geronimo.apache.org/modules/tomcat-builder</siteDirectory>
+    <distributionDirectory>/www/incubator.apache.org/projects/geronimo/builds/tomcat-builder</distributionDirectory>
+
+    <package>org.apache.geronimo.tomcat</package>
+
+    <!-- ============ -->
+    <!-- Dependencies -->
+    <!-- ============ -->
+
+    <dependencies>
+        <dependency>
+            <groupId>geronimo</groupId>
+            <artifactId>geronimo-xmlbeans-plugin</artifactId>
+            <version>${pom.currentVersion}</version>
+            <type>plugin</type>
+        </dependency>
+
+        <!-- needed for xmlbeans runtime-->
+        <dependency>
+            <groupId>xmlbeans</groupId>
+            <artifactId>xbean-apache</artifactId>
+            <version>${xmlbeans_version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>geronimo</groupId>
+            <artifactId>geronimo-kernel</artifactId>
+            <version>${pom.currentVersion}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>geronimo</groupId>
+            <artifactId>geronimo-deployment</artifactId>
+            <version>${pom.currentVersion}</version>
+        </dependency>
+
+    <!-- todo: remove this once the DConfigBean home is selected -->
+        <dependency>
+            <groupId>geronimo</groupId>
+            <artifactId>geronimo-deploy-tool</artifactId>
+            <version>${pom.currentVersion}</version>
+        </dependency>
+        <dependency>
+            <groupId>geronimo</groupId>
+            <artifactId>geronimo-test-ddbean</artifactId>
+            <version>${geronimo_version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>geronimo</groupId>
+            <artifactId>geronimo-naming</artifactId>
+            <version>${pom.currentVersion}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>geronimo</groupId>
+            <artifactId>geronimo-naming-builder</artifactId>
+            <version>${pom.currentVersion}</version>
+            <properties>
+                <xmlbeans>true</xmlbeans>
+            </properties>
+        </dependency>
+
+       <dependency>
+            <groupId>geronimo</groupId>
+            <artifactId>geronimo-tomcat</artifactId>
+            <version>${pom.currentVersion}</version>
+        </dependency>
+
+       <dependency>
+            <groupId>geronimo</groupId>
+            <artifactId>geronimo-j2ee</artifactId>
+            <version>${pom.currentVersion}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>geronimo</groupId>
+            <artifactId>geronimo-j2ee-builder</artifactId>
+            <version>${pom.currentVersion}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>geronimo</groupId>
+            <artifactId>geronimo-security</artifactId>
+            <version>${pom.currentVersion}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>geronimo</groupId>
+            <artifactId>geronimo-security-builder</artifactId>
+            <version>${pom.currentVersion}</version>
+            <properties>
+                <xmlbeans>true</xmlbeans>
+            </properties>
+        </dependency>
+
+        <dependency>
+            <groupId>geronimo</groupId>
+            <artifactId>geronimo-service-builder</artifactId>
+            <version>${pom.currentVersion}</version>
+            <properties>
+                <xmlbeans>true</xmlbeans>
+            </properties>
+        </dependency>
+
+        <dependency>
+            <groupId>geronimo</groupId>
+            <artifactId>geronimo-transaction</artifactId>
+            <version>${pom.currentVersion}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>geronimo</groupId>
+            <artifactId>geronimo-connector</artifactId>
+            <version>${pom.currentVersion}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>geronimo</groupId>
+            <artifactId>geronimo-common</artifactId>
+            <version>${pom.currentVersion}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>geronimo</groupId>
+            <artifactId>geronimo-system</artifactId>
+            <version>${pom.currentVersion}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>geronimo</groupId>
+            <artifactId>geronimo-service-builder</artifactId>
+            <version>${pom.currentVersion}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>geronimo</groupId>
+            <artifactId>geronimo-webservices</artifactId>
+            <version>${pom.currentVersion}</version>
+        </dependency>
+
+        <!--todo put WSDescriptorParser somewhere else and remove this dependency-->
+        <dependency>
+            <groupId>geronimo</groupId>
+            <artifactId>geronimo-axis-builder</artifactId>
+            <version>${pom.currentVersion}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>geronimo-spec</groupId>
+            <artifactId>geronimo-spec-jta</artifactId>
+            <version>${geronimo_spec_jta_version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>geronimo-spec</groupId>
+            <artifactId>geronimo-spec-j2ee-jacc</artifactId>
+            <version>${geronimo_spec_j2ee_jacc_version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>geronimo-spec</groupId>
+            <artifactId>geronimo-spec-j2ee-connector</artifactId>
+            <version>${geronimo_spec_j2ee_connector_version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>geronimo-spec</groupId>
+            <artifactId>geronimo-spec-j2ee-deployment</artifactId>
+            <version>${geronimo_spec_j2ee_deployment_version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>geronimo</groupId>
+            <artifactId>geronimo-j2ee-schema</artifactId>
+            <version>${pom.currentVersion}</version>
+            <properties>
+                <xmlbeans>true</xmlbeans>
+            </properties>
+        </dependency>
+
+        <dependency>
+            <groupId>mx4j</groupId>
+            <artifactId>mx4j</artifactId>
+            <version>${mx4j_version}</version>
+        </dependency>
+
+        <!-- these are just needed to run the unit tests -->
+        <dependency>
+            <groupId>geronimo-spec</groupId>
+            <artifactId>geronimo-spec-servlet</artifactId>
+            <version>${geronimo_spec_servlet_version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>geronimo-spec</groupId>
+            <artifactId>geronimo-spec-jsp</artifactId>
+            <version>${geronimo_spec_jsp_version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>geronimo-spec</groupId>
+            <artifactId>geronimo-spec-jaxrpc</artifactId>
+            <version>${geronimo_spec_jaxrpc_version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>geronimo-spec</groupId>
+            <artifactId>geronimo-spec-saaj</artifactId>
+            <version>${geronimo_spec_saaj_version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>commons-logging</groupId>
+            <artifactId>commons-logging</artifactId>
+            <version>${commons_logging_version}</version>
+            <url>http://jakarta.apache.org/commons/logging/</url>
+        </dependency>
+
+        <dependency>
+            <groupId>commons-modeler</groupId>
+            <artifactId>commons-modeler</artifactId>
+            <version>${commons_modeler_version}</version>
+            <url>http://jakarta.apache.org/commons/modeler</url>
+            <properties>
+                <repository>true</repository>
+            </properties>
+        </dependency>
+
+        <dependency>
+            <groupId>tomcat</groupId>
+            <artifactId>jasper-compiler</artifactId>
+            <version>${tomcat_version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>tomcat</groupId>
+            <artifactId>jasper-runtime</artifactId>
+            <version>${tomcat_version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>commons-el</groupId>
+            <artifactId>commons-el</artifactId>
+            <version>${commons_el_version}</version>
+            <url>http://jakarta.apache.org/commons/el/</url>
+        </dependency>
+
+        <dependency>
+            <groupId>ant</groupId>
+            <artifactId>ant</artifactId>
+            <version>${ant_version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>xerces</groupId>
+            <artifactId>xercesImpl</artifactId>
+            <version>${xerces_version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>cglib</groupId>
+            <artifactId>cglib-full</artifactId>
+            <version>${cglib_version}</version>
+            <url>http://cglib.sf.net/</url>
+        </dependency>
+
+        <dependency>
+            <groupId>concurrent</groupId>
+            <artifactId>concurrent</artifactId>
+            <version>${concurrent_version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>regexp</groupId>
+            <artifactId>regexp</artifactId>
+            <version>${regexp_version}</version>
+            <url>http://jakarta.apache.org/regexp</url>
+        </dependency>
+        
+       <dependency>
+            <groupId>tomcat</groupId>
+            <artifactId>catalina</artifactId>
+            <version>${tomcat_version}</version>
+            <url>http://jakarta.apache.org/tomcat/</url>
+            <properties>
+                <repository>true</repository>
+            </properties>
+        </dependency>
+
+       <dependency>
+            <groupId>tomcat</groupId>
+            <artifactId>catalina-optional</artifactId>
+            <version>${tomcat_version}</version>
+            <url>http://jakarta.apache.org/tomcat/</url>
+            <properties>
+                <repository>true</repository>
+            </properties>
+        </dependency>
+
+        <dependency>
+            <groupId>tomcat</groupId>
+            <artifactId>tomcat-coyote</artifactId>
+            <version>${tomcat_version}</version>
+            <url>http://jakarta.apache.org/tomcat/</url>
+            <properties>
+                <repository>true</repository>
+            </properties>
+        </dependency>
+
+        <dependency>
+            <groupId>tomcat</groupId>
+            <artifactId>naming-resources</artifactId>
+            <version>${tomcat_version}</version>
+            <url>http://jakarta.apache.org/tomcat/</url>
+            <properties>
+                <repository>true</repository>
+            </properties>
+        </dependency>
+
+        <dependency>
+            <groupId>tomcat</groupId>
+            <artifactId>tomcat-http</artifactId>
+            <version>${tomcat_version}</version>
+            <url>http://jakarta.apache.org/tomcat/</url>
+            <properties>
+                <repository>true</repository>
+            </properties>
+        </dependency>
+
+        <dependency>
+            <groupId>tomcat</groupId>
+            <artifactId>tomcat-util</artifactId>
+            <version>${tomcat_version}</version>
+            <url>http://jakarta.apache.org/tomcat/</url>
+            <properties>
+                <repository>true</repository>
+            </properties>
+        </dependency>
+        	
+        <dependency>
+            <groupId>tranql</groupId>
+            <artifactId>tranql</artifactId>
+            <version>${tranql_version}</version>
+            <url>http://tranql.codehaus.org</url>
+        </dependency>
+
+        <dependency>
+            <groupId>wsdl4j</groupId>
+            <artifactId>wsdl4j</artifactId>
+            <version>${wsdl4j_version}</version>
+        </dependency>
+        
+        <dependency>
+            <groupId>xerces</groupId>
+            <artifactId>xercesImpl</artifactId>
+            <version>${xerces_version}</version>
+        </dependency>
+        
+        <dependency>
+            <groupId>xerces</groupId>
+            <artifactId>xmlParserAPIs</artifactId>
+            <version>${xml_parser_apis_version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>xml-apis</groupId>
+            <artifactId>xml-apis</artifactId>
+            <version>${xml_apis_version}</version>
+        </dependency>
+
+    </dependencies>
+
+
+    <!-- =================== -->
+    <!-- Build Specification -->
+    <!-- =================== -->
+
+    <build>
+        <resources>
+            <resource>
+                <directory>${basedir}/src/etc</directory>
+            </resource>
+            <resource>
+                <directory>${basedir}/target/xmlbeans</directory>
+                <includes>schema/**</includes>
+            </resource>
+        </resources>
+        <unitTest>
+            <includes>
+                <include>**/*Test.java</include>
+            </includes>
+            <excludes>
+                <exclude>**/Abstract*.java</exclude>
+            </excludes>
+            <resources>
+                <resource>
+                    <directory>${basedir}/src/schema</directory>
+                    <includes>
+                        <include>*.xsd</include>
+                    </includes>
+                </resource>
+                <resource>
+                    <directory>${basedir}/src/test-resources</directory>
+                </resource>
+            </resources>
+        </unitTest>
+    </build>
+</project>

Added: geronimo/trunk/modules/tomcat-builder/src/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilder.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/tomcat-builder/src/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilder.java?rev=164651&view=auto
==============================================================================
--- geronimo/trunk/modules/tomcat-builder/src/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilder.java (added)
+++ geronimo/trunk/modules/tomcat-builder/src/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilder.java Mon Apr 25 14:09:26 2005
@@ -0,0 +1,891 @@
+/**
+*
+* Copyright 2003-2004 The Apache Software Foundation
+*
+*  Licensed 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.tomcat.deployment;
+
+import java.io.File;
+import java.io.FileFilter;
+import java.io.IOException;
+import java.net.MalformedURLException;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.net.URL;
+import java.security.Permission;
+import java.security.PermissionCollection;
+import java.security.Permissions;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Enumeration;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.jar.JarFile;
+import java.util.zip.ZipEntry;
+import javax.management.MalformedObjectNameException;
+import javax.management.ObjectName;
+import javax.security.jacc.WebResourcePermission;
+import javax.security.jacc.WebRoleRefPermission;
+import javax.security.jacc.WebUserDataPermission;
+import javax.transaction.UserTransaction;
+
+import org.apache.catalina.core.StandardWrapper;
+import org.apache.geronimo.axis.builder.WSDescriptorParser;
+import org.apache.geronimo.common.DeploymentException;
+import org.apache.geronimo.deployment.service.ServiceConfigBuilder;
+import org.apache.geronimo.deployment.util.DeploymentUtil;
+import org.apache.geronimo.deployment.xbeans.DependencyType;
+import org.apache.geronimo.deployment.xbeans.GbeanType;
+import org.apache.geronimo.gbean.GBeanData;
+import org.apache.geronimo.gbean.GBeanInfo;
+import org.apache.geronimo.gbean.GBeanInfoBuilder;
+import org.apache.geronimo.j2ee.deployment.EARContext;
+import org.apache.geronimo.j2ee.deployment.Module;
+import org.apache.geronimo.j2ee.deployment.ModuleBuilder;
+import org.apache.geronimo.j2ee.deployment.POJOWebServiceBuilder;
+import org.apache.geronimo.j2ee.deployment.WebModule;
+import org.apache.geronimo.j2ee.j2eeobjectnames.J2eeContext;
+import org.apache.geronimo.j2ee.j2eeobjectnames.J2eeContextImpl;
+import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
+import org.apache.geronimo.tomcat.TomcatClassLoader;
+import org.apache.geronimo.tomcat.TomcatWebAppContext;
+import org.apache.geronimo.tomcat.util.SecurityHolder;
+import org.apache.geronimo.kernel.Kernel;
+import org.apache.geronimo.kernel.repository.Repository;
+import org.apache.geronimo.naming.deployment.ENCConfigBuilder;
+import org.apache.geronimo.naming.deployment.GBeanResourceEnvironmentBuilder;
+import org.apache.geronimo.schema.SchemaConversionUtils;
+import org.apache.geronimo.security.deploy.DefaultPrincipal;
+import org.apache.geronimo.security.deployment.SecurityBuilder;
+import org.apache.geronimo.security.deployment.SecurityConfiguration;
+import org.apache.geronimo.security.jacc.ComponentPermissions;
+import org.apache.geronimo.security.util.URLPattern;
+import org.apache.geronimo.transaction.context.OnlineUserTransaction;
+import org.apache.geronimo.xbeans.geronimo.tomcat.TomcatWebAppDocument;
+import org.apache.geronimo.xbeans.geronimo.tomcat.TomcatWebAppType;
+import org.apache.geronimo.xbeans.j2ee.DescriptionType;
+import org.apache.geronimo.xbeans.j2ee.DispatcherType;
+import org.apache.geronimo.xbeans.j2ee.DisplayNameType;
+import org.apache.geronimo.xbeans.j2ee.ErrorPageType;
+import org.apache.geronimo.xbeans.j2ee.FilterMappingType;
+import org.apache.geronimo.xbeans.j2ee.FilterType;
+import org.apache.geronimo.xbeans.j2ee.FormLoginConfigType;
+import org.apache.geronimo.xbeans.j2ee.HttpMethodType;
+import org.apache.geronimo.xbeans.j2ee.JspConfigType;
+import org.apache.geronimo.xbeans.j2ee.ListenerType;
+import org.apache.geronimo.xbeans.j2ee.LocaleEncodingMappingListType;
+import org.apache.geronimo.xbeans.j2ee.LocaleEncodingMappingType;
+import org.apache.geronimo.xbeans.j2ee.LoginConfigType;
+import org.apache.geronimo.xbeans.j2ee.MimeMappingType;
+import org.apache.geronimo.xbeans.j2ee.ParamValueType;
+import org.apache.geronimo.xbeans.j2ee.RoleNameType;
+import org.apache.geronimo.xbeans.j2ee.SecurityConstraintType;
+import org.apache.geronimo.xbeans.j2ee.SecurityRoleRefType;
+import org.apache.geronimo.xbeans.j2ee.SecurityRoleType;
+import org.apache.geronimo.xbeans.j2ee.ServletMappingType;
+import org.apache.geronimo.xbeans.j2ee.ServletType;
+import org.apache.geronimo.xbeans.j2ee.TaglibType;
+import org.apache.geronimo.xbeans.j2ee.UrlPatternType;
+import org.apache.geronimo.xbeans.j2ee.WebAppDocument;
+import org.apache.geronimo.xbeans.j2ee.WebAppType;
+import org.apache.geronimo.xbeans.j2ee.WebResourceCollectionType;
+import org.apache.geronimo.xbeans.j2ee.WelcomeFileListType;
+import org.apache.catalina.deploy.ErrorPage;
+import org.apache.catalina.deploy.FilterDef;
+import org.apache.catalina.deploy.FilterMap;
+import org.apache.catalina.deploy.LoginConfig;
+import org.apache.xmlbeans.XmlException;
+import org.apache.xmlbeans.XmlObject;
+
+
+/**
+* @version $Rev: 161588 $ $Date: 2005-04-16 12:06:59 -0600 (Sat, 16 Apr 2005) $
+*/
+public class TomcatModuleBuilder implements ModuleBuilder {
+   private final URI defaultParentId;
+   private final ObjectName tomcatContainerObjectName;
+
+   private final Repository repository;
+   private final Kernel kernel;
+
+   public TomcatModuleBuilder(URI defaultParentId,
+                             ObjectName tomcatContainerObjectName,
+                             Repository repository,
+                             Kernel kernel) {
+       this.defaultParentId = defaultParentId;
+       this.tomcatContainerObjectName = tomcatContainerObjectName;
+       this.repository = repository;
+       this.kernel = kernel;
+
+   }
+
+   public Module createModule(File plan, JarFile moduleFile) throws DeploymentException {
+       return createModule(plan, moduleFile, "war", null, true);
+   }
+
+   public Module createModule(Object plan, JarFile moduleFile, String targetPath, URL specDDUrl, URI earConfigId) throws DeploymentException {
+       return createModule(plan, moduleFile, targetPath, specDDUrl, false);
+   }
+
+   private Module createModule(Object plan, JarFile moduleFile, String targetPath, URL specDDUrl, boolean standAlone) throws DeploymentException {
+       assert moduleFile != null: "moduleFile is null";
+       assert targetPath != null: "targetPath is null";
+       assert !targetPath.endsWith("/"): "targetPath must not end with a '/'";
+
+       // parse the spec dd
+       String specDD;
+       WebAppType webApp;
+       try {
+           if (specDDUrl == null) {
+               specDDUrl = DeploymentUtil.createJarURL(moduleFile, "WEB-INF/web.xml");
+           }
+
+           // read in the entire specDD as a string, we need this for getDeploymentDescriptor
+           // on the J2ee management object
+           specDD = DeploymentUtil.readAll(specDDUrl);
+       } catch (Exception e) {
+           //no web.xml, not for us
+           return null;
+       }
+       //we found web.xml, if it won't parse that's an error.
+       try {
+           // parse it
+           XmlObject parsed = SchemaConversionUtils.parse(specDD);
+           WebAppDocument webAppDoc = SchemaConversionUtils.convertToServletSchema(parsed);
+           webApp = webAppDoc.getWebApp();
+       } catch (XmlException xmle) {
+           throw new DeploymentException("Error parsing web.xml", xmle);
+       }
+       check(webApp);
+
+       //look for a webservices dd
+       Map portMap = Collections.EMPTY_MAP;
+       try {
+           URL wsDDUrl = DeploymentUtil.createJarURL(moduleFile, "WEB-INF/webservices.xml");
+           portMap = WSDescriptorParser.parseWebServiceDescriptor(wsDDUrl, moduleFile, false);
+       } catch (MalformedURLException e) {
+           //no descriptor
+       }
+
+       // parse vendor dd
+       TomcatWebAppType tomcatWebApp = getTomcatWebApp(plan, moduleFile, standAlone, targetPath, webApp);
+
+       // get the ids from either the application plan or for a stand alone module from the specific deployer
+       URI configId = null;
+       try {
+           configId = new URI(tomcatWebApp.getConfigId());
+       } catch (URISyntaxException e) {
+           throw new DeploymentException("Invalid configId " + tomcatWebApp.getConfigId(), e);
+       }
+
+       URI parentId = null;
+       if (tomcatWebApp.isSetParentId()) {
+           try {
+               parentId = new URI(tomcatWebApp.getParentId());
+           } catch (URISyntaxException e) {
+               throw new DeploymentException("Invalid parentId " + tomcatWebApp.getParentId(), e);
+           }
+       } else {
+           parentId = defaultParentId;
+       }
+
+       WebModule module = new WebModule(standAlone, configId, parentId, moduleFile, targetPath, webApp, tomcatWebApp, specDD, portMap);
+       module.setContextRoot(tomcatWebApp.getContextRoot());
+       return module;
+   }
+
+   TomcatWebAppType getTomcatWebApp(Object plan, JarFile moduleFile, boolean standAlone, String targetPath, WebAppType webApp) throws DeploymentException {
+       TomcatWebAppType tomcatWebApp = null;
+       try {
+           // load the geronimo-jetty.xml from either the supplied plan or from the earFile
+           try {
+               if (plan instanceof XmlObject) {
+                   tomcatWebApp = (TomcatWebAppType) SchemaConversionUtils.getNestedObjectAsType((XmlObject) plan,
+                           "web-app",
+                           TomcatWebAppType.type);
+               } else {
+                   TomcatWebAppDocument tomcatWebAppdoc = null;
+                   if (plan != null) {
+                       tomcatWebAppdoc = TomcatWebAppDocument.Factory.parse((File) plan);
+                   } else {
+                       URL path = DeploymentUtil.createJarURL(moduleFile, "WEB-INF/geronimo-tomcat.xml");
+                       tomcatWebAppdoc = TomcatWebAppDocument.Factory.parse(path);
+                   }
+                   if (tomcatWebAppdoc != null) {
+                       tomcatWebApp = tomcatWebAppdoc.getWebApp();
+                   }
+               }
+           } catch (IOException e) {
+           }
+
+           // if we got one extract and validate it otherwise create a default one
+           if (tomcatWebApp != null) {
+               tomcatWebApp = (TomcatWebAppType) SchemaConversionUtils.convertToGeronimoNamingSchema(tomcatWebApp);
+               tomcatWebApp = (TomcatWebAppType) SchemaConversionUtils.convertToGeronimoSecuritySchema(tomcatWebApp);
+               tomcatWebApp = (TomcatWebAppType) SchemaConversionUtils.convertToGeronimoServiceSchema(tomcatWebApp);
+               SchemaConversionUtils.validateDD(tomcatWebApp);
+           } else {
+               String path;
+               if (standAlone) {
+                   // default configId is based on the moduleFile name
+                   path = new File(moduleFile.getName()).getName();
+               } else {
+                   // default configId is based on the module uri from the application.xml
+                   path = targetPath;
+               }
+               tomcatWebApp = createDefaultPlan(path, webApp);
+           }
+       } catch (XmlException e) {
+           throw new DeploymentException("xml problem", e);
+       }
+       return tomcatWebApp;
+   }
+
+   private TomcatWebAppType createDefaultPlan(String path, WebAppType webApp) {
+       String id = webApp.getId();
+       if (id == null) {
+           id = path;
+           if (id.endsWith(".war")) {
+               id = id.substring(0, id.length() - 4);
+           }
+           if (id.endsWith("/")) {
+               id = id.substring(0, id.length() - 1);
+           }
+       }
+
+       TomcatWebAppType tomcatWebApp = TomcatWebAppType.Factory.newInstance();
+
+       // set the parentId, configId and context root
+       tomcatWebApp.setParentId(defaultParentId.toString());
+       if (null != webApp.getId()) {
+           id = webApp.getId();
+       }
+       tomcatWebApp.setConfigId(id);
+       tomcatWebApp.setContextRoot(id);
+       return tomcatWebApp;
+   }
+
+   public void installModule(JarFile earFile, EARContext earContext, Module module) throws DeploymentException {
+       try {
+           URI baseDir = URI.create(module.getTargetPath() + "/");
+
+           // add the warfile's content to the configuration
+           JarFile warFile = module.getModuleFile();
+           Enumeration entries = warFile.entries();
+           while (entries.hasMoreElements()) {
+               ZipEntry entry = (ZipEntry) entries.nextElement();
+               URI targetPath = baseDir.resolve(new URI(null, entry.getName(), null));
+               if (entry.getName().equals("WEB-INF/web.xml")) {
+                   earContext.addFile(targetPath, module.getOriginalSpecDD());
+               } else {
+                   earContext.addFile(targetPath, warFile, entry);
+               }
+           }
+
+           // add the manifest classpath entries declared in the war to the class loader
+           // we have to explicitly add these since we are unpacking the web module
+           // and the url class loader will not pick up a manifiest from an unpacked dir
+           earContext.addManifestClassPath(warFile, URI.create(module.getTargetPath()));
+
+           // add the dependencies declared in the geronimo-jetty.xml file
+           TomcatWebAppType tomcatWebApp = (TomcatWebAppType) module.getVendorDD();
+           DependencyType[] dependencies = tomcatWebApp.getDependencyArray();
+           ServiceConfigBuilder.addDependencies(earContext, dependencies, repository);
+       } catch (IOException e) {
+           throw new DeploymentException("Problem deploying war", e);
+       } catch (URISyntaxException e) {
+           throw new DeploymentException("Could not construct URI for location of war entry", e);
+       }
+   }
+
+   public void initContext(EARContext earContext, Module module, ClassLoader cl) {
+       // web application do not add anything to the shared context
+   }
+
+   public String addGBeans(EARContext earContext, Module module, ClassLoader cl) throws DeploymentException {
+       J2eeContext earJ2eeContext = earContext.getJ2eeContext();
+       J2eeContext moduleJ2eeContext = J2eeContextImpl.newModuleContextFromApplication(earJ2eeContext, NameFactory.WEB_MODULE, module.getName());
+       WebModule webModule = (WebModule) module;
+
+       WebAppType webApp = (WebAppType) webModule.getSpecDD();
+       TomcatWebAppType tomcatWebApp = (TomcatWebAppType) webModule.getVendorDD();
+
+       boolean contextPriorityClassLoader = false;
+       if (tomcatWebApp != null) {
+           contextPriorityClassLoader = Boolean.valueOf(tomcatWebApp.getContextPriorityClassloader()).booleanValue();
+       }
+       // construct the webClassLoader
+       ClassLoader webClassLoader = getWebClassLoader(earContext, webModule, cl, contextPriorityClassLoader);
+
+       if (tomcatWebApp != null) {
+           GbeanType[] gbeans = tomcatWebApp.getGbeanArray();
+           ServiceConfigBuilder.addGBeans(gbeans, webClassLoader, moduleJ2eeContext, earContext);
+       }
+
+       ObjectName webModuleName = null;
+       try {
+           webModuleName = NameFactory.getModuleName(null, null, null, null, null, moduleJ2eeContext);
+       } catch (MalformedObjectNameException e) {
+           throw new DeploymentException("Could not construct module name", e);
+       }
+
+       UserTransaction userTransaction = new OnlineUserTransaction();
+       //this may add to the web classpath with enhanced classes.
+       Map compContext = buildComponentContext(earContext, webModule, webApp, tomcatWebApp, userTransaction, webClassLoader);
+
+       GBeanData webModuleData = new GBeanData(webModuleName, TomcatWebAppContext.GBEAN_INFO);
+       try {
+           webModuleData.setReferencePattern("J2EEServer", earContext.getServerObjectName());
+           if (!earContext.getJ2EEApplicationName().equals("null")) {
+               webModuleData.setReferencePattern("J2EEApplication", earContext.getApplicationObjectName());
+           }
+
+           webModuleData.setAttribute("deploymentDescriptor", module.getOriginalSpecDD());
+           Set securityRoles = collectRoleNames(webApp);
+           Map rolePermissions = new HashMap();
+
+           URI baseUri = earContext.getTargetFile(URI.create(webModule.getTargetPath() + "/")).toURI();
+           webModuleData.setAttribute("webAppRoot", baseUri);
+           webModuleData.setAttribute("path", webModule.getContextRoot());
+
+           webModuleData.setAttribute("componentContext", compContext);
+           webModuleData.setAttribute("userTransaction", userTransaction);
+           //classpath may have been augmented with enhanced classes
+           webModuleData.setAttribute("webClassPath", webModule.getWebClasspath());
+           // unsharableResources, applicationManagedSecurityResources
+           GBeanResourceEnvironmentBuilder rebuilder = new GBeanResourceEnvironmentBuilder(webModuleData);
+           ENCConfigBuilder.setResourceEnvironment(earContext, webModule.getModuleURI(), rebuilder, webApp.getResourceRefArray(), tomcatWebApp.getResourceRefArray());
+
+           webModuleData.setAttribute("contextPriorityClassLoader", Boolean.valueOf(contextPriorityClassLoader));
+
+           webModuleData.setReferencePattern("transactionContextManager", earContext.getTransactionContextManagerObjectName());
+           webModuleData.setReferencePattern("trackedConnectionAssociator", earContext.getConnectionTrackerObjectName());
+           webModuleData.setReferencePattern("Container", tomcatContainerObjectName);
+
+           if (tomcatWebApp.isSetSecurityRealmName()) {
+               
+               SecurityHolder securityHolder = new SecurityHolder();
+               String securityRealmName = tomcatWebApp.getSecurityRealmName().trim();
+
+               /**
+                * TODO - go back to commented version when possible.
+                */
+               String policyContextID = webModuleName.getCanonicalName().replaceAll("[, :]", "_");
+               securityHolder.setPolicyContextID(policyContextID);
+
+               ComponentPermissions componentPermissions = buildSpecSecurityConfig(webApp, securityRoles, rolePermissions);
+               securityHolder.setExcluded(componentPermissions.getExcludedPermissions());
+               PermissionCollection checkedPermissions = new Permissions();
+               for (Iterator iterator = rolePermissions.values().iterator(); iterator.hasNext();) {
+                   PermissionCollection permissionsForRole = (PermissionCollection) iterator.next();
+                   for (Enumeration iterator2 = permissionsForRole.elements(); iterator2.hasMoreElements();) {
+                       Permission permission = (Permission) iterator2.nextElement();
+                       checkedPermissions.add(permission);
+                   }
+               }
+               securityHolder.setChecked(checkedPermissions);
+
+               earContext.addSecurityContext(policyContextID, componentPermissions);
+               if (tomcatWebApp.isSetSecurity()) {
+                   SecurityConfiguration securityConfiguration = SecurityBuilder.buildSecurityConfiguration(tomcatWebApp.getSecurity());
+                   earContext.setSecurityConfiguration(securityConfiguration);
+               }
+               DefaultPrincipal defaultPrincipal = earContext.getSecurityConfiguration().getDefaultPrincipal();
+               securityHolder.setDefaultPrincipal(defaultPrincipal);
+
+               webModuleData.setAttribute("securityHolder", securityHolder);              
+               webModuleData.setReferencePattern("RoleDesignateSource", earContext.getJaccManagerName());
+           }
+           
+           String virtualServer = tomcatWebApp.getVirtualServer();
+           if (virtualServer != null){
+               webModuleData.setAttribute("virtualServer", virtualServer);              
+           }
+           earContext.addGBean(webModuleData);
+
+       } catch (DeploymentException de) {
+           throw de;
+       } catch (Exception e) {
+           throw new DeploymentException("Unable to initialize webapp GBean", e);
+       }
+       return null;
+   }
+
+   private ClassLoader getWebClassLoader(EARContext earContext, WebModule webModule, ClassLoader cl, boolean contextPriorityClassLoader) throws DeploymentException {
+       getWebClassPath(earContext, webModule);
+       URI[] webClassPath = webModule.getWebClasspath();
+       URI baseUri = earContext.getBaseDir().toURI();
+       URL baseUrl = null;
+       try {
+           baseUrl = baseUri.resolve(webModule.getTargetPathURI()).toURL();
+       } catch (MalformedURLException e) {
+           throw new DeploymentException("Invalid module location: " + webModule.getTargetPathURI() + ", baseUri: " + baseUri);
+       }
+       URL[] webClassPathURLs = new URL[webClassPath.length];
+       for (int i = 0; i < webClassPath.length; i++) {
+           URI path = baseUri.resolve(webClassPath[i]);
+           try {
+               webClassPathURLs[i] = path.toURL();
+           } catch (MalformedURLException e) {
+               throw new DeploymentException("Invalid web class path element: path=" + path + ", baseUri=" + baseUri);
+           }
+       }
+
+       ClassLoader webClassLoader = new TomcatClassLoader(webClassPathURLs, baseUrl, cl, contextPriorityClassLoader);
+       return webClassLoader;
+   }
+/*
+   private StandardWrapper createServlet(ServletType servletType,
+                               Map servletMappings,
+                               Set securityRoles,
+                               Map rolePermissions) throws MalformedObjectNameException, DeploymentException {
+       String servletName = servletType.getServletName().getStringValue().trim();
+ //      GBeanData servletData;
+       StandardWrapper servletData = new StandardWrapper();
+       if (servletType.isSetServletClass()) {
+           String servletClassName = servletType.getServletClass().getStringValue().trim();
+           servletData.setServletClass(servletClassName);
+       } else if (servletType.isSetJspFile()) {
+           servletData.setJspFile(servletType.getJspFile().getStringValue().trim());
+           //TODO MAKE THIS CONFIGURABLE!!! Tomcat uses the servlet mapping set up from the default-web.xml
+           servletData.setServletClass("org.apache.jasper.servlet.JspServlet");
+       } else {
+           throw new DeploymentException("Neither servlet class nor jsp file is set for " + servletName);
+       }
+       //TODO in init param setter, add classpath if jspFile is not null.
+       servletData.setServletName(servletName);
+       ParamValueType[] initParamArray = servletType.getInitParamArray();
+       for (int j = 0; j < initParamArray.length; j++) {
+           ParamValueType paramValueType = initParamArray[j];
+           servletData.addInitParameter(paramValueType.getParamName().getStringValue().trim(), paramValueType.getParamValue().getStringValue().trim());
+       }
+
+       if (servletType.isSetLoadOnStartup()) {
+           Integer loadOnStartup = new Integer(servletType.getLoadOnStartup().getBigIntegerValue().intValue());
+           servletData.setLoadOnStartup(loadOnStartup.intValue());
+       }
+
+       Set mappings = (Set) servletMappings.get(servletName);
+       if (mappings != null){
+           Iterator iterator = mappings.iterator();
+           while(iterator.hasNext()){
+               servletData.addMapping((String)iterator.next());
+           }
+       }
+
+       //WebRoleRefPermissions
+       SecurityRoleRefType[] securityRoleRefTypeArray = servletType.getSecurityRoleRefArray();
+       Set unmappedRoles = new HashSet(securityRoles);
+       for (int j = 0; j < securityRoleRefTypeArray.length; j++) {
+           SecurityRoleRefType securityRoleRefType = securityRoleRefTypeArray[j];
+           String roleName = securityRoleRefType.getRoleName().getStringValue().trim();
+           String roleLink = securityRoleRefType.getRoleLink().getStringValue().trim();
+
+           servletData.addSecurityReference(roleName, roleLink);
+
+           //jacc 3.1.3.2
+           addPermissionToRole(roleLink, new WebRoleRefPermission(servletName, roleName), rolePermissions);
+           unmappedRoles.remove(roleName);
+       }
+       for (Iterator iterator = unmappedRoles.iterator(); iterator.hasNext();) {
+           String roleName = (String) iterator.next();
+           addPermissionToRole(roleName, new WebRoleRefPermission(servletName, roleName), rolePermissions);
+       }
+//       servletData.setAttribute("webRoleRefPermissions", webRoleRefPermissions);
+
+       return servletData;
+   }
+**/
+   private ComponentPermissions buildSpecSecurityConfig(WebAppType webApp, Set securityRoles, Map rolePermissions) {
+       Map uncheckedPatterns = new HashMap();
+       Map uncheckedResourcePatterns = new HashMap();
+       Map uncheckedUserPatterns = new HashMap();
+       Map excludedPatterns = new HashMap();
+       Map rolesPatterns = new HashMap();
+       Set allSet = new HashSet();   // == allMap.values()
+       Map allMap = new HashMap();   //uncheckedPatterns union excludedPatterns union rolesPatterns.
+
+       SecurityConstraintType[] securityConstraintArray = webApp.getSecurityConstraintArray();
+       for (int i = 0; i < securityConstraintArray.length; i++) {
+           SecurityConstraintType securityConstraintType = securityConstraintArray[i];
+           Map currentPatterns;
+           if (securityConstraintType.isSetAuthConstraint()) {
+               if (securityConstraintType.getAuthConstraint().getRoleNameArray().length == 0) {
+                   currentPatterns = excludedPatterns;
+               } else {
+                   currentPatterns = rolesPatterns;
+               }
+           } else {
+               currentPatterns = uncheckedPatterns;
+           }
+
+           String transport = "";
+           if (securityConstraintType.isSetUserDataConstraint()) {
+               transport = securityConstraintType.getUserDataConstraint().getTransportGuarantee().getStringValue().trim().toUpperCase();
+           }
+
+           WebResourceCollectionType[] webResourceCollectionTypeArray = securityConstraintType.getWebResourceCollectionArray();
+           for (int j = 0; j < webResourceCollectionTypeArray.length; j++) {
+               WebResourceCollectionType webResourceCollectionType = webResourceCollectionTypeArray[j];
+               UrlPatternType[] urlPatternTypeArray = webResourceCollectionType.getUrlPatternArray();
+               for (int k = 0; k < urlPatternTypeArray.length; k++) {
+                   UrlPatternType urlPatternType = urlPatternTypeArray[k];
+                   //presumably, don't trim
+                   String url = urlPatternType.getStringValue();
+                   URLPattern pattern = (URLPattern) currentPatterns.get(url);
+                   if (pattern == null) {
+                       pattern = new URLPattern(url);
+                       currentPatterns.put(url, pattern);
+                   }
+
+                   URLPattern allPattern = (URLPattern) allMap.get(url);
+                   if (allPattern == null) {
+                       allPattern = new URLPattern(url);
+                       allSet.add(allPattern);
+                       allMap.put(url, allPattern);
+                   }
+
+                   HttpMethodType[] httpMethodTypeArray = webResourceCollectionType.getHttpMethodArray();
+                   if (httpMethodTypeArray.length == 0) {
+                       pattern.addMethod("");
+                       allPattern.addMethod("");
+                   } else {
+                       for (int l = 0; l < httpMethodTypeArray.length; l++) {
+                           HttpMethodType httpMethodType = httpMethodTypeArray[l];
+                           //TODO is trim OK?
+                           String method = httpMethodType.getStringValue().trim();
+                           pattern.addMethod(method);
+                           allPattern.addMethod(method);
+                       }
+                   }
+                   if (currentPatterns == rolesPatterns) {
+                       RoleNameType[] roleNameTypeArray = securityConstraintType.getAuthConstraint().getRoleNameArray();
+                       for (int l = 0; l < roleNameTypeArray.length; l++) {
+                           RoleNameType roleNameType = roleNameTypeArray[l];
+                           String role = roleNameType.getStringValue().trim();
+                           if (role.equals("*")) {
+                               pattern.addAllRoles(securityRoles);
+                           } else {
+                               pattern.addRole(role);
+                           }
+                       }
+                   }
+
+                   pattern.setTransport(transport);
+               }
+           }
+       }
+
+       PermissionCollection excludedPermissions = new Permissions();
+       PermissionCollection uncheckedPermissions = new Permissions();
+
+       Iterator iter = excludedPatterns.keySet().iterator();
+       while (iter.hasNext()) {
+           URLPattern pattern = (URLPattern) excludedPatterns.get(iter.next());
+           String name = pattern.getQualifiedPattern(allSet);
+           String actions = pattern.getMethods();
+
+           excludedPermissions.add(new WebResourcePermission(name, actions));
+           excludedPermissions.add(new WebUserDataPermission(name, actions));
+       }
+
+       iter = rolesPatterns.keySet().iterator();
+       while (iter.hasNext()) {
+           URLPattern pattern = (URLPattern) rolesPatterns.get(iter.next());
+           String name = pattern.getQualifiedPattern(allSet);
+           String actions = pattern.getMethods();
+           WebResourcePermission permission = new WebResourcePermission(name, actions);
+
+           for (Iterator names = pattern.getRoles().iterator(); names.hasNext();) {
+               String roleName = (String) names.next();
+               addPermissionToRole(roleName, permission, rolePermissions);
+           }
+       }
+
+       iter = uncheckedPatterns.keySet().iterator();
+       while (iter.hasNext()) {
+           URLPattern pattern = (URLPattern) uncheckedPatterns.get(iter.next());
+           String name = pattern.getQualifiedPattern(allSet);
+           String actions = pattern.getMethods();
+
+           addOrUpdatePattern(uncheckedResourcePatterns, name, actions);
+       }
+
+       iter = rolesPatterns.keySet().iterator();
+       while (iter.hasNext()) {
+           URLPattern pattern = (URLPattern) rolesPatterns.get(iter.next());
+           String name = pattern.getQualifiedPattern(allSet);
+           String actions = pattern.getMethodsWithTransport();
+
+           addOrUpdatePattern(uncheckedUserPatterns, name, actions);
+       }
+
+       iter = uncheckedPatterns.keySet().iterator();
+       while (iter.hasNext()) {
+           URLPattern pattern = (URLPattern) uncheckedPatterns.get(iter.next());
+           String name = pattern.getQualifiedPattern(allSet);
+           String actions = pattern.getMethodsWithTransport();
+
+           addOrUpdatePattern(uncheckedUserPatterns, name, actions);
+       }
+
+       /**
+        * A <code>WebResourcePermission</code> and a <code>WebUserDataPermission</code> must be instantiated for
+        * each <tt>url-pattern</tt> in the deployment descriptor and the default pattern "/", that is not combined
+        * by the <tt>web-resource-collection</tt> elements of the deployment descriptor with ever HTTP method
+        * value.  The permission objects must be contructed using the qualified pattern as their name and with
+        * actions defined by the subset of the HTTP methods that do not occur in combination with the pattern.
+        * The resulting permissions that must be added to the unchecked policy statements by calling the
+        * <code>addToUncheckedPolcy</code> method on the <code>PolicyConfiguration</code> object.
+        */
+       iter = allSet.iterator();
+       while (iter.hasNext()) {
+           URLPattern pattern = (URLPattern) iter.next();
+           String name = pattern.getQualifiedPattern(allSet);
+           String actions = pattern.getComplementedMethods();
+
+           if (actions.length() == 0) {
+               continue;
+           }
+
+           addOrUpdatePattern(uncheckedResourcePatterns, name, actions);
+           addOrUpdatePattern(uncheckedUserPatterns, name, actions);
+       }
+
+       URLPattern pattern = new URLPattern("/");
+       if (!allSet.contains(pattern)) {
+           String name = pattern.getQualifiedPattern(allSet);
+           String actions = pattern.getComplementedMethods();
+
+           addOrUpdatePattern(uncheckedResourcePatterns, name, actions);
+           addOrUpdatePattern(uncheckedUserPatterns, name, actions);
+       }
+
+       //Create the uncheckedPermissions for WebResourcePermissions
+       iter = uncheckedResourcePatterns.keySet().iterator();
+       while (iter.hasNext()) {
+           UncheckedItem item = (UncheckedItem) iter.next();
+           String actions = (String) uncheckedResourcePatterns.get(item);
+
+           uncheckedPermissions.add(new WebResourcePermission(item.getName(), actions));
+       }
+       //Create the uncheckedPermissions for WebUserDataPermissions
+       iter = uncheckedUserPatterns.keySet().iterator();
+       while (iter.hasNext()) {
+           UncheckedItem item = (UncheckedItem) iter.next();
+           String actions = (String) uncheckedUserPatterns.get(item);
+
+           uncheckedPermissions.add(new WebUserDataPermission(item.getName(), actions));
+       }
+
+       ComponentPermissions componentPermissions = new ComponentPermissions(excludedPermissions, uncheckedPermissions, rolePermissions);
+       return componentPermissions;
+
+   }
+
+   private void addPermissionToRole(String roleName, Permission permission, Map rolePermissions) {
+       PermissionCollection permissionsForRole = (PermissionCollection) rolePermissions.get(roleName);
+       if (permissionsForRole == null) {
+           permissionsForRole = new Permissions();
+           rolePermissions.put(roleName, permissionsForRole);
+       }
+       permissionsForRole.add(permission);
+   }
+
+   private void addOrUpdatePattern(Map patternMap, String name, String actions) {
+       UncheckedItem item = new UncheckedItem(name, actions);
+       String existingActions = (String) patternMap.get(item);
+       if (existingActions != null) {
+           patternMap.put(item, actions + "," + existingActions);
+           return;
+       }
+
+       patternMap.put(item, actions);
+   }
+
+   private static Set collectRoleNames(WebAppType webApp) {
+       Set roleNames = new HashSet();
+
+       SecurityRoleType[] securityRoles = webApp.getSecurityRoleArray();
+       for (int i = 0; i < securityRoles.length; i++) {
+           roleNames.add(securityRoles[i].getRoleName().getStringValue().trim());
+       }
+
+       return roleNames;
+   }
+
+   private static void getWebClassPath(EARContext earContext, WebModule webModule) {
+       File baseDir = earContext.getTargetFile(webModule.getTargetPathURI());
+       File webInfDir = new File(baseDir, "WEB-INF");
+
+       // check for a classes dir
+       File classesDir = new File(webInfDir, "classes");
+       if (classesDir.isDirectory()) {
+           webModule.addToWebClasspath(webModule.getTargetPathURI().resolve(URI.create("WEB-INF/classes/")));
+       }
+
+       // add all of the libs
+       File libDir = new File(webInfDir, "lib");
+       if (libDir.isDirectory()) {
+           File[] libs = libDir.listFiles(new FileFilter() {
+               public boolean accept(File file) {
+                   return file.isFile() && file.getName().endsWith(".jar");
+               }
+           });
+
+           if (libs != null) {
+               for (int i = 0; i < libs.length; i++) {
+                   File lib = libs[i];
+                   webModule.addToWebClasspath(webModule.getTargetPathURI().resolve(URI.create("WEB-INF/lib/" + lib.getName())));
+               }
+           }
+       }
+   }
+
+   private Map buildComponentContext(EARContext earContext, Module webModule, WebAppType webApp, TomcatWebAppType tomcatWebApp, UserTransaction userTransaction, ClassLoader cl) throws DeploymentException {
+       return ENCConfigBuilder.buildComponentContext(earContext,
+               webModule,
+               userTransaction,
+               webApp.getEnvEntryArray(),
+               webApp.getEjbRefArray(), tomcatWebApp.getEjbRefArray(),
+               webApp.getEjbLocalRefArray(), tomcatWebApp.getEjbLocalRefArray(),
+               webApp.getResourceRefArray(), tomcatWebApp.getResourceRefArray(),
+               webApp.getResourceEnvRefArray(), tomcatWebApp.getResourceEnvRefArray(),
+               webApp.getMessageDestinationRefArray(),
+               webApp.getServiceRefArray(), tomcatWebApp.getServiceRefArray(),
+               cl);
+   }
+
+   private static void check(WebAppType webApp) throws DeploymentException {
+       checkURLPattern(webApp);
+       checkMultiplicities(webApp);
+   }
+
+   private static void checkURLPattern(WebAppType webApp) throws DeploymentException {
+
+       FilterMappingType[] filterMappings = webApp.getFilterMappingArray();
+       for (int i = 0; i < filterMappings.length; i++) {
+           if (filterMappings[i].isSetUrlPattern()) {
+               checkString(filterMappings[i].getUrlPattern().getStringValue());
+           }
+       }
+
+       ServletMappingType[] servletMappings = webApp.getServletMappingArray();
+       for (int i = 0; i < servletMappings.length; i++) {
+           checkString(servletMappings[i].getUrlPattern().getStringValue());
+       }
+
+       SecurityConstraintType[] constraints = webApp.getSecurityConstraintArray();
+       for (int i = 0; i < constraints.length; i++) {
+           WebResourceCollectionType[] collections = constraints[i].getWebResourceCollectionArray();
+           for (int j = 0; j < collections.length; j++) {
+               UrlPatternType[] patterns = collections[j].getUrlPatternArray();
+               for (int k = 0; k < patterns.length; k++) {
+                   checkString(patterns[k].getStringValue());
+               }
+           }
+       }
+   }
+
+   private static void checkString(String pattern) throws DeploymentException {
+       //j2ee_1_4.xsd explicitly requires preserving all whitespace. Do not trim.
+       if (pattern.indexOf(0x0D) >= 0) throw new DeploymentException("<url-pattern> must not contain CR(#xD)");
+       if (pattern.indexOf(0x0A) >= 0) throw new DeploymentException("<url-pattern> must not contain LF(#xA)");
+   }
+
+   private static void checkMultiplicities(WebAppType webApp) throws DeploymentException {
+       if (webApp.getSessionConfigArray().length > 1) throw new DeploymentException("Multiple <session-config> elements found");
+       if (webApp.getJspConfigArray().length > 1) throw new DeploymentException("Multiple <jsp-config> elements found");
+       if (webApp.getLoginConfigArray().length > 1) throw new DeploymentException("Multiple <login-config> elements found");
+   }
+
+   class UncheckedItem {
+       final static int NA = 0x00;
+       final static int INTEGRAL = 0x01;
+       final static int CONFIDENTIAL = 0x02;
+
+       private int transportType = NA;
+       private String name;
+
+       public UncheckedItem(String name, String actions) {
+           setName(name);
+           setTransportType(actions);
+       }
+
+       public boolean equals(Object o) {
+           UncheckedItem item = (UncheckedItem) o;
+           return item.getKey().equals(this.getKey());
+       }
+
+       public String getKey() {
+           return (name + transportType);
+       }
+
+       public int hashCode() {
+           return getKey().hashCode();
+       }
+
+       public String getName() {
+           return name;
+       }
+
+       public void setName(String name) {
+           this.name = name;
+       }
+
+       public int getTransportType() {
+           return transportType;
+       }
+
+       public void setTransportType(String actions) {
+           String[] tokens = actions.split(":", 2);
+           if (tokens.length == 2) {
+               if (tokens[1].equals("INTEGRAL")) {
+                   this.transportType = INTEGRAL;
+               } else if (tokens[1].equals("CONFIDENTIAL")) {
+                   this.transportType = CONFIDENTIAL;
+               }
+           }
+       }
+   }
+
+   public static final GBeanInfo GBEAN_INFO;
+
+   static {
+       GBeanInfoBuilder infoBuilder = new GBeanInfoBuilder(TomcatModuleBuilder.class, NameFactory.MODULE_BUILDER);
+       infoBuilder.addAttribute("defaultParentId", URI.class, true);
+       infoBuilder.addAttribute("tomcatContainerObjectName", ObjectName.class, true);
+       infoBuilder.addReference("Repository", Repository.class, NameFactory.GERONIMO_SERVICE);
+       infoBuilder.addAttribute("kernel", Kernel.class, false);
+       infoBuilder.addInterface(ModuleBuilder.class);
+
+       infoBuilder.setConstructor(new String[]{
+           "defaultParentId",
+           "tomcatContainerObjectName",
+           "Repository",
+           "kernel"});
+       GBEAN_INFO = infoBuilder.getBeanInfo();
+   }
+
+   public static GBeanInfo getGBeanInfo() {
+       return GBEAN_INFO;
+   }
+
+}

Added: geronimo/trunk/modules/tomcat-builder/src/java/org/apache/geronimo/tomcat/deployment/WARConfiguration.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/tomcat-builder/src/java/org/apache/geronimo/tomcat/deployment/WARConfiguration.java?rev=164651&view=auto
==============================================================================
--- geronimo/trunk/modules/tomcat-builder/src/java/org/apache/geronimo/tomcat/deployment/WARConfiguration.java (added)
+++ geronimo/trunk/modules/tomcat-builder/src/java/org/apache/geronimo/tomcat/deployment/WARConfiguration.java Mon Apr 25 14:09:26 2005
@@ -0,0 +1,31 @@
+/**
+ *
+ * Copyright 2003-2004 The Apache Software Foundation
+ *
+ *  Licensed 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.tomcat.deployment;
+
+import javax.enterprise.deploy.model.DeployableObject;
+
+import org.apache.geronimo.deployment.plugin.DeploymentConfigurationSupport;
+
+/**
+ * @version $Rev: 56771 $ $Date: 2004-11-06 12:58:54 -0700 (Sat, 06 Nov 2004) $
+ */
+public class WARConfiguration extends DeploymentConfigurationSupport {
+    public WARConfiguration(DeployableObject deployable) {
+        super(deployable, new WebAppDConfigRoot(deployable.getDDBeanRoot()));
+    }
+}

Added: geronimo/trunk/modules/tomcat-builder/src/java/org/apache/geronimo/tomcat/deployment/WARConfigurer.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/tomcat-builder/src/java/org/apache/geronimo/tomcat/deployment/WARConfigurer.java?rev=164651&view=auto
==============================================================================
--- geronimo/trunk/modules/tomcat-builder/src/java/org/apache/geronimo/tomcat/deployment/WARConfigurer.java (added)
+++ geronimo/trunk/modules/tomcat-builder/src/java/org/apache/geronimo/tomcat/deployment/WARConfigurer.java Mon Apr 25 14:09:26 2005
@@ -0,0 +1,52 @@
+/**
+ *
+ * Copyright 2003-2004 The Apache Software Foundation
+ *
+ *  Licensed 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.tomcat.deployment;
+
+import javax.enterprise.deploy.model.DeployableObject;
+import javax.enterprise.deploy.shared.ModuleType;
+import javax.enterprise.deploy.spi.DeploymentConfiguration;
+
+import org.apache.geronimo.deployment.ModuleConfigurer;
+import org.apache.geronimo.gbean.GBeanInfo;
+import org.apache.geronimo.gbean.GBeanInfoBuilder;
+import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
+
+/**
+ * @version $Rev: 126313 $ $Date: 2005-01-24 14:03:52 -0700 (Mon, 24 Jan 2005) $
+ */
+public class WARConfigurer implements ModuleConfigurer {
+    public DeploymentConfiguration createConfiguration(DeployableObject deployable) {
+        if (ModuleType.WAR.equals(deployable.getType())) {
+            return new WARConfiguration(deployable);
+        } else {
+            return null;
+        }
+    }
+
+    public static final GBeanInfo GBEAN_INFO;
+
+    static {
+        GBeanInfoBuilder infoFactory = new GBeanInfoBuilder(WARConfigurer.class, NameFactory.DEPLOYMENT_CONFIGURER);
+        infoFactory.addInterface(ModuleConfigurer.class);
+        GBEAN_INFO = infoFactory.getBeanInfo();
+    }
+
+    public static GBeanInfo getGBeanInfo() {
+        return GBEAN_INFO;
+    }
+}



Mime
View raw message