geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sppa...@apache.org
Subject svn commit: r449697 [3/4] - in /geronimo/server/branches/sachin: ./ applications/console/geronimo-console-standard/src/main/java/org/apache/geronimo/console/configmanager/ applications/console/geronimo-console-standard/src/main/webapp/WEB-INF/view/conf...
Date Mon, 25 Sep 2006 14:58:44 GMT
Modified: geronimo/server/branches/sachin/modules/geronimo-j2ee-schema/src/main/java/org/apache/geronimo/schema/SchemaConversionUtils.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/sachin/modules/geronimo-j2ee-schema/src/main/java/org/apache/geronimo/schema/SchemaConversionUtils.java?view=diff&rev=449697&r1=449696&r2=449697
==============================================================================
--- geronimo/server/branches/sachin/modules/geronimo-j2ee-schema/src/main/java/org/apache/geronimo/schema/SchemaConversionUtils.java (original)
+++ geronimo/server/branches/sachin/modules/geronimo-j2ee-schema/src/main/java/org/apache/geronimo/schema/SchemaConversionUtils.java Mon Sep 25 07:58:35 2006
@@ -38,14 +38,14 @@
  * @version $Rev$ $Date$
  */
 public class SchemaConversionUtils {
-    static final String J2EE_NAMESPACE = "http://java.sun.com/xml/ns/j2ee";
+    public static final String J2EE_NAMESPACE = "http://java.sun.com/xml/ns/j2ee";
+    public static final String JAVAEE_NAMESPACE = "http://java.sun.com/xml/ns/javaee";
 
     static final String GERONIMO_NAMING_NAMESPACE = "http://geronimo.apache.org/xml/ns/naming-1.2";
     private static final String GERONIMO_SECURITY_NAMESPACE = "http://geronimo.apache.org/xml/ns/security-1.2";
     private static final String GERONIMO_SERVICE_NAMESPACE = "http://geronimo.apache.org/xml/ns/deployment-1.2";
 
     private static final QName RESOURCE_ADAPTER_VERSION = new QName(J2EE_NAMESPACE, "resourceadapter-version");
-    private static final QName TAGLIB = new QName(J2EE_NAMESPACE, "taglib");
     private static final QName CMP_VERSION = new QName(J2EE_NAMESPACE, "cmp-version");
 
     private static final Map GERONIMO_SCHEMA_CONVERSIONS = new HashMap();
@@ -80,35 +80,6 @@
         GERONIMO_SCHEMA_CONVERSIONS.putAll(conversions);
     }
 
-    public static ApplicationDocument convertToApplicationSchema(XmlObject xmlObject) throws XmlException {
-        if (ApplicationDocument.type.equals(xmlObject.schemaType())) {
-            XmlBeansUtil.validateDD(xmlObject);
-            return (ApplicationDocument) xmlObject;
-        }
-        XmlCursor cursor = xmlObject.newCursor();
-        XmlCursor moveable = xmlObject.newCursor();
-        String schemaLocationURL = "http://java.sun.com/xml/ns/j2ee/application_1_4.xsd";
-        String version = "1.4";
-        try {
-            convertToSchema(cursor, J2EE_NAMESPACE, schemaLocationURL, version);
-            cursor.toStartDoc();
-            cursor.toChild(J2EE_NAMESPACE, "application");
-            cursor.toFirstChild();
-            convertToDescriptionGroup(cursor, moveable);
-        } finally {
-            cursor.dispose();
-            moveable.dispose();
-        }
-        XmlObject result = xmlObject.changeType(ApplicationDocument.type);
-        if (result != null) {
-            XmlBeansUtil.validateDD(result);
-            return (ApplicationDocument) result;
-        }
-        XmlBeansUtil.validateDD(xmlObject);
-        return (ApplicationDocument) xmlObject;
-
-    }
-
     public static ApplicationClientDocument convertToApplicationClientSchema(XmlObject xmlObject) throws XmlException {
         if (ApplicationClientDocument.type.equals(xmlObject.schemaType())) {
             XmlBeansUtil.validateDD(xmlObject);
@@ -123,7 +94,7 @@
             cursor.toStartDoc();
             cursor.toChild(J2EE_NAMESPACE, "application-client");
             cursor.toFirstChild();
-            convertToDescriptionGroup(cursor, moveable);
+            convertToDescriptionGroup(J2EE_NAMESPACE, cursor, moveable);
         } finally {
             cursor.dispose();
             moveable.dispose();
@@ -156,7 +127,7 @@
                     cursor.toStartDoc();
                     cursor.toChild(J2EE_NAMESPACE, "connector");
                     cursor.toFirstChild();
-                    convertToDescriptionGroup(cursor, moveable);
+                    convertToDescriptionGroup(J2EE_NAMESPACE, cursor, moveable);
                     cursor.toNextSibling(J2EE_NAMESPACE, "spec-version");
                     cursor.removeXml();
                     cursor.toNextSibling(J2EE_NAMESPACE, "version");
@@ -254,78 +225,6 @@
         return (EjbJarDocument) xmlObject;
     }
 
-    public static WebAppDocument convertToServletSchema(XmlObject xmlObject) throws XmlException {
-        if (WebAppDocument.type.equals(xmlObject.schemaType())) {
-            XmlBeansUtil.validateDD(xmlObject);
-            return (WebAppDocument) xmlObject;
-        }
-        XmlCursor cursor = xmlObject.newCursor();
-        try {
-            cursor.toStartDoc();
-            cursor.toFirstChild();
-            if ("http://java.sun.com/xml/ns/j2ee".equals(cursor.getName().getNamespaceURI())) {
-                XmlObject result = xmlObject.changeType(WebAppDocument.type);
-                XmlBeansUtil.validateDD(result);
-                return (WebAppDocument) result;
-            }
-
-            XmlDocumentProperties xmlDocumentProperties = cursor.documentProperties();
-            String publicId = xmlDocumentProperties.getDoctypePublicId();
-            if ("-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN".equals(publicId) ||
-                    "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN".equals(publicId)) {
-                XmlCursor moveable = xmlObject.newCursor();
-                try {
-                    moveable.toStartDoc();
-                    moveable.toFirstChild();
-                    String schemaLocationURL = "http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd";
-                    String version = "2.4";
-                    convertToSchema(cursor, J2EE_NAMESPACE, schemaLocationURL, version);
-                    cursor.toStartDoc();
-                    cursor.toChild(J2EE_NAMESPACE, "web-app");
-                    cursor.toFirstChild();
-                    convertToDescriptionGroup(cursor, moveable);
-                    convertToJNDIEnvironmentRefsGroup(cursor, moveable);
-                    cursor.push();
-                    if (cursor.toNextSibling(TAGLIB)) {
-                        cursor.toPrevSibling();
-                        moveable.toCursor(cursor);
-                        cursor.beginElement("jsp-config", J2EE_NAMESPACE);
-                        while (moveable.toNextSibling(TAGLIB)) {
-                            moveable.moveXml(cursor);
-                        }
-                    }
-                    cursor.pop();
-                    do {
-                        String name = cursor.getName().getLocalPart();
-                        if ("filter".equals(name) || "servlet".equals(name) || "context-param".equals(name)) {
-                            cursor.push();
-                            cursor.toFirstChild();
-                            convertToDescriptionGroup(cursor, moveable);
-                            while (cursor.toNextSibling(J2EE_NAMESPACE, "init-param")) {
-                                cursor.push();
-                                cursor.toFirstChild();
-                                convertToDescriptionGroup(cursor, moveable);
-                                cursor.pop();
-                            }
-                            cursor.pop();
-                        }
-                    } while (cursor.toNextSibling());
-                } finally {
-                    moveable.dispose();
-                }
-            }
-        } finally {
-            cursor.dispose();
-        }
-        XmlObject result = xmlObject.changeType(WebAppDocument.type);
-        if (result != null) {
-            XmlBeansUtil.validateDD(result);
-            return (WebAppDocument) result;
-        }
-        XmlBeansUtil.validateDD(xmlObject);
-        return (WebAppDocument) xmlObject;
-    }
-
     public static void convertToGeronimoSubSchemas(XmlCursor cursor) {
         cursor.toStartDoc();
         XmlCursor end = cursor.newCursor();
@@ -462,6 +361,32 @@
         return true;
     }
 
+    public static boolean convertSchemaVersion (XmlCursor cursor, String namespace, String schemaLocationURL, String version) {
+        boolean isFirstStart = true;
+
+
+        while (cursor.hasNextToken()) {
+            if (cursor.isStart()) {
+                //convert namespace of each starting element
+                cursor.setName(new QName(namespace, cursor.getName().getLocalPart()));
+                if (isFirstStart) {
+                    //if we are at the first element in the document, reset the version number ...
+                    cursor.setAttributeText(new QName("version"), version);
+                    //... and also set the xsi:schemaLocation
+                    cursor.setAttributeText(new QName("http://www.w3.org/2001/XMLSchema-instance", "schemaLocation", "xsi"), namespace + "  "+schemaLocationURL);
+                    isFirstStart = false;
+                }
+                cursor.toNextToken();
+
+            } else {
+                cursor.toNextToken();
+            }
+        }
+
+
+        return true;
+    }
+
     public static void convertBeans(XmlCursor cursor, XmlCursor moveable, String cmpVersion) {
         cursor.toChild(J2EE_NAMESPACE, "ejb-jar");
         cursor.toChild(J2EE_NAMESPACE, "enterprise-beans");
@@ -473,7 +398,7 @@
                 if ("session".equals(type)) {
                     cursor.toChild(J2EE_NAMESPACE, "transaction-type");
                     cursor.toNextSibling();
-                    convertToJNDIEnvironmentRefsGroup(cursor, moveable);
+                    convertToJNDIEnvironmentRefsGroup(J2EE_NAMESPACE, cursor, moveable);
                 } else if ("entity".equals(type)) {
                     cursor.toChild(J2EE_NAMESPACE, "persistence-type");
                     String persistenceType = cursor.getTextValue();
@@ -491,7 +416,7 @@
                     }
                     cursor.toNextSibling(J2EE_NAMESPACE, "primkey-field");
                     cursor.toNextSibling();
-                    convertToJNDIEnvironmentRefsGroup(cursor, moveable);
+                    convertToJNDIEnvironmentRefsGroup(J2EE_NAMESPACE, cursor, moveable);
                 } else if ("message-driven".equals(type)) {
                     cursor.toFirstChild();
                     if (cursor.toNextSibling(J2EE_NAMESPACE, "messaging-type")) {
@@ -532,7 +457,7 @@
                         cursor.toNextSibling();
                         //cursor should now be at first element in JNDIEnvironmentRefsGroup
                     }
-                    convertToJNDIEnvironmentRefsGroup(cursor, moveable);
+                    convertToJNDIEnvironmentRefsGroup(J2EE_NAMESPACE, cursor, moveable);
                 }
                 cursor.pop();
             } while (cursor.toNextSibling());
@@ -557,44 +482,45 @@
     /**
      * Reorders elements to match descriptionGroup
      *
+     * @param namespace
      * @param cursor XmlCursor positioned at first element of "group" to be reordered
      */
-    public static void convertToDescriptionGroup(XmlCursor cursor, XmlCursor moveable) {
+    public static void convertToDescriptionGroup(String namespace, XmlCursor cursor, XmlCursor moveable) {
         moveable.toCursor(cursor);
-        moveElements("description", moveable, cursor);
-        moveElements("display-name", moveable, cursor);
-        moveElements("icon", moveable, cursor);
+        moveElements("description", namespace, moveable, cursor);
+        moveElements("display-name", namespace, moveable, cursor);
+        moveElements("icon", namespace, moveable, cursor);
     }
 
-    public static void convertToJNDIEnvironmentRefsGroup(XmlCursor cursor, XmlCursor moveable) {
-        moveElements("env-entry", moveable, cursor);
-        moveElements("ejb-ref", moveable, cursor);
-        moveElements("ejb-local-ref", moveable, cursor);
-        moveElements("resource-ref", moveable, cursor);
-        moveElements("resource-env-ref", moveable, cursor);
-        moveElements("message-destination-ref", moveable, cursor);
+    public static void convertToJNDIEnvironmentRefsGroup(String namespace, XmlCursor cursor, XmlCursor moveable) {
+        moveElements("env-entry", namespace, moveable, cursor);
+        moveElements("ejb-ref", namespace, moveable, cursor);
+        moveElements("ejb-local-ref", namespace, moveable, cursor);
+        moveElements("resource-ref", namespace, moveable, cursor);
+        moveElements("resource-env-ref", namespace, moveable, cursor);
+        moveElements("message-destination-ref", namespace, moveable, cursor);
         if (cursor.toPrevSibling()) {
             do {
                 String name = cursor.getName().getLocalPart();
                 if ("env-entry".equals(name)) {
                     cursor.push();
                     cursor.toFirstChild();
-                    convertToDescriptionGroup(cursor, moveable);
-                    convertToEnvEntryGroup(cursor, moveable);
+                    convertToDescriptionGroup(namespace, cursor, moveable);
+                    convertToEnvEntryGroup(namespace, cursor, moveable);
                     cursor.pop();
                 }
             } while (cursor.toPrevSibling());
         }
     }
 
-    public static void convertToEnvEntryGroup(XmlCursor cursor, XmlCursor moveable) {
-        moveElements("env-entry-name", moveable, cursor);
-        moveElements("env-entry-type", moveable, cursor);
-        moveElements("env-entry-value", moveable, cursor);
+    public static void convertToEnvEntryGroup(String namespace, XmlCursor cursor, XmlCursor moveable) {
+        moveElements("env-entry-name", namespace, moveable, cursor);
+        moveElements("env-entry-type", namespace, moveable, cursor);
+        moveElements("env-entry-value", namespace, moveable, cursor);
     }
 
-    private static void moveElements(String localName, XmlCursor moveable, XmlCursor toHere) {
-        QName name = new QName(J2EE_NAMESPACE, localName);
+    private static void moveElements(String localName, String namespace, XmlCursor moveable, XmlCursor toHere) {
+        QName name = new QName(namespace, localName);
         //skip elements already in the correct order.
         while (name.equals(toHere.getName()) && toHere.toNextSibling()) {
         }

Modified: geronimo/server/branches/sachin/modules/geronimo-j2ee-schema/src/test/java/org/apache/geronimo/schema/SchemaConversionUtilsTest.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/sachin/modules/geronimo-j2ee-schema/src/test/java/org/apache/geronimo/schema/SchemaConversionUtilsTest.java?view=diff&rev=449697&r1=449696&r2=449697
==============================================================================
--- geronimo/server/branches/sachin/modules/geronimo-j2ee-schema/src/test/java/org/apache/geronimo/schema/SchemaConversionUtilsTest.java (original)
+++ geronimo/server/branches/sachin/modules/geronimo-j2ee-schema/src/test/java/org/apache/geronimo/schema/SchemaConversionUtilsTest.java Mon Sep 25 07:58:35 2006
@@ -23,12 +23,11 @@
 
 import javax.xml.namespace.QName;
 
-import junit.framework.TestCase;
 import org.apache.xmlbeans.XmlCursor;
 import org.apache.xmlbeans.XmlObject;
-import org.apache.xmlbeans.XmlException;
 import org.apache.geronimo.xbeans.j2ee.EjbJarType;
 import org.apache.geronimo.deployment.xmlbeans.XmlBeansUtil;
+import org.apache.geronimo.testsupport.XmlBeansTestSupport;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
@@ -39,7 +38,7 @@
  *
  * @version $Rev$ $Date$
  */
-public class SchemaConversionUtilsTest extends TestCase {
+public class SchemaConversionUtilsTest extends XmlBeansTestSupport {
     private static final Log log = LogFactory.getLog(SchemaConversionUtilsTest.class);
     
     private ClassLoader classLoader = this.getClass().getClassLoader();
@@ -94,35 +93,6 @@
         assertTrue("Differences after reconverting to application client schema: " + problems, ok3);
     }
 
-    public void testApplication13ToApplication14Transform() throws Exception {
-        URL srcXml = classLoader.getResource("j2ee_1_3dtd/application-13.xml");
-        URL expectedOutputXml = classLoader.getResource("j2ee_1_3dtd/application-14.xml");
-        XmlObject xmlObject = XmlObject.Factory.parse(srcXml);
-        XmlObject expected = XmlObject.Factory.parse(expectedOutputXml);
-        XmlBeansUtil.validateDD(expected);
-        xmlObject = SchemaConversionUtils.convertToApplicationSchema(xmlObject);
-//        log.debug(xmlObject.toString());
-//        log.debug(expected.toString());
-        List problems = new ArrayList();
-        boolean ok = compareXmlObjects(xmlObject, expected, problems);
-        assertTrue("Differences: " + problems, ok);
-        //make sure trying to convert twice has no bad effects
-        XmlCursor cursor2 = xmlObject.newCursor();
-        try {
-            String schemaLocationURL = "http://java.sun.com/xml/ns/j2ee/application_1_4.xsd";
-            String version = "1.4";
-            assertFalse(SchemaConversionUtils.convertToSchema(cursor2, SchemaConversionUtils.J2EE_NAMESPACE, schemaLocationURL, version));
-        } finally {
-            cursor2.dispose();
-        }
-        boolean ok2 = compareXmlObjects(xmlObject, expected, problems);
-        assertTrue("Differences after reconverting to schema: " + problems, ok2);
-        //do the whole transform twice...
-        xmlObject = SchemaConversionUtils.convertToApplicationSchema(xmlObject);
-        boolean ok3 = compareXmlObjects(xmlObject, expected, problems);
-        assertTrue("Differences after reconverting to application schema: " + problems, ok3);
-    }
-
     public void testConnector10ToConnector15Transform() throws Exception {
         URL srcXml = classLoader.getResource("j2ee_1_3dtd/ra-10.xml");
         URL expectedOutputXml = classLoader.getResource("j2ee_1_3dtd/ra-15.xml");
@@ -323,70 +293,6 @@
         assertTrue("Differences: " + problems, ok);
     }
 
-    public void testWeb23To24Transform() throws Exception {
-        URL srcXml = classLoader.getResource("j2ee_1_3dtd/web-23.xml");
-        URL expectedOutputXml = classLoader.getResource("j2ee_1_3dtd/web-24.xml");
-        XmlObject xmlObject = XmlObject.Factory.parse(srcXml);
-        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 = SchemaConversionUtils.convertToServletSchema(xmlObject);
-        boolean ok2 = compareXmlObjects(xmlObject, expected, problems);
-        assertTrue("Differences: " + problems, ok2);
-    }
-
-    public void testWeb23To24OtherTransform() throws Exception {
-        URL srcXml = classLoader.getResource("j2ee_1_3dtd/web-1-23.xml");
-        URL expectedOutputXml = classLoader.getResource("j2ee_1_3dtd/web-1-24.xml");
-        XmlObject xmlObject = XmlObject.Factory.parse(srcXml);
-        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 = SchemaConversionUtils.convertToServletSchema(xmlObject);
-        boolean ok2 = compareXmlObjects(xmlObject, expected, problems);
-        assertTrue("Differences: " + problems, ok2);
-    }
-
-    public void testWeb22To24Transform1() throws Exception {
-        URL srcXml = classLoader.getResource("j2ee_1_2dtd/web-1-22.xml");
-        URL expectedOutputXml = classLoader.getResource("j2ee_1_2dtd/web-1-24.xml");
-        XmlObject xmlObject = XmlObject.Factory.parse(srcXml);
-        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 = SchemaConversionUtils.convertToServletSchema(xmlObject);
-        boolean ok2 = compareXmlObjects(xmlObject, expected, problems);
-        assertTrue("Differences: " + problems, ok2);
-    }
-
-    public void testWebRejectBad24() throws Exception {
-        URL srcXml = classLoader.getResource("j2ee_1_4schema/web-1-24.xml");
-        XmlObject xmlObject = XmlObject.Factory.parse(srcXml);
-        try {
-            xmlObject = SchemaConversionUtils.convertToServletSchema(xmlObject);
-            fail("doc src/test-data/j2ee_1_4schema/web-1-24.xml is invalid, should not have validated");
-        } catch (XmlException e) {
-            //expected
-        }
-    }
-
-    public void testParseWeb24() throws Exception {
-        URL srcXml = classLoader.getResource("j2ee_1_4schema/web-2-24.xml");
-        XmlObject xmlObject = XmlObject.Factory.parse(srcXml);
-        xmlObject = SchemaConversionUtils.convertToServletSchema(xmlObject);
-    }
-
     public void testEJB21To21DoesNothing() throws Exception {
         URL srcXml = classLoader.getResource("j2ee_1_4schema/ejb-jar.xml");
         URL expectedOutputXml = classLoader.getResource("j2ee_1_4schema/ejb-jar.xml");
@@ -546,43 +452,6 @@
             cursor.dispose();
         }
 
-    }
-
-    private boolean compareXmlObjects(XmlObject xmlObject, XmlObject expectedObject, List problems) {
-        XmlCursor test = xmlObject.newCursor();
-        XmlCursor expected = expectedObject.newCursor();
-        boolean similar = true;
-        int elementCount = 0;
-        while (toNextStartToken(test)) {
-            elementCount++;
-            if (!toNextStartToken(expected)) {
-                problems.add("test longer than expected at element: " + elementCount);
-                return false;
-            }
-            QName actualQName = test.getName();
-            QName expectedQName = expected.getName();
-            if (!actualQName.equals(expectedQName)) {
-                problems.add("Different elements at elementCount: " + elementCount + ", test: " + actualQName + ", expected: " + expectedQName);
-                similar = false;
-            }
-            test.toNextToken();
-            expected.toNextToken();
-        }
-        if (toNextStartToken(expected)) {
-            problems.add("test shorter that expected at element: " + elementCount);
-            similar = false;
-        }
-        return similar;
-    }
-
-    private boolean toNextStartToken(XmlCursor cursor) {
-        while (!cursor.isStart()) {
-            if (!cursor.hasNextToken()) {
-                return false;
-            }
-            cursor.toNextToken();
-        }
-        return true;
     }
 
 }

Modified: geronimo/server/branches/sachin/modules/geronimo-jetty-builder/src/main/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/sachin/modules/geronimo-jetty-builder/src/main/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java?view=diff&rev=449697&r1=449696&r2=449697
==============================================================================
--- geronimo/server/branches/sachin/modules/geronimo-jetty-builder/src/main/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java (original)
+++ geronimo/server/branches/sachin/modules/geronimo-jetty-builder/src/main/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java Mon Sep 25 07:58:35 2006
@@ -20,7 +20,6 @@
 import java.io.File;
 import java.io.FileNotFoundException;
 import java.io.IOException;
-import java.net.MalformedURLException;
 import java.net.URL;
 import java.security.Permission;
 import java.security.PermissionCollection;
@@ -61,9 +60,9 @@
 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.NamingBuilder;
 import org.apache.geronimo.j2ee.deployment.WebModule;
 import org.apache.geronimo.j2ee.deployment.WebServiceBuilder;
-import org.apache.geronimo.j2ee.deployment.NamingBuilder;
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
 import org.apache.geronimo.jetty.DefaultWebApplicationHandlerFactory;
 import org.apache.geronimo.jetty.Host;
@@ -77,12 +76,12 @@
 import org.apache.geronimo.kernel.GBeanNotFoundException;
 import org.apache.geronimo.kernel.Kernel;
 import org.apache.geronimo.kernel.Naming;
-import org.apache.geronimo.kernel.config.ConfigurationData;
 import org.apache.geronimo.kernel.config.Configuration;
+import org.apache.geronimo.kernel.config.ConfigurationData;
 import org.apache.geronimo.kernel.repository.Environment;
 import org.apache.geronimo.naming.deployment.ENCConfigBuilder;
 import org.apache.geronimo.naming.deployment.GBeanResourceEnvironmentBuilder;
-import org.apache.geronimo.schema.SchemaConversionUtils;
+import org.apache.geronimo.naming.deployment.ResourceEnvironmentSetter;
 import org.apache.geronimo.security.deploy.DefaultPrincipal;
 import org.apache.geronimo.security.deployment.SecurityConfiguration;
 import org.apache.geronimo.security.jacc.ComponentPermissions;
@@ -151,8 +150,9 @@
             Collection securityBuilders,
             Collection serviceBuilders,
             NamingBuilder namingBuilders,
+            ResourceEnvironmentSetter resourceEnvironmentSetter,
             Kernel kernel) throws GBeanNotFoundException {
-        super(kernel, securityBuilders, serviceBuilders, namingBuilders);
+        super(kernel, securityBuilders, serviceBuilders, namingBuilders, resourceEnvironmentSetter);
         this.defaultEnvironment = defaultEnvironment;
         this.defaultSessionTimeoutSeconds = (defaultSessionTimeoutSeconds == null) ? new Integer(30 * 60) : defaultSessionTimeoutSeconds;
         this.jettyContainerObjectName = jettyContainerName;
@@ -204,7 +204,7 @@
         try {
             // parse it
             XmlObject parsed = XmlBeansUtil.parse(specDD);
-            WebAppDocument webAppDoc = SchemaConversionUtils.convertToServletSchema(parsed);
+            WebAppDocument webAppDoc = convertToServletSchema(parsed);
             webApp = webAppDoc.getWebApp();
         } catch (XmlException xmle) {
             // Output the target path in the error to make it clearer to the user which webapp
@@ -245,15 +245,7 @@
 
         Map servletNameToPathMap = buildServletNameToPathMap(webApp, contextRoot);
 
-        //look for a webservices dd
-        Map portMap = Collections.EMPTY_MAP;
-        try {
-            URL wsDDUrl = DeploymentUtil.createJarURL(moduleFile, "WEB-INF/webservices.xml");
-            portMap = getWebServiceBuilder().parseWebServiceDescriptor(wsDDUrl, moduleFile, false, servletNameToPathMap);
-        } catch (MalformedURLException e) {
-            //no descriptor
-        }
-        AbstractName moduleName;
+        Map portMap = getWebServiceBuilder().findWebServices(moduleFile, false, servletNameToPathMap);        AbstractName moduleName;
         if (earName == null) {
             earName = naming.createRootName(environment.getConfigId(), NameFactory.NULL, NameFactory.J2EE_APPLICATION);
             moduleName = naming.createChildName(earName, environment.getConfigId().toString(), NameFactory.WEB_MODULE);
@@ -344,7 +336,7 @@
 
         //this may add to the web classpath with enhanced classes.
         //N.B. we use the ear context which has all the gbeans we could possibly be looking up from this ear.
-        Map compContext = buildComponentContext(earContext, webModule, webApp, jettyWebApp, moduleClassLoader);
+        Map compContext = buildComponentContext(earContext, webModule, webApp, jettyWebApp);
 
         GBeanData webModuleData = new GBeanData(moduleName, JettyWebAppContext.GBEAN_INFO);
         try {
@@ -375,7 +367,7 @@
             // unsharableResources, applicationManagedSecurityResources
             GBeanResourceEnvironmentBuilder rebuilder = new GBeanResourceEnvironmentBuilder(webModuleData);
             //N.B. use earContext not moduleContext
-            ENCConfigBuilder.setResourceEnvironment(rebuilder, webApp.getResourceRefArray(), jettyWebApp.getResourceRefArray());
+            resourceEnvironmentSetter.setResourceEnvironment(rebuilder, webApp.getResourceRefArray(), jettyWebApp.getResourceRefArray());
 
             webModuleData.setAttribute("contextPath", webModule.getContextRoot());
 
@@ -1001,7 +993,7 @@
         return servletAbstractName;
     }
 
-    private Map buildComponentContext(EARContext earContext, Module webModule, WebAppType webApp, JettyWebAppType jettyWebApp, ClassLoader cl) throws DeploymentException {
+    private Map buildComponentContext(EARContext earContext, Module webModule, WebAppType webApp, JettyWebAppType jettyWebApp) throws DeploymentException {
         Map componentContext = new HashMap();
         Configuration earConfiguration = earContext.getConfiguration();
         getNamingBuilders().buildNaming(webApp, jettyWebApp, earConfiguration, earConfiguration, webModule, componentContext);
@@ -1025,6 +1017,7 @@
         infoBuilder.addReference("SecurityBuilders", NamespaceDrivenBuilder.class, NameFactory.MODULE_BUILDER);
         infoBuilder.addReference("ServiceBuilders", NamespaceDrivenBuilder.class, NameFactory.MODULE_BUILDER);
         infoBuilder.addReference("NamingBuilders", NamingBuilder.class, NameFactory.MODULE_BUILDER);
+        infoBuilder.addReference("ResourceEnvironmentSetter", ResourceEnvironmentSetter.class, NameFactory.MODULE_BUILDER);
         infoBuilder.addAttribute("kernel", Kernel.class, false);
         infoBuilder.addInterface(ModuleBuilder.class);
 
@@ -1042,6 +1035,7 @@
                 "SecurityBuilders",
                 "ServiceBuilders",
                 "NamingBuilders",
+                "ResourceEnvironmentSetter",
                 "kernel"});
         GBEAN_INFO = infoBuilder.getBeanInfo();
     }

Modified: geronimo/server/branches/sachin/modules/geronimo-jetty-builder/src/test/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilderTest.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/sachin/modules/geronimo-jetty-builder/src/test/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilderTest.java?view=diff&rev=449697&r1=449696&r2=449697
==============================================================================
--- geronimo/server/branches/sachin/modules/geronimo-jetty-builder/src/test/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilderTest.java (original)
+++ geronimo/server/branches/sachin/modules/geronimo-jetty-builder/src/test/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilderTest.java Mon Sep 25 07:58:35 2006
@@ -212,7 +212,7 @@
     protected void setUp() throws Exception {
         super.setUp();
 
-        ((SchemaTypeImpl)GerSecurityDocument.type).addSubstitutionGroupMember(org.apache.geronimo.xbeans.geronimo.security.GerSecurityDocument.type.getDocumentElementName());
+        ((SchemaTypeImpl) GerSecurityDocument.type).addSubstitutionGroupMember(org.apache.geronimo.xbeans.geronimo.security.GerSecurityDocument.type.getDocumentElementName());
 
         cl = this.getClass().getClassLoader();
         kernel = KernelFactory.newInstance().createKernel("test");
@@ -270,19 +270,20 @@
         defaultEnvironment.addDependency(baseId, ImportType.ALL);
         defaultEnvironment.setConfigId(webModuleArtifact);
         builder = new JettyModuleBuilder(defaultEnvironment,
-                         new Integer(1800),
-                         Collections.EMPTY_LIST,
-                         new AbstractNameQuery(containerName),
-                         defaultServlets,
-                         defaultFilters,
-                         defaultFilterMappings,
-                         pojoWebServiceTemplate,
-                         Collections.singleton(webServiceBuilder),
-                         null,
-                         Collections.singleton(new GeronimoSecurityBuilderImpl()),
-                         Collections.singleton(new GBeanBuilder(null, null)),
-                         new NamingBuilderCollection(null, null), 
-                         kernel);
+                new Integer(1800),
+                Collections.EMPTY_LIST,
+                new AbstractNameQuery(containerName),
+                defaultServlets,
+                defaultFilters,
+                defaultFilterMappings,
+                pojoWebServiceTemplate,
+                Collections.singleton(webServiceBuilder),
+                null,
+                Collections.singleton(new GeronimoSecurityBuilderImpl()),
+                Collections.singleton(new GBeanBuilder(null, null)),
+                new NamingBuilderCollection(null, null),
+                new MockResourceEnvironmentSetter(),
+                kernel);
     }
 
     protected void tearDown() throws Exception {

Modified: geronimo/server/branches/sachin/modules/geronimo-jetty-builder/src/test/java/org/apache/geronimo/jetty/deployment/PlanParsingTest.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/sachin/modules/geronimo-jetty-builder/src/test/java/org/apache/geronimo/jetty/deployment/PlanParsingTest.java?view=diff&rev=449697&r1=449696&r2=449697
==============================================================================
--- geronimo/server/branches/sachin/modules/geronimo-jetty-builder/src/test/java/org/apache/geronimo/jetty/deployment/PlanParsingTest.java (original)
+++ geronimo/server/branches/sachin/modules/geronimo-jetty-builder/src/test/java/org/apache/geronimo/jetty/deployment/PlanParsingTest.java Mon Sep 25 07:58:35 2006
@@ -7,7 +7,7 @@
 import java.util.HashSet;
 import java.util.List;
 import java.util.jar.JarFile;
-  
+
 import javax.xml.namespace.QName;
 
 import org.apache.geronimo.deployment.util.UnpackedJarFile;
@@ -43,7 +43,7 @@
 /**
  */
 public class PlanParsingTest extends TestSupport {
-    
+
     private ClassLoader classLoader = this.getClass().getClassLoader();
 
     private Naming naming = new Jsr77Naming();
@@ -57,19 +57,20 @@
 
     public PlanParsingTest() throws Exception {
         builder = new JettyModuleBuilder(defaultEnvironment,
-            new Integer(1800),
-            null,
-            jettyContainerObjectName,
-            new HashSet(),
-            new HashSet(),
-            new HashSet(),
-            pojoWebServiceTemplate,
-            Collections.singleton(webServiceBuilder),
-            null,
-            Collections.singleton(new GeronimoSecurityBuilderImpl()),
-            Collections.singleton(new GBeanBuilder(null, null)),
-            new NamingBuilderCollection(null, null), 
-            null);
+                new Integer(1800),
+                null,
+                jettyContainerObjectName,
+                new HashSet(),
+                new HashSet(),
+                new HashSet(),
+                pojoWebServiceTemplate,
+                Collections.singleton(webServiceBuilder),
+                null,
+                Collections.singleton(new GeronimoSecurityBuilderImpl()),
+                Collections.singleton(new GBeanBuilder(null, null)),
+                new NamingBuilderCollection(null, null),
+                new MockResourceEnvironmentSetter(),
+                null);
     }
 
     public void testContents() throws Exception {
@@ -106,7 +107,7 @@
 
     public void testOldFormat() throws Exception {
         URL resourcePlan = classLoader.getResource("plans/plan2.xml");
-        assertTrue(resourcePlan!= null);
+        assertTrue(resourcePlan != null);
         JettyWebAppType jettyWebApp = builder.getJettyWebApp(new File(resourcePlan.getFile()), null, true, null, null);
         assertEquals(1, jettyWebApp.getResourceRefArray().length);
 //        assertEquals(4, jettyWebApp.getSecurity().getRoleMappings().getRoleArray().length);
@@ -153,7 +154,8 @@
         configId.setType("car");
     }
 
-    /** This test has 2 purposes: one the obvious one explicitly tested,
+    /**
+     * This test has 2 purposes: one the obvious one explicitly tested,
      * the other that passing a JettyWebAppType XmlObject in works.  This latter
      * models a web-app element inside an ear plan.
      *

Modified: geronimo/server/branches/sachin/modules/geronimo-jetty/src/main/java/org/apache/geronimo/jetty/GeronimoServletHttpRequest.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/sachin/modules/geronimo-jetty/src/main/java/org/apache/geronimo/jetty/GeronimoServletHttpRequest.java?view=diff&rev=449697&r1=449696&r2=449697
==============================================================================
--- geronimo/server/branches/sachin/modules/geronimo-jetty/src/main/java/org/apache/geronimo/jetty/GeronimoServletHttpRequest.java (original)
+++ geronimo/server/branches/sachin/modules/geronimo-jetty/src/main/java/org/apache/geronimo/jetty/GeronimoServletHttpRequest.java Mon Sep 25 07:58:35 2006
@@ -42,6 +42,7 @@
     }
     
     public void setRequestedSessionId(String pathParams) {
+        requestedSessionId = null;
         if (servletHandler.isUsingCookies()) {
             Cookie[] cookies= request.getCookies();
             if (cookies!=null && cookies.length>0) {

Modified: geronimo/server/branches/sachin/modules/geronimo-jetty/src/main/java/org/apache/geronimo/jetty/InternalJAASJettyRealm.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/sachin/modules/geronimo-jetty/src/main/java/org/apache/geronimo/jetty/InternalJAASJettyRealm.java?view=diff&rev=449697&r1=449696&r2=449697
==============================================================================
--- geronimo/server/branches/sachin/modules/geronimo-jetty/src/main/java/org/apache/geronimo/jetty/InternalJAASJettyRealm.java (original)
+++ geronimo/server/branches/sachin/modules/geronimo-jetty/src/main/java/org/apache/geronimo/jetty/InternalJAASJettyRealm.java Mon Sep 25 07:58:35 2006
@@ -21,6 +21,7 @@
 import java.security.Principal;
 import java.security.cert.X509Certificate;
 import java.util.HashMap;
+
 import javax.security.auth.Subject;
 import javax.security.auth.login.LoginContext;
 import javax.security.auth.login.LoginException;
@@ -28,7 +29,6 @@
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.apache.geronimo.jetty.interceptor.SecurityContextBeforeAfter;
 import org.apache.geronimo.security.ContextManager;
 import org.apache.geronimo.security.realm.providers.CertificateCallbackHandler;
 import org.apache.geronimo.security.realm.providers.ClearableCallbackHandler;

Modified: geronimo/server/branches/sachin/modules/geronimo-jetty/src/main/java/org/apache/geronimo/jetty/JAASJettyPrincipal.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/sachin/modules/geronimo-jetty/src/main/java/org/apache/geronimo/jetty/JAASJettyPrincipal.java?view=diff&rev=449697&r1=449696&r2=449697
==============================================================================
--- geronimo/server/branches/sachin/modules/geronimo-jetty/src/main/java/org/apache/geronimo/jetty/JAASJettyPrincipal.java (original)
+++ geronimo/server/branches/sachin/modules/geronimo-jetty/src/main/java/org/apache/geronimo/jetty/JAASJettyPrincipal.java Mon Sep 25 07:58:35 2006
@@ -17,7 +17,7 @@
 package org.apache.geronimo.jetty;
 
 import java.security.Principal;
-import java.util.Stack;
+
 import javax.security.auth.Subject;
 
 

Modified: geronimo/server/branches/sachin/modules/geronimo-jetty/src/main/java/org/apache/geronimo/jetty/JettyContainer.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/sachin/modules/geronimo-jetty/src/main/java/org/apache/geronimo/jetty/JettyContainer.java?view=diff&rev=449697&r1=449696&r2=449697
==============================================================================
--- geronimo/server/branches/sachin/modules/geronimo-jetty/src/main/java/org/apache/geronimo/jetty/JettyContainer.java (original)
+++ geronimo/server/branches/sachin/modules/geronimo-jetty/src/main/java/org/apache/geronimo/jetty/JettyContainer.java Mon Sep 25 07:58:35 2006
@@ -17,11 +17,10 @@
 
 package org.apache.geronimo.jetty;
 
+import org.apache.geronimo.management.geronimo.WebContainer;
 import org.mortbay.http.HttpContext;
 import org.mortbay.http.HttpListener;
 import org.mortbay.http.RequestLog;
-import org.mortbay.http.UserRealm;
-import org.apache.geronimo.management.geronimo.WebContainer;
 
 /**
  * @version $Rev$ $Date$

Modified: geronimo/server/branches/sachin/modules/geronimo-jetty/src/main/java/org/apache/geronimo/jetty/JettyManagerImpl.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/sachin/modules/geronimo-jetty/src/main/java/org/apache/geronimo/jetty/JettyManagerImpl.java?view=diff&rev=449697&r1=449696&r2=449697
==============================================================================
--- geronimo/server/branches/sachin/modules/geronimo-jetty/src/main/java/org/apache/geronimo/jetty/JettyManagerImpl.java (original)
+++ geronimo/server/branches/sachin/modules/geronimo-jetty/src/main/java/org/apache/geronimo/jetty/JettyManagerImpl.java Mon Sep 25 07:58:35 2006
@@ -20,6 +20,7 @@
 import java.util.Iterator;
 import java.util.List;
 import java.util.Set;
+
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.geronimo.gbean.AbstractName;
@@ -36,7 +37,6 @@
 import org.apache.geronimo.jetty.requestlog.JettyLogManager;
 import org.apache.geronimo.kernel.GBeanNotFoundException;
 import org.apache.geronimo.kernel.Kernel;
-import org.apache.geronimo.kernel.repository.Artifact;
 import org.apache.geronimo.kernel.config.ConfigurationUtil;
 import org.apache.geronimo.kernel.config.EditableConfigurationManager;
 import org.apache.geronimo.kernel.config.InvalidConfigException;

Modified: geronimo/server/branches/sachin/modules/geronimo-jetty/src/main/java/org/apache/geronimo/jetty/JettyPOJOWebServiceHolder.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/sachin/modules/geronimo-jetty/src/main/java/org/apache/geronimo/jetty/JettyPOJOWebServiceHolder.java?view=diff&rev=449697&r1=449696&r2=449697
==============================================================================
--- geronimo/server/branches/sachin/modules/geronimo-jetty/src/main/java/org/apache/geronimo/jetty/JettyPOJOWebServiceHolder.java (original)
+++ geronimo/server/branches/sachin/modules/geronimo-jetty/src/main/java/org/apache/geronimo/jetty/JettyPOJOWebServiceHolder.java Mon Sep 25 07:58:35 2006
@@ -17,7 +17,6 @@
 package org.apache.geronimo.jetty;
 
 import java.io.IOException;
-import java.util.Collections;
 import java.util.Map;
 import java.util.Set;
 

Modified: geronimo/server/branches/sachin/modules/geronimo-jetty/src/main/java/org/apache/geronimo/jetty/JettyServletHolder.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/sachin/modules/geronimo-jetty/src/main/java/org/apache/geronimo/jetty/JettyServletHolder.java?view=diff&rev=449697&r1=449696&r2=449697
==============================================================================
--- geronimo/server/branches/sachin/modules/geronimo-jetty/src/main/java/org/apache/geronimo/jetty/JettyServletHolder.java (original)
+++ geronimo/server/branches/sachin/modules/geronimo-jetty/src/main/java/org/apache/geronimo/jetty/JettyServletHolder.java Mon Sep 25 07:58:35 2006
@@ -20,19 +20,18 @@
 import java.util.Map;
 import java.util.Set;
 
+import javax.security.auth.Subject;
 import javax.servlet.ServletException;
 import javax.servlet.ServletRequest;
 import javax.servlet.ServletResponse;
 import javax.servlet.UnavailableException;
-import javax.security.auth.Subject;
 
 import org.apache.geronimo.gbean.GBeanInfo;
 import org.apache.geronimo.gbean.GBeanInfoBuilder;
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
 import org.apache.geronimo.management.Servlet;
-import org.apache.geronimo.security.ContextManager;
 import org.apache.geronimo.security.Callers;
-
+import org.apache.geronimo.security.ContextManager;
 import org.mortbay.jetty.servlet.ServletHolder;
 
 

Modified: geronimo/server/branches/sachin/modules/geronimo-jetty/src/main/java/org/apache/geronimo/jetty/JettyServletRegistration.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/sachin/modules/geronimo-jetty/src/main/java/org/apache/geronimo/jetty/JettyServletRegistration.java?view=diff&rev=449697&r1=449696&r2=449697
==============================================================================
--- geronimo/server/branches/sachin/modules/geronimo-jetty/src/main/java/org/apache/geronimo/jetty/JettyServletRegistration.java (original)
+++ geronimo/server/branches/sachin/modules/geronimo-jetty/src/main/java/org/apache/geronimo/jetty/JettyServletRegistration.java Mon Sep 25 07:58:35 2006
@@ -16,9 +16,7 @@
  */
 package org.apache.geronimo.jetty;
 
-import java.util.Map;
 import java.util.Set;
-import javax.security.jacc.PolicyContextException;
 
 import org.mortbay.jetty.servlet.ServletHandler;
 import org.mortbay.jetty.servlet.ServletHolder;

Modified: geronimo/server/branches/sachin/modules/geronimo-jetty/src/main/java/org/apache/geronimo/jetty/JettyWebAppContext.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/sachin/modules/geronimo-jetty/src/main/java/org/apache/geronimo/jetty/JettyWebAppContext.java?view=diff&rev=449697&r1=449696&r2=449697
==============================================================================
--- geronimo/server/branches/sachin/modules/geronimo-jetty/src/main/java/org/apache/geronimo/jetty/JettyWebAppContext.java (original)
+++ geronimo/server/branches/sachin/modules/geronimo-jetty/src/main/java/org/apache/geronimo/jetty/JettyWebAppContext.java Mon Sep 25 07:58:35 2006
@@ -34,10 +34,10 @@
 import javax.management.ObjectName;
 import javax.naming.Context;
 import javax.transaction.TransactionManager;
-import javax.transaction.UserTransaction;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
+import org.apache.geronimo.connector.outbound.connectiontracking.TrackedConnectionAssociator;
 import org.apache.geronimo.gbean.GBeanInfo;
 import org.apache.geronimo.gbean.GBeanInfoBuilder;
 import org.apache.geronimo.gbean.GBeanLifecycle;
@@ -58,8 +58,6 @@
 import org.apache.geronimo.management.geronimo.WebModule;
 import org.apache.geronimo.naming.enc.EnterpriseNamingContext;
 import org.apache.geronimo.security.deploy.DefaultPrincipal;
-import org.apache.geronimo.security.jacc.RoleDesignateSource;
-import org.apache.geronimo.connector.outbound.connectiontracking.TrackedConnectionAssociator;
 import org.apache.geronimo.transaction.GeronimoUserTransaction;
 import org.mortbay.http.Authenticator;
 import org.mortbay.http.HttpException;
@@ -320,12 +318,11 @@
         ServletHttpRequest request = (ServletHttpRequest) httpRequest.getWrapper();
         if (null == request) {
             request = new GeronimoServletHttpRequest(handler, null, httpRequest);
-            ((GeronimoServletHttpRequest) request).setRequestedSessionId(pathParams);
             ServletHttpResponse response = new ServletHttpResponse(request, httpResponse);
             httpRequest.setWrapper(request);
             httpResponse.setWrapper(response);
         }
-
+        ((GeronimoServletHttpRequest) request).setRequestedSessionId(pathParams);
         if (null != handleInterceptor) {
             handleInterceptor.handle(pathInContext, pathParams, httpRequest, httpResponse, new EndHandleInterceptor());   
         } else {

Modified: geronimo/server/branches/sachin/modules/geronimo-jetty/src/main/java/org/apache/geronimo/jetty/JettyWebContainerStatsImpl.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/sachin/modules/geronimo-jetty/src/main/java/org/apache/geronimo/jetty/JettyWebContainerStatsImpl.java?view=diff&rev=449697&r1=449696&r2=449697
==============================================================================
--- geronimo/server/branches/sachin/modules/geronimo-jetty/src/main/java/org/apache/geronimo/jetty/JettyWebContainerStatsImpl.java (original)
+++ geronimo/server/branches/sachin/modules/geronimo-jetty/src/main/java/org/apache/geronimo/jetty/JettyWebContainerStatsImpl.java Mon Sep 25 07:58:35 2006
@@ -1,14 +1,14 @@
 package org.apache.geronimo.jetty;
 
+import javax.management.j2ee.statistics.CountStatistic;
+import javax.management.j2ee.statistics.RangeStatistic;
+import javax.management.j2ee.statistics.TimeStatistic;
+
 import org.apache.geronimo.management.stats.CountStatisticImpl;
 import org.apache.geronimo.management.stats.RangeStatisticImpl;
 import org.apache.geronimo.management.stats.StatisticImpl;
 import org.apache.geronimo.management.stats.StatsImpl;
 import org.apache.geronimo.management.stats.TimeStatisticImpl;
-
-import javax.management.j2ee.statistics.CountStatistic;
-import javax.management.j2ee.statistics.RangeStatistic;
-import javax.management.j2ee.statistics.TimeStatistic;
 
 /**
  * Jetty implementation of the Geronimo stats interface WebContainerStats

Modified: geronimo/server/branches/sachin/modules/geronimo-jetty/src/main/java/org/apache/geronimo/jetty/NonAuthenticator.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/sachin/modules/geronimo-jetty/src/main/java/org/apache/geronimo/jetty/NonAuthenticator.java?view=diff&rev=449697&r1=449696&r2=449697
==============================================================================
--- geronimo/server/branches/sachin/modules/geronimo-jetty/src/main/java/org/apache/geronimo/jetty/NonAuthenticator.java (original)
+++ geronimo/server/branches/sachin/modules/geronimo-jetty/src/main/java/org/apache/geronimo/jetty/NonAuthenticator.java Mon Sep 25 07:58:35 2006
@@ -1,12 +1,12 @@
 package org.apache.geronimo.jetty;
 
+import java.io.IOException;
+import java.security.Principal;
+
 import org.mortbay.http.Authenticator;
-import org.mortbay.http.UserRealm;
 import org.mortbay.http.HttpRequest;
 import org.mortbay.http.HttpResponse;
-
-import java.security.Principal;
-import java.io.IOException;
+import org.mortbay.http.UserRealm;
 
 /**
  * Authenticator that always denies, returning null.  Useful when you need to install a default principal/subject

Modified: geronimo/server/branches/sachin/modules/geronimo-jetty/src/main/java/org/apache/geronimo/jetty/connector/GeronimoSSLListener.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/sachin/modules/geronimo-jetty/src/main/java/org/apache/geronimo/jetty/connector/GeronimoSSLListener.java?view=diff&rev=449697&r1=449696&r2=449697
==============================================================================
--- geronimo/server/branches/sachin/modules/geronimo-jetty/src/main/java/org/apache/geronimo/jetty/connector/GeronimoSSLListener.java (original)
+++ geronimo/server/branches/sachin/modules/geronimo-jetty/src/main/java/org/apache/geronimo/jetty/connector/GeronimoSSLListener.java Mon Sep 25 07:58:35 2006
@@ -16,10 +16,10 @@
  */
 package org.apache.geronimo.jetty.connector;
 
-import org.mortbay.http.SslListener;
-import org.apache.geronimo.management.geronimo.KeystoreManager;
-
 import javax.net.ssl.SSLServerSocketFactory;
+
+import org.apache.geronimo.management.geronimo.KeystoreManager;
+import org.mortbay.http.SslListener;
 
 /**
  * SSL listener that hooks into the Geronimo keystore infrastructure.

Modified: geronimo/server/branches/sachin/modules/geronimo-jetty/src/main/java/org/apache/geronimo/jetty/connector/HTTPSConnector.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/sachin/modules/geronimo-jetty/src/main/java/org/apache/geronimo/jetty/connector/HTTPSConnector.java?view=diff&rev=449697&r1=449696&r2=449697
==============================================================================
--- geronimo/server/branches/sachin/modules/geronimo-jetty/src/main/java/org/apache/geronimo/jetty/connector/HTTPSConnector.java (original)
+++ geronimo/server/branches/sachin/modules/geronimo-jetty/src/main/java/org/apache/geronimo/jetty/connector/HTTPSConnector.java Mon Sep 25 07:58:35 2006
@@ -18,6 +18,7 @@
 package org.apache.geronimo.jetty.connector;
 
 import javax.net.ssl.KeyManagerFactory;
+
 import org.apache.geronimo.gbean.GBeanInfo;
 import org.apache.geronimo.gbean.GBeanInfoBuilder;
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;

Modified: geronimo/server/branches/sachin/modules/geronimo-jetty/src/main/java/org/apache/geronimo/jetty/connector/JettyConnector.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/sachin/modules/geronimo-jetty/src/main/java/org/apache/geronimo/jetty/connector/JettyConnector.java?view=diff&rev=449697&r1=449696&r2=449697
==============================================================================
--- geronimo/server/branches/sachin/modules/geronimo-jetty/src/main/java/org/apache/geronimo/jetty/connector/JettyConnector.java (original)
+++ geronimo/server/branches/sachin/modules/geronimo-jetty/src/main/java/org/apache/geronimo/jetty/connector/JettyConnector.java Mon Sep 25 07:58:35 2006
@@ -17,16 +17,16 @@
 
 package org.apache.geronimo.jetty.connector;
 
-import java.net.UnknownHostException;
-import java.net.InetSocketAddress;
 import java.net.InetAddress;
+import java.net.InetSocketAddress;
+import java.net.UnknownHostException;
 
 import org.apache.geronimo.gbean.GBeanInfo;
 import org.apache.geronimo.gbean.GBeanInfoBuilder;
 import org.apache.geronimo.gbean.GBeanLifecycle;
+import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
 import org.apache.geronimo.jetty.JettyContainer;
 import org.apache.geronimo.jetty.JettyWebConnector;
-import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
 import org.mortbay.http.HttpListener;
 import org.mortbay.http.SocketListener;
 import org.mortbay.http.ajp.AJP13Listener;
@@ -95,7 +95,7 @@
                     host = "unknown-host";
                 }
                 if(address != null) {
-                    host = address.getHostName();
+                    host = address.getCanonicalHostName();
                     if(host == null || host.equals("")) {
                         host = address.getHostAddress();
                     }

Modified: geronimo/server/branches/sachin/modules/geronimo-jetty/src/main/java/org/apache/geronimo/jetty/interceptor/InstanceContextBeforeAfter.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/sachin/modules/geronimo-jetty/src/main/java/org/apache/geronimo/jetty/interceptor/InstanceContextBeforeAfter.java?view=diff&rev=449697&r1=449696&r2=449697
==============================================================================
--- geronimo/server/branches/sachin/modules/geronimo-jetty/src/main/java/org/apache/geronimo/jetty/interceptor/InstanceContextBeforeAfter.java (original)
+++ geronimo/server/branches/sachin/modules/geronimo-jetty/src/main/java/org/apache/geronimo/jetty/interceptor/InstanceContextBeforeAfter.java Mon Sep 25 07:58:35 2006
@@ -17,10 +17,11 @@
 package org.apache.geronimo.jetty.interceptor;
 
 import java.util.Set;
+
 import javax.resource.ResourceException;
 
-import org.apache.geronimo.connector.outbound.connectiontracking.ConnectorInstanceContextImpl;
 import org.apache.geronimo.connector.outbound.connectiontracking.ConnectorInstanceContext;
+import org.apache.geronimo.connector.outbound.connectiontracking.ConnectorInstanceContextImpl;
 import org.apache.geronimo.connector.outbound.connectiontracking.TrackedConnectionAssociator;
 import org.mortbay.http.HttpRequest;
 import org.mortbay.http.HttpResponse;

Modified: geronimo/server/branches/sachin/modules/geronimo-jetty/src/main/java/org/apache/geronimo/jetty/interceptor/SecurityContextBeforeAfter.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/sachin/modules/geronimo-jetty/src/main/java/org/apache/geronimo/jetty/interceptor/SecurityContextBeforeAfter.java?view=diff&rev=449697&r1=449696&r2=449697
==============================================================================
--- geronimo/server/branches/sachin/modules/geronimo-jetty/src/main/java/org/apache/geronimo/jetty/interceptor/SecurityContextBeforeAfter.java (original)
+++ geronimo/server/branches/sachin/modules/geronimo-jetty/src/main/java/org/apache/geronimo/jetty/interceptor/SecurityContextBeforeAfter.java Mon Sep 25 07:58:35 2006
@@ -21,19 +21,12 @@
 import java.security.AccessControlException;
 import java.security.PermissionCollection;
 import java.security.Principal;
+
 import javax.security.auth.Subject;
 import javax.security.jacc.PolicyContext;
 import javax.security.jacc.WebResourcePermission;
 import javax.security.jacc.WebUserDataPermission;
 
-import org.mortbay.http.Authenticator;
-import org.mortbay.http.HttpException;
-import org.mortbay.http.HttpRequest;
-import org.mortbay.http.HttpResponse;
-import org.mortbay.http.SecurityConstraint;
-import org.mortbay.jetty.servlet.FormAuthenticator;
-import org.mortbay.jetty.servlet.ServletHttpRequest;
-
 import org.apache.geronimo.common.DeploymentException;
 import org.apache.geronimo.common.GeronimoSecurityException;
 import org.apache.geronimo.jetty.JAASJettyPrincipal;
@@ -44,6 +37,13 @@
 import org.apache.geronimo.security.SubjectId;
 import org.apache.geronimo.security.deploy.DefaultPrincipal;
 import org.apache.geronimo.security.util.ConfigurationUtil;
+import org.mortbay.http.Authenticator;
+import org.mortbay.http.HttpException;
+import org.mortbay.http.HttpRequest;
+import org.mortbay.http.HttpResponse;
+import org.mortbay.http.SecurityConstraint;
+import org.mortbay.jetty.servlet.FormAuthenticator;
+import org.mortbay.jetty.servlet.ServletHttpRequest;
 
 
 /**
@@ -256,7 +256,8 @@
          */
         //TODO use run-as as nextCaller if present
         ContextManager.setCallers(defaultPrincipal.getSubject(), defaultPrincipal.getSubject());
-        ContextManager.setNextCaller(defaultPrincipal.getSubject());
+        //??????? next line does nothing!
+//        ContextManager.setNextCaller(defaultPrincipal.getSubject());
         return defaultPrincipal;
     }
 

Modified: geronimo/server/branches/sachin/modules/geronimo-jetty/src/main/java/org/apache/geronimo/jetty/interceptor/WebApplicationContextBeforeAfter.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/sachin/modules/geronimo-jetty/src/main/java/org/apache/geronimo/jetty/interceptor/WebApplicationContextBeforeAfter.java?view=diff&rev=449697&r1=449696&r2=449697
==============================================================================
--- geronimo/server/branches/sachin/modules/geronimo-jetty/src/main/java/org/apache/geronimo/jetty/interceptor/WebApplicationContextBeforeAfter.java (original)
+++ geronimo/server/branches/sachin/modules/geronimo-jetty/src/main/java/org/apache/geronimo/jetty/interceptor/WebApplicationContextBeforeAfter.java Mon Sep 25 07:58:35 2006
@@ -16,10 +16,10 @@
  */
 package org.apache.geronimo.jetty.interceptor;
 
+import org.apache.geronimo.jetty.JettyWebAppContext;
+import org.mortbay.http.HttpContext;
 import org.mortbay.http.HttpRequest;
 import org.mortbay.http.HttpResponse;
-import org.mortbay.http.HttpContext;
-import org.apache.geronimo.jetty.JettyWebAppContext;
 
 /**
  * @version $Rev$ $Date$

Modified: geronimo/server/branches/sachin/modules/geronimo-jetty/src/main/java/org/apache/geronimo/jetty/requestlog/JettyLogManagerImpl.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/sachin/modules/geronimo-jetty/src/main/java/org/apache/geronimo/jetty/requestlog/JettyLogManagerImpl.java?view=diff&rev=449697&r1=449696&r2=449697
==============================================================================
--- geronimo/server/branches/sachin/modules/geronimo-jetty/src/main/java/org/apache/geronimo/jetty/requestlog/JettyLogManagerImpl.java (original)
+++ geronimo/server/branches/sachin/modules/geronimo-jetty/src/main/java/org/apache/geronimo/jetty/requestlog/JettyLogManagerImpl.java Mon Sep 25 07:58:35 2006
@@ -16,24 +16,29 @@
  */
 package org.apache.geronimo.jetty.requestlog;
 
-import org.apache.geronimo.gbean.GBeanInfo;
-import org.apache.geronimo.gbean.GBeanInfoBuilder;
-import org.apache.geronimo.system.serverinfo.ServerInfo;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-import java.util.*;
-import java.util.regex.Pattern;
-import java.util.regex.Matcher;
 import java.io.File;
 import java.io.FilenameFilter;
 import java.io.RandomAccessFile;
-import java.nio.channels.FileChannel;
-import java.nio.MappedByteBuffer;
 import java.nio.CharBuffer;
+import java.nio.MappedByteBuffer;
+import java.nio.channels.FileChannel;
 import java.nio.charset.Charset;
-import java.text.SimpleDateFormat;
 import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Date;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.geronimo.gbean.GBeanInfo;
+import org.apache.geronimo.gbean.GBeanInfoBuilder;
+import org.apache.geronimo.system.serverinfo.ServerInfo;
 
 /**
  * Jetty implementation of the WebAccessLog management interface.

Modified: geronimo/server/branches/sachin/modules/geronimo-jetty/src/main/java/org/apache/geronimo/jetty/requestlog/NCSARequestLog.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/sachin/modules/geronimo-jetty/src/main/java/org/apache/geronimo/jetty/requestlog/NCSARequestLog.java?view=diff&rev=449697&r1=449696&r2=449697
==============================================================================
--- geronimo/server/branches/sachin/modules/geronimo-jetty/src/main/java/org/apache/geronimo/jetty/requestlog/NCSARequestLog.java (original)
+++ geronimo/server/branches/sachin/modules/geronimo-jetty/src/main/java/org/apache/geronimo/jetty/requestlog/NCSARequestLog.java Mon Sep 25 07:58:35 2006
@@ -19,9 +19,9 @@
 import org.apache.geronimo.gbean.GBeanInfo;
 import org.apache.geronimo.gbean.GBeanInfoBuilder;
 import org.apache.geronimo.gbean.GBeanLifecycle;
+import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
 import org.apache.geronimo.jetty.JettyContainer;
 import org.apache.geronimo.system.serverinfo.ServerInfo;
-import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
 
 /**
  * @version $Rev$ $Date$

Modified: geronimo/server/branches/sachin/modules/geronimo-jetty/src/test/java/org/apache/geronimo/jetty/AbstractWebModuleTest.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/sachin/modules/geronimo-jetty/src/test/java/org/apache/geronimo/jetty/AbstractWebModuleTest.java?view=diff&rev=449697&r1=449696&r2=449697
==============================================================================
--- geronimo/server/branches/sachin/modules/geronimo-jetty/src/test/java/org/apache/geronimo/jetty/AbstractWebModuleTest.java (original)
+++ geronimo/server/branches/sachin/modules/geronimo-jetty/src/test/java/org/apache/geronimo/jetty/AbstractWebModuleTest.java Mon Sep 25 07:58:35 2006
@@ -27,8 +27,6 @@
 
 import javax.transaction.TransactionManager;
 
-import org.apache.geronimo.testsupport.TestSupport;
-
 import org.apache.geronimo.connector.outbound.connectiontracking.ConnectionTrackingCoordinator;
 import org.apache.geronimo.connector.outbound.connectiontracking.GeronimoTransactionListener;
 import org.apache.geronimo.jetty.connector.HTTPConnector;
@@ -46,6 +44,7 @@
 import org.apache.geronimo.security.realm.GenericSecurityRealm;
 import org.apache.geronimo.system.serverinfo.BasicServerInfo;
 import org.apache.geronimo.system.serverinfo.ServerInfo;
+import org.apache.geronimo.testsupport.TestSupport;
 import org.apache.geronimo.transaction.manager.TransactionManagerImpl;
 import org.mortbay.http.Authenticator;
 import org.mortbay.jetty.servlet.FormAuthenticator;

Modified: geronimo/server/branches/sachin/modules/geronimo-jetty/src/test/java/org/apache/geronimo/jetty/ClassLoaderTest.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/sachin/modules/geronimo-jetty/src/test/java/org/apache/geronimo/jetty/ClassLoaderTest.java?view=diff&rev=449697&r1=449696&r2=449697
==============================================================================
--- geronimo/server/branches/sachin/modules/geronimo-jetty/src/test/java/org/apache/geronimo/jetty/ClassLoaderTest.java (original)
+++ geronimo/server/branches/sachin/modules/geronimo-jetty/src/test/java/org/apache/geronimo/jetty/ClassLoaderTest.java Mon Sep 25 07:58:35 2006
@@ -18,13 +18,11 @@
 package org.apache.geronimo.jetty;
 
 import java.io.File;
-import java.net.MalformedURLException;
 import java.net.URL;
 
-import org.apache.geronimo.testsupport.TestSupport;
-
 import org.apache.geronimo.kernel.config.MultiParentClassLoader;
 import org.apache.geronimo.kernel.repository.Artifact;
+import org.apache.geronimo.testsupport.TestSupport;
 
 /**
  * Tests loading various classes (as classes and URL resources) with different

Modified: geronimo/server/branches/sachin/modules/geronimo-jetty/src/test/java/org/apache/geronimo/jetty/SecurityTest.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/sachin/modules/geronimo-jetty/src/test/java/org/apache/geronimo/jetty/SecurityTest.java?view=diff&rev=449697&r1=449696&r2=449697
==============================================================================
--- geronimo/server/branches/sachin/modules/geronimo-jetty/src/test/java/org/apache/geronimo/jetty/SecurityTest.java (original)
+++ geronimo/server/branches/sachin/modules/geronimo-jetty/src/test/java/org/apache/geronimo/jetty/SecurityTest.java Mon Sep 25 07:58:35 2006
@@ -29,6 +29,7 @@
 import java.util.Iterator;
 import java.util.Map;
 import java.util.Set;
+
 import javax.security.jacc.WebResourcePermission;
 import javax.security.jacc.WebUserDataPermission;
 

Modified: geronimo/server/branches/sachin/modules/geronimo-jetty/src/test/java/org/apache/geronimo/jetty/connector/HTTPConnectorTest.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/sachin/modules/geronimo-jetty/src/test/java/org/apache/geronimo/jetty/connector/HTTPConnectorTest.java?view=diff&rev=449697&r1=449696&r2=449697
==============================================================================
--- geronimo/server/branches/sachin/modules/geronimo-jetty/src/test/java/org/apache/geronimo/jetty/connector/HTTPConnectorTest.java (original)
+++ geronimo/server/branches/sachin/modules/geronimo-jetty/src/test/java/org/apache/geronimo/jetty/connector/HTTPConnectorTest.java Mon Sep 25 07:58:35 2006
@@ -16,8 +16,8 @@
  */
 package org.apache.geronimo.jetty.connector;
 
-import java.net.UnknownHostException;
 import java.net.InetSocketAddress;
+import java.net.UnknownHostException;
 
 import junit.framework.TestCase;
 

Modified: geronimo/server/branches/sachin/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/basic/ProxyMethodInterceptor.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/sachin/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/basic/ProxyMethodInterceptor.java?view=diff&rev=449697&r1=449696&r2=449697
==============================================================================
--- geronimo/server/branches/sachin/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/basic/ProxyMethodInterceptor.java (original)
+++ geronimo/server/branches/sachin/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/basic/ProxyMethodInterceptor.java Mon Sep 25 07:58:35 2006
@@ -121,7 +121,7 @@
             }
         } catch (Exception e) {
             // this can not happen... all classes must implement equals, hashCode and toString
-            throw new AssertionError(e);
+            throw new AssertionError(new Exception("Could not install invoker for proxyType " + proxyType + " for target " + abstractName, e));
         }
 
         return invokers;

Modified: geronimo/server/branches/sachin/modules/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/AbstractNamingBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/sachin/modules/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/AbstractNamingBuilder.java?view=diff&rev=449697&r1=449696&r2=449697
==============================================================================
--- geronimo/server/branches/sachin/modules/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/AbstractNamingBuilder.java (original)
+++ geronimo/server/branches/sachin/modules/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/AbstractNamingBuilder.java Mon Sep 25 07:58:35 2006
@@ -17,28 +17,37 @@
 
 package org.apache.geronimo.naming.deployment;
 
-import java.util.Set;
-import java.util.Map;
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.Iterator;
+import java.util.Map;
+import java.util.Set;
+import java.util.Collections;
+
+import javax.xml.namespace.QName;
 
-import org.apache.xmlbeans.XmlObject;
-import org.apache.xmlbeans.QNameSet;
-import org.apache.geronimo.kernel.repository.Environment;
-import org.apache.geronimo.kernel.repository.Artifact;
-import org.apache.geronimo.kernel.config.Configuration;
-import org.apache.geronimo.gbean.AbstractNameQuery;
-import org.apache.geronimo.xbeans.geronimo.naming.GerPatternType;
 import org.apache.geronimo.common.DeploymentException;
+import org.apache.geronimo.deployment.service.EnvironmentBuilder;
+import org.apache.geronimo.gbean.AbstractNameQuery;
 import org.apache.geronimo.j2ee.deployment.Module;
 import org.apache.geronimo.j2ee.deployment.NamingBuilder;
-import org.apache.geronimo.deployment.service.EnvironmentBuilder;
+import org.apache.geronimo.kernel.config.Configuration;
+import org.apache.geronimo.kernel.repository.Artifact;
+import org.apache.geronimo.kernel.repository.Environment;
+import org.apache.geronimo.xbeans.geronimo.naming.GerPatternType;
+import org.apache.geronimo.schema.NamespaceElementConverter;
+import org.apache.xmlbeans.XmlObject;
+import org.apache.xmlbeans.SchemaType;
+import org.apache.xmlbeans.XmlCursor;
+import org.apache.xmlbeans.QNameSet;
 
 /**
- * @version $Rev:$ $Date:$
+ * @version $Rev$ $Date$
  */
 public abstract class AbstractNamingBuilder implements NamingBuilder {
+    protected static final String J2EE_NAMESPACE = "http://java.sun.com/xml/ns/j2ee";
+    protected static final String JEE_NAMESPACE = "http://java.sun.com/xml/ns/javaee";
+    protected static final NamespaceElementConverter J2EE_CONVERTER = new NamespaceElementConverter(J2EE_NAMESPACE);
 
     private final Environment defaultEnvironment;
 
@@ -63,6 +72,40 @@
     public void initContext(XmlObject specDD, XmlObject plan, Configuration localConfiguration, Configuration remoteConfiguration, Module module) throws DeploymentException {
     }
 
+    protected static QNameSet buildQNameSet(String[] eeNamespaces, String localPart) {
+        Set qnames = new HashSet(eeNamespaces.length);
+        for (int i = 0; i < eeNamespaces.length; i++) {
+            String namespace = eeNamespaces[i];
+            qnames.add(new QName(namespace, localPart));
+        }
+        //xmlbeans 2.0 has a bug so forArray doesn't work.  Don't know if it's fixed in later xmlbeans versions
+        //return QNameSet.forArray(qnames);
+        return QNameSet.forSets(null, Collections.EMPTY_SET, Collections.EMPTY_SET, qnames);
+    }
+
+    protected XmlObject[] convert(XmlObject[] xmlObjects, NamespaceElementConverter converter, SchemaType type) {
+        //bizarre ArrayStoreException if xmlObjects is loaded by the wrong classloader
+        XmlObject[] converted = new XmlObject[xmlObjects.length];
+        for (int i = 0; i < xmlObjects.length; i++) {
+            XmlObject xmlObject = xmlObjects[i];
+            if (xmlObject.schemaType() != type) {
+                xmlObject = xmlObject.copy();
+                XmlCursor start =xmlObject.newCursor();
+                XmlCursor end = xmlObject.newCursor();
+
+                try {
+                    converter.convertElement(start, end);
+                } finally {
+                    start.dispose();
+                    end.dispose();
+                }
+                converted[i] = xmlObject.changeType(type);
+            } else {
+                converted[i] = xmlObject;
+            }
+        }
+        return converted;
+    }
     protected static String getStringValue(org.apache.geronimo.xbeans.j2ee.String string) {
         if (string == null) {
             return null;

Modified: geronimo/server/branches/sachin/modules/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/ENCConfigBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/sachin/modules/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/ENCConfigBuilder.java?view=diff&rev=449697&r1=449696&r2=449697
==============================================================================
--- geronimo/server/branches/sachin/modules/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/ENCConfigBuilder.java (original)
+++ geronimo/server/branches/sachin/modules/geronimo-naming-builder/src/main/java/org/apache/geronimo/naming/deployment/ENCConfigBuilder.java Mon Sep 25 07:58:35 2006
@@ -39,9 +39,6 @@
  */
 public class ENCConfigBuilder {
 
-    private static final String JAXR_CONNECTION_FACTORY_CLASS = "javax.xml.registry.ConnectionFactory";
-
-
     public static AbstractNameQuery getGBeanQuery(String j2eeType, GerGbeanLocatorType gerGbeanLocator) {
         AbstractNameQuery abstractNameQuery;
         if (gerGbeanLocator.isSetGbeanLink()) {
@@ -56,70 +53,6 @@
         }
         //TODO check that the query is satisfied.
         return abstractNameQuery;
-    }
-
-    private static AbstractNameQuery getResourceContainerId(String name, String type, URI moduleURI, GerResourceRefType gerResourceRef) {
-        AbstractNameQuery containerId;
-        String module = moduleURI == null ? null : moduleURI.toString();
-        if (gerResourceRef == null) {
-            containerId = buildAbstractNameQuery(null, module, name, type, NameFactory.RESOURCE_ADAPTER_MODULE);
-        } else if (gerResourceRef.isSetResourceLink()) {
-            containerId = buildAbstractNameQuery(null, module, gerResourceRef.getResourceLink().trim(), type, NameFactory.RESOURCE_ADAPTER_MODULE);
-        } else {
-            //construct name from components
-            GerPatternType patternType = gerResourceRef.getPattern();
-            containerId = buildAbstractNameQuery(patternType, type, NameFactory.RESOURCE_ADAPTER_MODULE, null);
-        }
-        return containerId;
-    }
-
-    private static String getStringValue(org.apache.geronimo.xbeans.j2ee.String string) {
-        if (string == null) {
-            return null;
-        }
-        String s = string.getStringValue();
-        return s == null ? null : s.trim();
-    }
-
-    public static void setResourceEnvironment(ResourceEnvironmentBuilder builder, ResourceRefType[] resourceRefs, GerResourceRefType[] gerResourceRefs) {
-        Map refMap = mapResourceRefs(gerResourceRefs);
-        Set unshareableResources = new HashSet();
-        Set applicationManagedSecurityResources = new HashSet();
-        for (int i = 0; i < resourceRefs.length; i++) {
-            ResourceRefType resourceRefType = resourceRefs[i];
-
-            String type = resourceRefType.getResType().getStringValue().trim();
-
-            if (!URL.class.getName().equals(type)
-                    && !"javax.mail.Session".equals(type)
-                    && !JAXR_CONNECTION_FACTORY_CLASS.equals(type)) {
-
-                GerResourceRefType gerResourceRef = (GerResourceRefType) refMap.get(resourceRefType.getResRefName().getStringValue());
-                AbstractNameQuery containerId = getResourceContainerId(getStringValue(resourceRefType.getResRefName()), NameFactory.JCA_MANAGED_CONNECTION_FACTORY, null, gerResourceRef);
-
-                if ("Unshareable".equals(getStringValue(resourceRefType.getResSharingScope()))) {
-                    unshareableResources.add(containerId);
-                }
-                if ("Application".equals(getStringValue(resourceRefType.getResAuth()))) {
-                    applicationManagedSecurityResources.add(containerId);
-                }
-            }
-        }
-        builder.setUnshareableResources(unshareableResources);
-        builder.setApplicationManagedSecurityResources(applicationManagedSecurityResources);
-    }
-
-
-
-    private static Map mapResourceRefs(GerResourceRefType[] refs) {
-        Map refMap = new HashMap();
-        if (refs != null) {
-            for (int i = 0; i < refs.length; i++) {
-                GerResourceRefType ref = refs[i];
-                refMap.put(ref.getRefName().trim(), ref);
-            }
-        }
-        return refMap;
     }
 
     public static AbstractNameQuery buildAbstractNameQuery(GerPatternType pattern, String type, String moduleType, Set interfaceTypes) {

Modified: geronimo/server/branches/sachin/modules/geronimo-tomcat-builder/src/main/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/sachin/modules/geronimo-tomcat-builder/src/main/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilder.java?view=diff&rev=449697&r1=449696&r2=449697
==============================================================================
--- geronimo/server/branches/sachin/modules/geronimo-tomcat-builder/src/main/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilder.java (original)
+++ geronimo/server/branches/sachin/modules/geronimo-tomcat-builder/src/main/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilder.java Mon Sep 25 07:58:35 2006
@@ -20,13 +20,11 @@
 import java.io.File;
 import java.io.FileNotFoundException;
 import java.io.IOException;
-import java.net.MalformedURLException;
 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.Enumeration;
 import java.util.HashMap;
 import java.util.Iterator;
@@ -52,18 +50,18 @@
 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.NamingBuilder;
 import org.apache.geronimo.j2ee.deployment.WebModule;
 import org.apache.geronimo.j2ee.deployment.WebServiceBuilder;
-import org.apache.geronimo.j2ee.deployment.NamingBuilder;
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
 import org.apache.geronimo.kernel.Kernel;
 import org.apache.geronimo.kernel.Naming;
-import org.apache.geronimo.kernel.config.ConfigurationData;
 import org.apache.geronimo.kernel.config.Configuration;
+import org.apache.geronimo.kernel.config.ConfigurationData;
 import org.apache.geronimo.kernel.repository.Environment;
 import org.apache.geronimo.naming.deployment.ENCConfigBuilder;
 import org.apache.geronimo.naming.deployment.GBeanResourceEnvironmentBuilder;
-import org.apache.geronimo.schema.SchemaConversionUtils;
+import org.apache.geronimo.naming.deployment.ResourceEnvironmentSetter;
 import org.apache.geronimo.security.deploy.DefaultPrincipal;
 import org.apache.geronimo.security.deployment.SecurityConfiguration;
 import org.apache.geronimo.security.jacc.ComponentPermissions;
@@ -104,8 +102,11 @@
             AbstractNameQuery tomcatContainerName,
             Collection webServiceBuilder,
             Collection securityBuilders,
-            Collection serviceBuilders, NamingBuilder namingBuilders, Kernel kernel) {
-        super(kernel, securityBuilders, serviceBuilders, namingBuilders);
+            Collection serviceBuilders,
+            NamingBuilder namingBuilders,
+            ResourceEnvironmentSetter resourceEnvironmentSetter,
+            Kernel kernel) {
+        super(kernel, securityBuilders, serviceBuilders, namingBuilders, resourceEnvironmentSetter);
         this.defaultEnvironment = defaultEnvironment;
 
         this.tomcatContainerName = tomcatContainerName;
@@ -140,7 +141,7 @@
         try {
             // parse it
             XmlObject parsed = XmlBeansUtil.parse(specDD);
-            WebAppDocument webAppDoc = SchemaConversionUtils.convertToServletSchema(parsed);
+            WebAppDocument webAppDoc = convertToServletSchema(parsed);
             webApp = webAppDoc.getWebApp();
         } catch (XmlException xmle) {
             // Output the target path in the error to make it clearer to the user which webapp
@@ -177,14 +178,7 @@
 
         Map servletNameToPathMap = buildServletNameToPathMap(webApp, contextRoot);
 
-        //look for a webservices dd
-        Map portMap = Collections.EMPTY_MAP;
-        try {
-            URL wsDDUrl = DeploymentUtil.createJarURL(moduleFile, "WEB-INF/webservices.xml");
-            portMap = getWebServiceBuilder().parseWebServiceDescriptor(wsDDUrl, moduleFile, false, servletNameToPathMap);
-        } catch (MalformedURLException e) {
-            //no descriptor
-        }
+        Map portMap = getWebServiceBuilder().findWebServices(moduleFile, false, servletNameToPathMap);
         AbstractName moduleName;
         if (earName == null) {
             earName = naming.createRootName(environment.getConfigId(), NameFactory.NULL, NameFactory.J2EE_APPLICATION);
@@ -278,7 +272,7 @@
 
         //this may add to the web classpath with enhanced classes.
         //N.B. we use the ear context which has all the gbeans we could possibly be looking up from this ear.
-        Map compContext = buildComponentContext(earContext, webModule, webApp, tomcatWebApp, moduleClassLoader);
+        Map compContext = buildComponentContext(earContext, webModule, webApp, tomcatWebApp);
 
         GBeanData webModuleData = new GBeanData(moduleName, TomcatWebAppContext.GBEAN_INFO);
         try {
@@ -303,7 +297,7 @@
             // unsharableResources, applicationManagedSecurityResources
             GBeanResourceEnvironmentBuilder rebuilder = new GBeanResourceEnvironmentBuilder(webModuleData);
             //N.B. use earContext not moduleContext
-            ENCConfigBuilder.setResourceEnvironment(rebuilder, webApp.getResourceRefArray(), tomcatWebApp.getResourceRefArray());
+            resourceEnvironmentSetter.setResourceEnvironment(rebuilder, webApp.getResourceRefArray(), tomcatWebApp.getResourceRefArray());
 
             webModuleData.setReferencePattern("TransactionManager", earContext.getTransactionManagerName());
             webModuleData.setReferencePattern("TrackedConnectionAssociator", earContext.getConnectionTrackerName());
@@ -445,7 +439,7 @@
     }
 
 
-    private Map buildComponentContext(EARContext earContext, Module webModule, WebAppType webApp, TomcatWebAppType tomcatWebApp, ClassLoader cl) throws DeploymentException {
+    private Map buildComponentContext(EARContext earContext, Module webModule, WebAppType webApp, TomcatWebAppType tomcatWebApp) throws DeploymentException {
         Map componentContext = new HashMap();
         Configuration earConfiguration = earContext.getConfiguration();
         getNamingBuilders().buildNaming(webApp, tomcatWebApp, earConfiguration, earConfiguration, webModule, componentContext);
@@ -462,6 +456,7 @@
         infoBuilder.addReference("SecurityBuilders", NamespaceDrivenBuilder.class, NameFactory.MODULE_BUILDER);
         infoBuilder.addReference("ServiceBuilders", NamespaceDrivenBuilder.class, NameFactory.MODULE_BUILDER);
         infoBuilder.addReference("NamingBuilders", NamingBuilder.class, NameFactory.MODULE_BUILDER);
+        infoBuilder.addReference("ResourceEnvironmentSetter", ResourceEnvironmentSetter.class, NameFactory.MODULE_BUILDER);
         infoBuilder.addAttribute("kernel", Kernel.class, false);
         infoBuilder.addInterface(ModuleBuilder.class);
 
@@ -472,6 +467,7 @@
                 "SecurityBuilders",
                 "ServiceBuilders",
                 "NamingBuilders",
+                "ResourceEnvironmentSetter",
                 "kernel"});
         GBEAN_INFO = infoBuilder.getBeanInfo();
     }

Modified: geronimo/server/branches/sachin/modules/geronimo-tomcat-builder/src/test/java/org/apache/geronimo/tomcat/deployment/PlanParsingTest.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/sachin/modules/geronimo-tomcat-builder/src/test/java/org/apache/geronimo/tomcat/deployment/PlanParsingTest.java?view=diff&rev=449697&r1=449696&r2=449697
==============================================================================
--- geronimo/server/branches/sachin/modules/geronimo-tomcat-builder/src/test/java/org/apache/geronimo/tomcat/deployment/PlanParsingTest.java (original)
+++ geronimo/server/branches/sachin/modules/geronimo-tomcat-builder/src/test/java/org/apache/geronimo/tomcat/deployment/PlanParsingTest.java Mon Sep 25 07:58:35 2006
@@ -23,6 +23,9 @@
 import org.apache.geronimo.xbeans.geronimo.web.GerWebAppType;
 import org.apache.geronimo.xbeans.geronimo.web.tomcat.TomcatWebAppType;
 import org.apache.geronimo.security.deployment.GeronimoSecurityBuilderImpl;
+import org.apache.geronimo.naming.deployment.ResourceEnvironmentSetter;
+import org.apache.geronimo.naming.deployment.ResourceEnvironmentBuilder;
+import org.apache.xmlbeans.XmlObject;
 
 /**
  */
@@ -38,7 +41,7 @@
     private TomcatModuleBuilder builder;
 
     protected void setUp() throws Exception {
-        builder = new TomcatModuleBuilder(defaultEnvironment, tomcatContainerObjectName, Collections.singleton(webServiceBuilder), Collections.singleton(new GeronimoSecurityBuilderImpl()), Collections.singleton(new GBeanBuilder(null, null)), new NamingBuilderCollection(null, null), null);
+        builder = new TomcatModuleBuilder(defaultEnvironment, tomcatContainerObjectName, Collections.singleton(webServiceBuilder), Collections.singleton(new GeronimoSecurityBuilderImpl()), Collections.singleton(new GBeanBuilder(null, null)), new NamingBuilderCollection(null, null), new MockResourceEnvironmentSetter(), null);
     }
 
     public void testResourceRef() throws Exception {

Modified: geronimo/server/branches/sachin/modules/geronimo-tomcat-builder/src/test/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilderTest.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/sachin/modules/geronimo-tomcat-builder/src/test/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilderTest.java?view=diff&rev=449697&r1=449696&r2=449697
==============================================================================
--- geronimo/server/branches/sachin/modules/geronimo-tomcat-builder/src/test/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilderTest.java (original)
+++ geronimo/server/branches/sachin/modules/geronimo-tomcat-builder/src/test/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilderTest.java Mon Sep 25 07:58:35 2006
@@ -316,7 +316,7 @@
 
         defaultEnvironment.addDependency(baseId, ImportType.ALL);
         defaultEnvironment.setConfigId(webModuleArtifact);
-        builder = new TomcatModuleBuilder(defaultEnvironment, new AbstractNameQuery(containerName), Collections.singleton(webServiceBuilder), Collections.singleton(new GeronimoSecurityBuilderImpl()), Collections.singleton(new GBeanBuilder(null, null)), new NamingBuilderCollection(null, null), null);
+        builder = new TomcatModuleBuilder(defaultEnvironment, new AbstractNameQuery(containerName), Collections.singleton(webServiceBuilder), Collections.singleton(new GeronimoSecurityBuilderImpl()), Collections.singleton(new GBeanBuilder(null, null)), new NamingBuilderCollection(null, null), new MockResourceEnvironmentSetter(), null);
     }
 
     protected void tearDown() throws Exception {

Modified: geronimo/server/branches/sachin/modules/geronimo-tomcat/src/main/java/org/apache/geronimo/tomcat/ConnectorGBean.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/sachin/modules/geronimo-tomcat/src/main/java/org/apache/geronimo/tomcat/ConnectorGBean.java?view=diff&rev=449697&r1=449696&r2=449697
==============================================================================
--- geronimo/server/branches/sachin/modules/geronimo-tomcat/src/main/java/org/apache/geronimo/tomcat/ConnectorGBean.java (original)
+++ geronimo/server/branches/sachin/modules/geronimo-tomcat/src/main/java/org/apache/geronimo/tomcat/ConnectorGBean.java Mon Sep 25 07:58:35 2006
@@ -163,7 +163,7 @@
                     host = "unknown-host";
                 }
                 if(address != null) {
-                    host = address.getHostName();
+                    host = address.getCanonicalHostName();
                     if(host == null || host.equals("")) {
                         host = address.getHostAddress();
                     }



Mime
View raw message