geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject cvs commit: incubator-geronimo/modules/jetty/src/test/org/apache/geronimo/jetty ApplicationTest.java
Date Sun, 18 Jul 2004 22:04:27 GMT
djencks     2004/07/18 15:04:27

  Modified:    modules/connector/src/java/org/apache/geronimo/connector/deployment
                        ConnectorModuleBuilder.java
               modules/deployment project.xml
               modules/j2ee/src/java/org/apache/geronimo/j2ee/deployment
                        EARConfigBuilder.java EARContext.java
                        ModuleBuilder.java
               modules/j2ee/src/test/org/apache/geronimo/j2ee/deployment
                        EARConfigBuilderTest.java EARContextTest.java
                        MockConnectorConfigBuilder.java
                        MockEJBConfigBuilder.java MockWARConfigBuilder.java
               modules/jetty/src/java/org/apache/geronimo/jetty
                        JettyWebAppContext.java JettyWebAppJACCContext.java
               modules/jetty/src/java/org/apache/geronimo/jetty/deployment
                        JettyModuleBuilder.java
               modules/jetty/src/test/org/apache/geronimo/jetty
                        ApplicationTest.java
  Log:
  Make non-ear j2ee modules deploy with external plans and adapt classes to use TransactionContextManager.  Also includes some modifications for ejb timer impl.
  
  Revision  Changes    Path
  1.9       +29 -22    incubator-geronimo/modules/connector/src/java/org/apache/geronimo/connector/deployment/ConnectorModuleBuilder.java
  
  Index: ConnectorModuleBuilder.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/connector/src/java/org/apache/geronimo/connector/deployment/ConnectorModuleBuilder.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- ConnectorModuleBuilder.java	15 Jul 2004 17:00:42 -0000	1.8
  +++ ConnectorModuleBuilder.java	18 Jul 2004 22:04:26 -0000	1.9
  @@ -90,14 +90,23 @@
   import org.apache.geronimo.xbeans.j2ee.connector_1_0.ConnectorDocument10;
   import org.apache.geronimo.xbeans.j2ee.connector_1_0.ConnectorType10;
   import org.apache.geronimo.xbeans.j2ee.connector_1_0.ResourceadapterType10;
  +import org.apache.geronimo.schema.SchemaConversionUtils;
   import org.apache.xmlbeans.XmlException;
   import org.apache.xmlbeans.XmlObject;
   import org.apache.xmlbeans.XmlOptions;
  +import org.apache.xmlbeans.SchemaTypeLoader;
  +import org.apache.xmlbeans.XmlBeans;
   
   /**
    * @version $Revision$ $Date$
    */
   public class ConnectorModuleBuilder implements ModuleBuilder {
  +
  +    private static final SchemaTypeLoader SCHEMA_TYPE_LOADER = XmlBeans.typeLoaderUnion(new SchemaTypeLoader[]{
  +        XmlBeans.typeLoaderForClassLoader(org.apache.geronimo.xbeans.j2ee.String.class.getClassLoader()),
  +        XmlBeans.typeLoaderForClassLoader(GerConnectorDocument.class.getClassLoader())
  +    });
  +
       private static final String BASE_REALM_BRIDGE_NAME = "geronimo.security:service=RealmBridge,name=";
       private static final String BASE_PASSWORD_CREDENTIAL_LOGIN_MODULE_NAME = "geronimo.security:service=Realm,type=PasswordCredential,name=";
       private static final String BASE_WORK_MANAGER_NAME = "geronimo.server:type=WorkManager,name=";
  @@ -114,24 +123,28 @@
               if (plan == null) {
                   return null;
               }
  -            return plan.getConnector();
  +            return plan;
           } catch (MalformedURLException e) {
               return null;
           }
       }
   
       public boolean canHandlePlan(XmlObject plan) {
  -        return plan instanceof GerConnectorType;
  +        return plan instanceof GerConnectorDocument;
       }
   
       public Module createModule(String name, XmlObject plan) throws DeploymentException {
  +        if (!canHandlePlan(plan)) {
  +            throw new DeploymentException("Wrong kind of plan");
  +        }
           ConnectorModule module = new ConnectorModule(name, URI.create("/"));
  -        module.setVendorDD(plan);
  +        GerConnectorType gerConnector = ((GerConnectorDocument) plan).getConnector();
  +        module.setVendorDD(gerConnector);
           return module;
       }
   
       public URI getParentId(XmlObject plan) throws DeploymentException {
  -        GerConnectorType geronimoConnector = (GerConnectorType) plan;
  +        GerConnectorType geronimoConnector = ((GerConnectorDocument) plan).getConnector();
           URI parentID;
           if (geronimoConnector.isSetParentId()) {
               try {
  @@ -146,7 +159,7 @@
       }
   
       public URI getConfigId(XmlObject plan) throws DeploymentException {
  -        GerConnectorType geronimoConnector = (GerConnectorType) plan;
  +        GerConnectorType geronimoConnector = ((GerConnectorDocument) plan).getConnector();
           URI configID;
           try {
               configID = new URI(geronimoConnector.getConfigId());
  @@ -170,7 +183,7 @@
               }
   
               XmlObject specConnnector = null;
  -            GerConnectorType vendorConnector = null;
  +            GerConnectorType vendorConnector = (GerConnectorType) module.getVendorDD();
               for (JarEntry entry; (entry = jarIS.getNextJarEntry()) != null; jarIS.closeEntry()) {
                   String name = entry.getName();
                   URI target = moduleBase.resolve(name);
  @@ -183,28 +196,28 @@
                       try {
                           // try 1.0
                           ConnectorDocument10 connectorDoc = ConnectorDocument10.Factory.parse(new ByteArrayInputStream(buffer));
  -                        validateDD(connectorDoc);
  +                        SchemaConversionUtils.validateDD(connectorDoc);
                           specConnnector = connectorDoc.getConnector();
                       } catch (XmlException ignore) {
                           // that didn't work try 1.5
                           try {
                               ConnectorDocument connectorDoc = ConnectorDocument.Factory.parse(new ByteArrayInputStream(buffer));
  -                            validateDD(connectorDoc);
  +                            SchemaConversionUtils.validateDD(connectorDoc);
                               specConnnector = connectorDoc.getConnector();
                           } catch (XmlException alsoIgnore) {
                               throw new DeploymentException("Could not parse META-INF/ra.xml");
                           }
                       }
  -                } else if (name.equals("META-INF/geronimo-ra.xml")) {
  +                } else if (module.getVendorDD() == null && name.equals("META-INF/geronimo-ra.xml")) {
                       byte[] buffer = getBytes(jarIS);
                       earContext.addFile(target, new ByteArrayInputStream(buffer));
                       GerConnectorDocument vendorConnectorDoc;
                       try {
                           vendorConnectorDoc = GerConnectorDocument.Factory.parse(new ByteArrayInputStream(buffer));
  +                        SchemaConversionUtils.validateDD(vendorConnectorDoc);
                       } catch (XmlException e) {
                           throw new DeploymentException("Unable to parse geronimo-ra.xml");
                       }
  -                    validateDD(vendorConnectorDoc);
                       vendorConnector = vendorConnectorDoc.getConnector();
                   } else if (name.endsWith(".jar")) {
                       earContext.addStreamInclude(target, jarIS);
  @@ -233,16 +246,6 @@
           }
       }
   
  -    private void validateDD(XmlObject dd) throws DeploymentException {
  -        XmlOptions xmlOptions = new XmlOptions();
  -        xmlOptions.setLoadLineNumbers();
  -        Collection errors = new ArrayList();
  -        xmlOptions.setErrorListener(errors);
  -        if (!dd.validate(xmlOptions)) {
  -            throw new DeploymentException("Invalid deployment descriptor: errors: " + errors);
  -        }
  -    }
  -
       public void initContext(EARContext earContext, Module module, ClassLoader cl) throws DeploymentException {
           // connectors do not add anything to the shared context
           //TODO should the 1.5 ActivationSpecInfos be processed here?
  @@ -265,6 +268,10 @@
           }
       }
   
  +    public SchemaTypeLoader getSchemaTypeLoader() {
  +        return SCHEMA_TYPE_LOADER;
  +    }
  +
       private void addResourceAdapterModuleGBean(EARContext earContext, Module module, ClassLoader cl) throws DeploymentException {
           // build the objectName
           Properties nameProps = new Properties();
  @@ -383,7 +390,7 @@
                   connectionDefinitions.put(connectionDefinition.getConnectionfactoryInterface().getStringValue(), connectionDefinition);
               }
   
  -        // ManagedConnectionFactory setup
  +            // ManagedConnectionFactory setup
               if (geronimoResourceAdapter.isSetOutboundResourceadapter()) {
                   for (int i = 0; i < geronimoResourceAdapter.getOutboundResourceadapter().getConnectionDefinitionArray().length; i++) {
                       GerConnectionDefinitionType geronimoConnectionDefinition = geronimoResourceAdapter.getOutboundResourceadapter().getConnectionDefinitionArray(i);
  
  
  
  1.21      +10 -4     incubator-geronimo/modules/deployment/project.xml
  
  Index: project.xml
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/deployment/project.xml,v
  retrieving revision 1.20
  retrieving revision 1.21
  diff -u -r1.20 -r1.21
  --- project.xml	24 Jun 2004 20:59:46 -0000	1.20
  +++ project.xml	18 Jul 2004 22:04:26 -0000	1.21
  @@ -6,16 +6,16 @@
       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.
   -->
  -  
  +
   
   <!-- $Revision$ $Date$ -->
   
  @@ -78,6 +78,12 @@
               <groupId>geronimo-spec</groupId>
               <artifactId>geronimo-spec-j2ee-deployment</artifactId>
               <version>1.1-rc2</version>
  +        </dependency>
  +
  +        <dependency>
  +            <groupId>geronimo-spec</groupId>
  +            <artifactId>geronimo-spec-j2eeschema</artifactId>
  +            <version>${pom.currentVersion}</version>
           </dependency>
   
           <dependency>
  
  
  
  1.13      +84 -32    incubator-geronimo/modules/j2ee/src/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder.java
  
  Index: EARConfigBuilder.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/j2ee/src/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- EARConfigBuilder.java	6 Jul 2004 17:19:14 -0000	1.12
  +++ EARConfigBuilder.java	18 Jul 2004 22:04:27 -0000	1.13
  @@ -31,11 +31,14 @@
   import java.util.Iterator;
   import java.util.Set;
   import java.util.LinkedHashSet;
  +import java.util.ArrayList;
  +import java.util.List;
   import java.util.jar.JarEntry;
   import java.util.jar.JarFile;
   import java.util.jar.JarOutputStream;
   import java.util.jar.Manifest;
   import java.util.zip.ZipEntry;
  +
   import javax.management.MalformedObjectNameException;
   import javax.management.ObjectName;
   
  @@ -66,6 +69,13 @@
    * @version $Revision$ $Date$
    */
   public class EARConfigBuilder implements ConfigurationBuilder {
  +    static final SchemaTypeLoader SCHEMA_TYPE_LOADER = XmlBeans.typeLoaderUnion(new SchemaTypeLoader[] {
  +        XmlBeans.typeLoaderForClassLoader(org.apache.geronimo.xbeans.j2ee.String.class.getClassLoader()),
  +        XmlBeans.typeLoaderForClassLoader(GerApplicationDocument.class.getClassLoader())
  +    });
  +
  +
  +
       private static final String PARENT_ID = "org/apache/geronimo/Server";
   
       private final Kernel kernel;
  @@ -76,12 +86,15 @@
       private final String j2eeServerName;
       private final String j2eeDomainName;
       private final ObjectName j2eeServer;
  -    private final ObjectName transactionManagerObjectName;
  +    private final ObjectName transactionContextManagerObjectName;
       private final ObjectName connectionTrackerObjectName;
  +    private final ObjectName transactionalTimerObjectName;
  +    private final ObjectName nonTransactionalTimerObjectName;
   
   
  -    public EARConfigBuilder(Kernel kernel, Repository repository, ObjectName j2eeServer, ModuleBuilder ejbConfigBuilder, ModuleBuilder webConfigBuilder, ModuleBuilder connectorConfigBuilder,
  -                            ObjectName transactionManagerObjectName, ObjectName connectionTrackerObjectName) {
  +    public EARConfigBuilder(
  +            ObjectName j2eeServer, ObjectName transactionContextManagerObjectName, ObjectName connectionTrackerObjectName, ObjectName transactionalTimerObjectName, ObjectName nonTransactionalTimerObjectName, Repository repository, ModuleBuilder ejbConfigBuilder, ModuleBuilder webConfigBuilder, ModuleBuilder connectorConfigBuilder, Kernel kernel
  +            ) {
           this.kernel = kernel;
           this.repository = repository;
           this.j2eeServer = j2eeServer;
  @@ -91,16 +104,41 @@
           this.ejbConfigBuilder = ejbConfigBuilder;
           this.webConfigBuilder = webConfigBuilder;
           this.connectorConfigBuilder = connectorConfigBuilder;
  -        this.transactionManagerObjectName = transactionManagerObjectName;
  +        this.transactionContextManagerObjectName = transactionContextManagerObjectName;
           this.connectionTrackerObjectName = connectionTrackerObjectName;
  +        this.transactionalTimerObjectName = transactionalTimerObjectName;
  +        this.nonTransactionalTimerObjectName = nonTransactionalTimerObjectName;
       }
   
       public boolean canConfigure(XmlObject plan) {
  -        return plan instanceof ApplicationDocument;
  +        if (plan instanceof GerApplicationDocument) {
  +            return true;
  +        }
  +        if (connectorConfigBuilder != null && connectorConfigBuilder.canHandlePlan(plan)) {
  +            return true;
  +        }
  +        if (ejbConfigBuilder != null && ejbConfigBuilder.canHandlePlan(plan)) {
  +            return true;
  +        }
  +        if (webConfigBuilder != null && webConfigBuilder.canHandlePlan(plan)) {
  +            return true;
  +        }
  +        return false;
       }
   
       public SchemaTypeLoader[] getTypeLoaders() {
  -        return new SchemaTypeLoader[]{XmlBeans.getContextTypeLoader()};
  +        List typeLoaders = new ArrayList();
  +        typeLoaders.add(SCHEMA_TYPE_LOADER);
  +        if (connectorConfigBuilder != null) {
  +            typeLoaders.add(connectorConfigBuilder.getSchemaTypeLoader());
  +        }
  +        if (ejbConfigBuilder != null) {
  +            typeLoaders.add(ejbConfigBuilder.getSchemaTypeLoader());
  +        }
  +        if (webConfigBuilder != null) {
  +            typeLoaders.add(webConfigBuilder.getSchemaTypeLoader());
  +        }
  +        return (SchemaTypeLoader[])typeLoaders.toArray(new SchemaTypeLoader[typeLoaders.size()]);
       }
   
       public XmlObject getDeploymentPlan(URL module) throws XmlException {
  @@ -114,11 +152,11 @@
               }
               GerApplicationDocument gerAppDoc = (GerApplicationDocument) XmlBeansUtil.getXmlObject(new URL(moduleBase, "META-INF/geronimo-application.xml"), GerApplicationDocument.type);
               if (gerAppDoc != null) {
  -                return gerAppDoc.getApplication();
  +                return gerAppDoc;
               }
   
               // try to create a default plan (will return null if this is not an ear file)
  -            GerApplicationType defaultPlan = createDefaultPlan(moduleBase);
  +            GerApplicationDocument defaultPlan = createDefaultPlan(moduleBase);
               if (defaultPlan != null) {
                   return defaultPlan;
               }
  @@ -150,7 +188,7 @@
           return null;
       }
   
  -    private GerApplicationType createDefaultPlan(URL moduleBase) throws XmlException {
  +    private GerApplicationDocument createDefaultPlan(URL moduleBase) throws XmlException {
           // load the web.xml
           URL applicationXmlUrl = null;
           try {
  @@ -164,7 +202,8 @@
           }
   
           // construct the empty geronimo-application.xml
  -        GerApplicationType gerApplication = GerApplicationType.Factory.newInstance();
  +        GerApplicationDocument gerApplicationDocument = GerApplicationDocument.Factory.newInstance();
  +        GerApplicationType gerApplication = gerApplicationDocument.addNewApplication();
   
           // set the parentId and configId
           gerApplication.setParentId(PARENT_ID);
  @@ -172,16 +211,16 @@
           if (id == null) {
               id = moduleBase.getFile();
               if (id.endsWith("!/")) {
  -                id = id.substring(0, id.length()-2);
  +                id = id.substring(0, id.length() - 2);
               }
               if (id.endsWith(".ear")) {
  -                id = id.substring(0, id.length()-4);
  +                id = id.substring(0, id.length() - 4);
               }
               id = id.substring(id.lastIndexOf('/') + 1);
           }
   
           gerApplication.setConfigId(id);
  -        return gerApplication;
  +        return gerApplicationDocument;
       }
   
   
  @@ -227,8 +266,10 @@
                           j2eeDomainName,
                           j2eeServerName,
                           applicationName,
  -                        transactionManagerObjectName,
  -                        connectionTrackerObjectName);
  +                        transactionContextManagerObjectName,
  +                        connectionTrackerObjectName,
  +                        transactionalTimerObjectName,
  +                        nonTransactionalTimerObjectName);
               } catch (MalformedObjectNameException e) {
                   throw new DeploymentException(e);
               }
  @@ -244,8 +285,9 @@
               }
   
               // add dependencies declared in the geronimo-application.xml
  -            if (plan instanceof GerApplicationType) {
  -                GerApplicationType geronimoApplication = (GerApplicationType) plan;
  +            if (plan instanceof GerApplicationDocument) {
  +                GerApplicationDocument applicationDoc = (GerApplicationDocument) plan;
  +                GerApplicationType geronimoApplication = applicationDoc.getApplication();
                   GerDependencyType[] dependencies = geronimoApplication.getDependencyArray();
                   for (int i = 0; i < dependencies.length; i++) {
                       earContext.addDependency(getDependencyURI(dependencies[i]));
  @@ -266,8 +308,9 @@
               }
   
               // add gbeans declared in the geronimo-application.xml
  -            if (plan instanceof GerApplicationType) {
  -                GerApplicationType geronimoApplication = (GerApplicationType) plan;
  +            if (plan instanceof GerApplicationDocument) {
  +                GerApplicationDocument applicationDoc = (GerApplicationDocument) plan;
  +                GerApplicationType geronimoApplication = applicationDoc.getApplication();
                   GerGbeanType[] gbeans = geronimoApplication.getGbeanArray();
                   for (int i = 0; i < gbeans.length; i++) {
                       GBeanHelper.addGbean(new GerGBeanAdapter(gbeans[i]), cl, earContext);
  @@ -307,7 +350,7 @@
   
       private ApplicationType addModules(URI configId, XmlObject plan, JarFile earFile, Set moduleLocations, Set modules) throws DeploymentException, IOException {
           ApplicationType application;
  -        if (plan instanceof GerApplicationType) {
  +        if (plan instanceof GerApplicationDocument) {
               try {
                   JarEntry appXMLEntry = earFile.getJarEntry("META-INF/application.xml");
                   if (appXMLEntry == null) {
  @@ -385,8 +428,9 @@
       }
   
       private URI getParentId(XmlObject plan) throws DeploymentException {
  -        if (plan instanceof GerApplicationType) {
  -            GerApplicationType application = (GerApplicationType) plan;
  +        if (plan instanceof GerApplicationDocument) {
  +            GerApplicationDocument applicationDoc = (GerApplicationDocument) plan;
  +            GerApplicationType application = applicationDoc.getApplication();
               if (application.isSetParentId()) {
                   try {
                       return new URI(application.getParentId());
  @@ -420,8 +464,9 @@
       }
   
       private URI getConfigId(XmlObject plan) throws DeploymentException {
  -        if (plan instanceof GerApplicationType) {
  -            GerApplicationType application = (GerApplicationType) plan;
  +        if (plan instanceof GerApplicationDocument) {
  +            GerApplicationDocument applicationDoc = (GerApplicationDocument) plan;
  +            GerApplicationType application = applicationDoc.getApplication();
               try {
                   return new URI(application.getConfigId());
               } catch (URISyntaxException e) {
  @@ -474,26 +519,33 @@
   
       static {
           GBeanInfoFactory infoFactory = new GBeanInfoFactory(EARConfigBuilder.class);
  -        infoFactory.addAttribute("kernel", Kernel.class, false);
  -        infoFactory.addAttribute("transactionManagerObjectName", ObjectName.class, true);
  +        infoFactory.addAttribute("j2eeServer", ObjectName.class, true);
  +        infoFactory.addAttribute("transactionContextManagerObjectName", ObjectName.class, true);
           infoFactory.addAttribute("connectionTrackerObjectName", ObjectName.class, true);
  +        infoFactory.addAttribute("transactionalTimerObjectName", ObjectName.class, true);
  +        infoFactory.addAttribute("nonTransactionalTimerObjectName", ObjectName.class, true);
  +
           infoFactory.addReference("Repository", Repository.class);
  -        infoFactory.addAttribute("j2eeServer", ObjectName.class, true);
           infoFactory.addReference("EJBConfigBuilder", ModuleBuilder.class);
           infoFactory.addReference("WebConfigBuilder", ModuleBuilder.class);
           infoFactory.addReference("ConnectorConfigBuilder", ModuleBuilder.class);
   
  +        infoFactory.addAttribute("kernel", Kernel.class, false);
  +
           infoFactory.addInterface(ConfigurationBuilder.class);
   
           infoFactory.setConstructor(new String[]{
  -            "kernel",
  -            "Repository",
               "j2eeServer",
  +            "transactionContextManagerObjectName",
  +            "connectionTrackerObjectName",
  +            "transactionalTimerObjectName",
  +            "nonTransactionalTimerObjectName",
  +            "Repository",
               "EJBConfigBuilder",
               "WebConfigBuilder",
               "ConnectorConfigBuilder",
  -            "transactionManagerObjectName",
  -            "connectionTrackerObjectName"});
  +            "kernel"
  +        });
   
           GBEAN_INFO = infoFactory.getBeanInfo();
       }
  
  
  
  1.6       +19 -7     incubator-geronimo/modules/j2ee/src/java/org/apache/geronimo/j2ee/deployment/EARContext.java
  
  Index: EARContext.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/j2ee/src/java/org/apache/geronimo/j2ee/deployment/EARContext.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- EARContext.java	6 Jul 2004 17:19:14 -0000	1.5
  +++ EARContext.java	18 Jul 2004 22:04:27 -0000	1.6
  @@ -45,10 +45,13 @@
       private final ObjectName serverObjectName;
       private final ObjectName applicationObjectName;
   
  -    private final ObjectName transactionManagerObjectName;
  +    private final ObjectName transactionContextManagerObjectName;
       private final ObjectName connectionTrackerObjectName;
   
  -    public EARContext(JarOutputStream jos, URI id, URI parentID, Kernel kernel, String j2eeDomainName, String j2eeServerName, String j2eeApplicationName, ObjectName transactionManagerObjectName, ObjectName connectionTrackerObjectName) throws MalformedObjectNameException, DeploymentException {
  +    private final ObjectName transactedTimerName;
  +    private final ObjectName nonTransactedTimerName;
  +
  +    public EARContext(JarOutputStream jos, URI id, URI parentID, Kernel kernel, String j2eeDomainName, String j2eeServerName, String j2eeApplicationName, ObjectName transactionContextManagerObjectName, ObjectName connectionTrackerObjectName, ObjectName transactedTimerName, ObjectName nonTransactedTimerName) throws MalformedObjectNameException, DeploymentException {
           super(jos, id, parentID, kernel);
           this.j2eeDomainName = j2eeDomainName;
           this.j2eeServerName = j2eeServerName;
  @@ -89,9 +92,10 @@
           } else {
               applicationObjectName = null;
           }
  -        this.transactionManagerObjectName = transactionManagerObjectName;
  +        this.transactionContextManagerObjectName = transactionContextManagerObjectName;
           this.connectionTrackerObjectName = connectionTrackerObjectName;
  -
  +        this.transactedTimerName = transactedTimerName;
  +        this.nonTransactedTimerName = nonTransactedTimerName;
       }
   
       public String getJ2EEDomainName() {
  @@ -118,12 +122,20 @@
           return applicationObjectName;
       }
   
  -    public ObjectName getTransactionManagerObjectName() {
  -        return transactionManagerObjectName;
  +    public ObjectName getTransactionContextManagerObjectName() {
  +        return transactionContextManagerObjectName;
       }
   
       public ObjectName getConnectionTrackerObjectName() {
           return connectionTrackerObjectName;
  +    }
  +
  +    public ObjectName getTransactedTimerName() {
  +        return transactedTimerName;
  +    }
  +
  +    public ObjectName getNonTransactedTimerName() {
  +        return nonTransactedTimerName;
       }
   
       public void addEJBRef(URI modulePath, String name, Object reference) throws DeploymentException {
  
  
  
  1.2       +4 -1      incubator-geronimo/modules/j2ee/src/java/org/apache/geronimo/j2ee/deployment/ModuleBuilder.java
  
  Index: ModuleBuilder.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/j2ee/src/java/org/apache/geronimo/j2ee/deployment/ModuleBuilder.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ModuleBuilder.java	19 May 2004 20:53:59 -0000	1.1
  +++ ModuleBuilder.java	18 Jul 2004 22:04:27 -0000	1.2
  @@ -23,6 +23,7 @@
   import org.apache.geronimo.deployment.DeploymentException;
   import org.apache.xmlbeans.XmlException;
   import org.apache.xmlbeans.XmlObject;
  +import org.apache.xmlbeans.SchemaTypeLoader;
   
   /**
    * @version $Revision$ $Date$
  @@ -43,4 +44,6 @@
       void initContext(EARContext earContext, Module module, ClassLoader cl) throws DeploymentException;
   
       void addGBeans(EARContext earContext, Module module, ClassLoader cl) throws DeploymentException;
  +
  +    SchemaTypeLoader getSchemaTypeLoader();
   }
  
  
  
  1.4       +12 -9     incubator-geronimo/modules/j2ee/src/test/org/apache/geronimo/j2ee/deployment/EARConfigBuilderTest.java
  
  Index: EARConfigBuilderTest.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/j2ee/src/test/org/apache/geronimo/j2ee/deployment/EARConfigBuilderTest.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- EARConfigBuilderTest.java	23 Jun 2004 21:58:22 -0000	1.3
  +++ EARConfigBuilderTest.java	18 Jul 2004 22:04:27 -0000	1.4
  @@ -60,15 +60,18 @@
    * @version $Revision$ $Date$
    */
   public class EARConfigBuilderTest extends TestCase {
  -    private static final ObjectName j2eeServer = JMXUtil.getObjectName("someDomain:j2eeType=J2EEServer,name=J2EEServerName");
  -    private static final ObjectName transactionManagerObjectName = JMXUtil.getObjectName("someDomain:type=TransactionManager");
  -    private static final ObjectName connectionTrackerObjectName = JMXUtil.getObjectName("someDomain:type=ConnectionTracker");
  +    private static final String j2eeServerName = "someDomain";
  +    private static final ObjectName j2eeServer = JMXUtil.getObjectName(j2eeServerName + ":j2eeType=J2EEServer,name=J2EEServerName");
  +    private static final ObjectName transactionManagerObjectName = JMXUtil.getObjectName(j2eeServerName + ":type=TransactionManager");
  +    private static final ObjectName connectionTrackerObjectName = JMXUtil.getObjectName(j2eeServerName + ":type=ConnectionTracker");
  +    private static final ObjectName transactionalTimerObjectName = JMXUtil.getObjectName(j2eeServerName + ":type=ThreadPooledTimer,name=TransactionalThreaPooledTimer");
  +    private static final ObjectName nonTransactionalTimerObjectName = JMXUtil.getObjectName(j2eeServerName + ":type=ThreadPooledTimer,name=NonTransactionalThreaPooledTimer");
   
       public void testBuildConfiguration() throws Exception {
           MockEJBConfigBuilder ejbConfigBuilder = new MockEJBConfigBuilder();
           MockWARConfigBuilder webConfigBuilder = new MockWARConfigBuilder();
           MockConnectorConfigBuilder connectorConfigBuilder = new MockConnectorConfigBuilder();
  -        EARConfigBuilder configBuilder = new EARConfigBuilder(null, null, j2eeServer, ejbConfigBuilder, webConfigBuilder, connectorConfigBuilder, transactionManagerObjectName, connectionTrackerObjectName);
  +        EARConfigBuilder configBuilder = new EARConfigBuilder(j2eeServer, transactionManagerObjectName, connectionTrackerObjectName, transactionalTimerObjectName, nonTransactionalTimerObjectName, null, ejbConfigBuilder, webConfigBuilder, connectorConfigBuilder, null);
           File earFile = new File("target/test-ear.ear");
   
           File carFile = File.createTempFile("EARTest", ".car");
  @@ -89,7 +92,7 @@
           MockEJBConfigBuilder ejbConfigBuilder = new MockEJBConfigBuilder();
           MockWARConfigBuilder webConfigBuilder = new MockWARConfigBuilder();
           MockConnectorConfigBuilder connectorConfigBuilder = new MockConnectorConfigBuilder();
  -        EARConfigBuilder configBuilder = new EARConfigBuilder(null, null, j2eeServer, ejbConfigBuilder, webConfigBuilder, connectorConfigBuilder, transactionManagerObjectName, connectionTrackerObjectName);
  +        EARConfigBuilder configBuilder = new EARConfigBuilder(j2eeServer, transactionManagerObjectName, connectionTrackerObjectName, transactionalTimerObjectName, nonTransactionalTimerObjectName, null, ejbConfigBuilder, webConfigBuilder, connectorConfigBuilder, null);
           File earFile = new File("target/test-naked-ear.ear");
   
           File carFile = File.createTempFile("EARTest", ".car");
  @@ -109,7 +112,7 @@
       public void testNoEJBDeployer() throws Exception {
           MockWARConfigBuilder warConfigBuilder = new MockWARConfigBuilder();
           MockConnectorConfigBuilder connectorConfigBuilder = new MockConnectorConfigBuilder();
  -        EARConfigBuilder configBuilder = new EARConfigBuilder(null, null, j2eeServer, null, warConfigBuilder, connectorConfigBuilder, transactionManagerObjectName, connectionTrackerObjectName);
  +        EARConfigBuilder configBuilder = new EARConfigBuilder(j2eeServer, transactionManagerObjectName, connectionTrackerObjectName, transactionalTimerObjectName, nonTransactionalTimerObjectName, null, null, warConfigBuilder, connectorConfigBuilder, null);
           File earFile = new File("target/test-ear.ear");
   
           File carFile = File.createTempFile("EARTest", ".car");
  @@ -127,7 +130,7 @@
       public void testNoWARDeployer() throws Exception {
           MockEJBConfigBuilder ejbConfigBuilder = new MockEJBConfigBuilder();
           MockConnectorConfigBuilder connectorConfigBuilder = new MockConnectorConfigBuilder();
  -        EARConfigBuilder configBuilder = new EARConfigBuilder(null, null, j2eeServer, ejbConfigBuilder, null, connectorConfigBuilder, transactionManagerObjectName, connectionTrackerObjectName);
  +        EARConfigBuilder configBuilder = new EARConfigBuilder(j2eeServer, transactionManagerObjectName, connectionTrackerObjectName, transactionalTimerObjectName, nonTransactionalTimerObjectName, null, ejbConfigBuilder, null, connectorConfigBuilder, null);
           File earFile = new File("target/test-ear.ear");
   
           File carFile = File.createTempFile("EARTest", ".car");
  @@ -145,7 +148,7 @@
       public void testNoConnectorDeployer() throws Exception {
           MockWARConfigBuilder warConfigBuilder = new MockWARConfigBuilder();
           MockEJBConfigBuilder ejbConfigBuilder = new MockEJBConfigBuilder();
  -        EARConfigBuilder configBuilder = new EARConfigBuilder(null, null, j2eeServer, ejbConfigBuilder, warConfigBuilder, null, transactionManagerObjectName, connectionTrackerObjectName);
  +        EARConfigBuilder configBuilder = new EARConfigBuilder(j2eeServer, transactionManagerObjectName, connectionTrackerObjectName, transactionalTimerObjectName, nonTransactionalTimerObjectName, null, ejbConfigBuilder, warConfigBuilder, null, null);
           File earFile = new File("target/test-ear.ear");
   
           File carFile = File.createTempFile("EARTest", ".car");
  
  
  
  1.3       +5 -2      incubator-geronimo/modules/j2ee/src/test/org/apache/geronimo/j2ee/deployment/EARContextTest.java
  
  Index: EARContextTest.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/j2ee/src/test/org/apache/geronimo/j2ee/deployment/EARContextTest.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- EARContextTest.java	11 Jun 2004 19:18:21 -0000	1.2
  +++ EARContextTest.java	18 Jul 2004 22:04:27 -0000	1.3
  @@ -137,7 +137,10 @@
                   "j2eeServer",
                   "j2eeApplicationName",
                   ObjectName.getInstance("j2eeDomain:type=TransactionManager"),
  -                ObjectName.getInstance("j2eeDomain:type=ConnectionTracker"));
  +                ObjectName.getInstance("j2eeDomain:type=ConnectionTracker"),
  +                ObjectName.getInstance("j2eeDomain:type=TransactionalTimer"),
  +                ObjectName.getInstance("j2eeDomain:type=NonTransactionalTimer")
  +        );
   
           earContext.addEJBRef(coffee, "peaberry", coffee_peaberry);
           earContext.addEJBLocalRef(coffee, "peaberry", coffee_peaberry_local);
  
  
  
  1.2       +6 -1      incubator-geronimo/modules/j2ee/src/test/org/apache/geronimo/j2ee/deployment/MockConnectorConfigBuilder.java
  
  Index: MockConnectorConfigBuilder.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/j2ee/src/test/org/apache/geronimo/j2ee/deployment/MockConnectorConfigBuilder.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- MockConnectorConfigBuilder.java	19 May 2004 20:53:59 -0000	1.1
  +++ MockConnectorConfigBuilder.java	18 Jul 2004 22:04:27 -0000	1.2
  @@ -22,6 +22,7 @@
   
   import junit.framework.Assert;
   import org.apache.xmlbeans.XmlObject;
  +import org.apache.xmlbeans.SchemaTypeLoader;
   
   /**
    * @version $Revision$ $Date$
  @@ -69,5 +70,9 @@
           assertEquals(this.earContext, earContext);
           assertEquals(this.connectorModule, connectorModule);
           assertEquals(this.cl, cl);
  +    }
  +
  +    public SchemaTypeLoader getSchemaTypeLoader() {
  +        return null;
       }
   }
  
  
  
  1.2       +6 -1      incubator-geronimo/modules/j2ee/src/test/org/apache/geronimo/j2ee/deployment/MockEJBConfigBuilder.java
  
  Index: MockEJBConfigBuilder.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/j2ee/src/test/org/apache/geronimo/j2ee/deployment/MockEJBConfigBuilder.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- MockEJBConfigBuilder.java	19 May 2004 20:53:59 -0000	1.1
  +++ MockEJBConfigBuilder.java	18 Jul 2004 22:04:27 -0000	1.2
  @@ -22,6 +22,7 @@
   
   import junit.framework.Assert;
   import org.apache.xmlbeans.XmlObject;
  +import org.apache.xmlbeans.SchemaTypeLoader;
   
   /**
    * @version $Revision$ $Date$
  @@ -69,5 +70,9 @@
           assertEquals(this.earContext, earContext);
           assertEquals(this.ejbModule, ejbModule);
           assertEquals(this.cl, cl);
  +    }
  +
  +    public SchemaTypeLoader getSchemaTypeLoader() {
  +        return null;
       }
   }
  
  
  
  1.2       +6 -1      incubator-geronimo/modules/j2ee/src/test/org/apache/geronimo/j2ee/deployment/MockWARConfigBuilder.java
  
  Index: MockWARConfigBuilder.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/j2ee/src/test/org/apache/geronimo/j2ee/deployment/MockWARConfigBuilder.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- MockWARConfigBuilder.java	19 May 2004 20:53:59 -0000	1.1
  +++ MockWARConfigBuilder.java	18 Jul 2004 22:04:27 -0000	1.2
  @@ -23,6 +23,7 @@
   import junit.framework.Assert;
   import org.apache.geronimo.deployment.DeploymentException;
   import org.apache.xmlbeans.XmlObject;
  +import org.apache.xmlbeans.SchemaTypeLoader;
   
   /**
    * @version $Revision$ $Date$
  @@ -73,5 +74,9 @@
           assertEquals(this.cl, cl);
           assertNotNull(contextRoot);
           this.contextRoot = ((WebModule) webModule).getContextRoot();
  +    }
  +
  +    public SchemaTypeLoader getSchemaTypeLoader() {
  +        return null;
       }
   }
  
  
  
  1.3       +32 -31    incubator-geronimo/modules/jetty/src/java/org/apache/geronimo/jetty/JettyWebAppContext.java
  
  Index: JettyWebAppContext.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/jetty/src/java/org/apache/geronimo/jetty/JettyWebAppContext.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- JettyWebAppContext.java	12 Jul 2004 06:07:51 -0000	1.2
  +++ JettyWebAppContext.java	18 Jul 2004 22:04:27 -0000	1.3
  @@ -22,8 +22,8 @@
   import java.net.URI;
   import java.net.URL;
   import java.util.Set;
  +
   import javax.resource.ResourceException;
  -import javax.transaction.TransactionManager;
   
   import org.apache.commons.logging.Log;
   import org.apache.commons.logging.LogFactory;
  @@ -37,9 +37,8 @@
   import org.apache.geronimo.transaction.DefaultInstanceContext;
   import org.apache.geronimo.transaction.InstanceContext;
   import org.apache.geronimo.transaction.TrackedConnectionAssociator;
  -import org.apache.geronimo.transaction.TransactionContext;
  -import org.apache.geronimo.transaction.UnspecifiedTransactionContext;
   import org.apache.geronimo.transaction.UserTransactionImpl;
  +import org.apache.geronimo.transaction.context.TransactionContextManager;
   import org.mortbay.http.HttpException;
   import org.mortbay.http.HttpRequest;
   import org.mortbay.http.HttpResponse;
  @@ -58,7 +57,7 @@
       private final URI uri;
       private final JettyContainer container;
       private final ReadOnlyContext componentContext;
  -    private final TransactionManager txManager;
  +    private final TransactionContextManager transactionContextManager;
       private final TrackedConnectionAssociator associator;
       private final UserTransactionImpl userTransaction;
       private final ClassLoader classLoader;
  @@ -73,16 +72,17 @@
           this(null, null, null, null, null, null, null, null, null, null);
       }
   
  -    public JettyWebAppContext(ConfigurationParent config,
  -            URI uri,
  -            JettyContainer container,
  -            ReadOnlyContext compContext,
  -            Set unshareableResources,
  -            Set applicationManagedSecurityResources,
  -            TransactionManager txManager,
  -            TrackedConnectionAssociator associator,
  -            UserTransactionImpl userTransaction,
  -            ClassLoader classLoader) {
  +    public JettyWebAppContext(URI uri,
  +                              ReadOnlyContext compContext,
  +                              UserTransactionImpl userTransaction,
  +                              ClassLoader classLoader,
  +                              Set unshareableResources,
  +                              Set applicationManagedSecurityResources,
  +                              TransactionContextManager transactionContextManager,
  +                              TrackedConnectionAssociator associator,
  +                              ConfigurationParent config,
  +                              JettyContainer container
  +                              ) {
           super();
           this.config = config;
           this.uri = uri;
  @@ -90,7 +90,7 @@
           this.componentContext = compContext;
           this.unshareableResources = unshareableResources;
           this.applicationManagedSecurityResources = applicationManagedSecurityResources;
  -        this.txManager = txManager;
  +        this.transactionContextManager = transactionContextManager;
           this.associator = associator;
           this.userTransaction = userTransaction;
           this.classLoader = classLoader;
  @@ -139,9 +139,9 @@
       }
   
       public void handle(String pathInContext,
  -            String pathParams,
  -            HttpRequest httpRequest,
  -            HttpResponse httpResponse)
  +                       String pathParams,
  +                       HttpRequest httpRequest,
  +                       HttpResponse httpResponse)
               throws HttpException, IOException {
   
           // save previous state
  @@ -156,8 +156,8 @@
               // Turn on the UserTransaction
               userTransaction.setOnline(true);
   
  -            if (TransactionContext.getContext() == null) {
  -                TransactionContext.setContext(new UnspecifiedTransactionContext());
  +            if (transactionContextManager.getContext() == null) {
  +                transactionContextManager.newUnspecifiedTransactionContext();
               }
               try {
                   oldInstanceContext = associator.enter(new DefaultInstanceContext(unshareableResources, applicationManagedSecurityResources));
  @@ -175,19 +175,19 @@
                   userTransaction.setOnline(false);
                   RootContext.setComponentContext(oldComponentContext);
               }
  +            //TODO should we reset the transactioncontext to null if we set it?
           }
       }
   
       public void doStart() throws WaitingException, Exception {
   
  -        userTransaction.setUp(txManager, associator);
  -
           if (uri.isAbsolute()) {
               setWAR(uri.toString());
           } else {
               setWAR(new URL(config.getBaseURL(), uri.toString()).toString());
           }
           if (userTransaction != null) {
  +            userTransaction.setUp(transactionContextManager, associator);
               userTransaction.setOnline(true);
           }
           container.addContext(this);
  @@ -237,7 +237,7 @@
       static {
           GBeanInfoFactory infoFactory = new GBeanInfoFactory("Jetty WebApplication Context", JettyWebAppContext.class);
   
  -        infoFactory.addAttribute("URI", URI.class, true);
  +        infoFactory.addAttribute("uri", URI.class, true);
           infoFactory.addAttribute("contextPath", String.class, true);
           infoFactory.addAttribute("contextPriorityClassLoader", Boolean.TYPE, true);
           infoFactory.addAttribute("componentContext", ReadOnlyContext.class, true);
  @@ -248,20 +248,21 @@
   
           infoFactory.addReference("Configuration", ConfigurationParent.class);
           infoFactory.addReference("JettyContainer", JettyContainer.class);
  -        infoFactory.addReference("TransactionManager", TransactionManager.class);
  +        infoFactory.addReference("TransactionContextManager", TransactionContextManager.class);
           infoFactory.addReference("TrackedConnectionAssociator", TrackedConnectionAssociator.class);
   
           infoFactory.setConstructor(new String[]{
  -            "Configuration",
  -            "URI",
  -            "JettyContainer",
  +            "uri",
               "componentContext",
  +            "userTransaction",
  +            "classLoader",
               "unshareableResources",
               "applicationManagedSecurityResources",
  -            "TransactionManager",
  +            "TransactionContextManager",
               "TrackedConnectionAssociator",
  -            "userTransaction",
  -            "classLoader"});
  +            "Configuration",
  +            "JettyContainer",
  +        });
   
           GBEAN_INFO = infoFactory.getBeanInfo();
       }
  
  
  
  1.4       +41 -39    incubator-geronimo/modules/jetty/src/java/org/apache/geronimo/jetty/JettyWebAppJACCContext.java
  
  Index: JettyWebAppJACCContext.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/jetty/src/java/org/apache/geronimo/jetty/JettyWebAppJACCContext.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- JettyWebAppJACCContext.java	12 Jul 2004 06:07:51 -0000	1.3
  +++ JettyWebAppJACCContext.java	18 Jul 2004 22:04:27 -0000	1.4
  @@ -17,14 +17,6 @@
   
   package org.apache.geronimo.jetty;
   
  -import javax.security.auth.Subject;
  -import javax.security.jacc.PolicyConfiguration;
  -import javax.security.jacc.PolicyConfigurationFactory;
  -import javax.security.jacc.PolicyContext;
  -import javax.security.jacc.PolicyContextException;
  -import javax.security.jacc.WebResourcePermission;
  -import javax.security.jacc.WebUserDataPermission;
  -import javax.transaction.TransactionManager;
   import java.io.IOException;
   import java.net.URI;
   import java.security.AccessControlContext;
  @@ -36,19 +28,16 @@
   import java.util.Map;
   import java.util.Set;
   
  -import org.mortbay.http.Authenticator;
  -import org.mortbay.http.HttpException;
  -import org.mortbay.http.HttpRequest;
  -import org.mortbay.http.HttpResponse;
  -import org.mortbay.http.PathMap;
  -import org.mortbay.http.SecurityConstraint;
  -import org.mortbay.http.UserRealm;
  -import org.mortbay.jetty.servlet.FormAuthenticator;
  -import org.mortbay.jetty.servlet.ServletHttpRequest;
  -import org.mortbay.util.LazyList;
  +import javax.security.auth.Subject;
  +import javax.security.jacc.PolicyConfiguration;
  +import javax.security.jacc.PolicyConfigurationFactory;
  +import javax.security.jacc.PolicyContext;
  +import javax.security.jacc.PolicyContextException;
  +import javax.security.jacc.WebResourcePermission;
  +import javax.security.jacc.WebUserDataPermission;
  +
   import org.apache.commons.logging.Log;
   import org.apache.commons.logging.LogFactory;
  -
   import org.apache.geronimo.gbean.GBeanInfo;
   import org.apache.geronimo.gbean.GBeanInfoFactory;
   import org.apache.geronimo.gbean.WaitingException;
  @@ -65,6 +54,17 @@
   import org.apache.geronimo.security.util.ConfigurationUtil;
   import org.apache.geronimo.transaction.TrackedConnectionAssociator;
   import org.apache.geronimo.transaction.UserTransactionImpl;
  +import org.apache.geronimo.transaction.context.TransactionContextManager;
  +import org.mortbay.http.Authenticator;
  +import org.mortbay.http.HttpException;
  +import org.mortbay.http.HttpRequest;
  +import org.mortbay.http.HttpResponse;
  +import org.mortbay.http.PathMap;
  +import org.mortbay.http.SecurityConstraint;
  +import org.mortbay.http.UserRealm;
  +import org.mortbay.jetty.servlet.FormAuthenticator;
  +import org.mortbay.jetty.servlet.ServletHttpRequest;
  +import org.mortbay.util.LazyList;
   
   
   /**
  @@ -94,20 +94,21 @@
           this(null, null, null, null, null, null, null, null, null, null, null, null);
       }
   
  -    public JettyWebAppJACCContext(ConfigurationParent config,
  -                                  URI uri,
  -                                  JettyContainer container,
  +    public JettyWebAppJACCContext(URI uri,
                                     ReadOnlyContext compContext,
  -                                  String policyContextID,
  -                                  Security securityConfig,
  +                                  UserTransactionImpl userTransaction,
  +                                  ClassLoader classLoader,
                                     Set unshareableResources,
                                     Set applicationManagedSecurityResources,
  -                                  TransactionManager txManager,
  +                                  String policyContextID,
  +                                  Security securityConfig,
  +                                  TransactionContextManager transactionContextManager,
                                     TrackedConnectionAssociator associator,
  -                                  UserTransactionImpl userTransaction,
  -                                  ClassLoader classLoader) {
  -        super(config, uri, container, compContext, unshareableResources, applicationManagedSecurityResources,
  -              txManager, associator, userTransaction, classLoader);
  +                                  ConfigurationParent config,
  +                                  JettyContainer container
  +                                  ) {
  +        super(uri, compContext, userTransaction, classLoader, unshareableResources, applicationManagedSecurityResources, transactionContextManager, associator, config, container
  +        );
   
           this.policyContextID = policyContextID;
           this.securityConfig = securityConfig;
  @@ -178,7 +179,7 @@
        *
        * @param pathSpec The path spec to which the secuiryt cosntraint applies
        * @param sc       the security constraint
  -     * @todo Jetty to provide access to this map so we can remove this method
  +     * TODO Jetty to provide access to this map so we can remove this method
        * @see org.mortbay.http.HttpContext#addSecurityConstraint(java.lang.String, org.mortbay.http.SecurityConstraint)
        */
       public void addSecurityConstraint(String pathSpec, SecurityConstraint sc) {
  @@ -466,18 +467,19 @@
           infoFactory.addAttribute("policyContextID", String.class, true);
   
           infoFactory.setConstructor(new String[]{
  -            "Configuration",
  -            "URI",
  -            "JettyContainer",
  +            "uri",
               "componentContext",
  -            "policyContextID",
  -            "securityConfig",
  +            "userTransaction",
  +            "classLoader",
               "unshareableResources",
               "applicationManagedSecurityResources",
  -            "TransactionManager",
  +            "policyContextID",
  +            "securityConfig",
  +            "TransactionContextManager",
               "TrackedConnectionAssociator",
  -            "userTransaction",
  -            "classLoader"});
  +            "Configuration",
  +            "JettyContainer",
  +        });
   
           GBEAN_INFO = infoFactory.getBeanInfo();
       }
  
  
  
  1.15      +29 -15    incubator-geronimo/modules/jetty/src/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java
  
  Index: JettyModuleBuilder.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/jetty/src/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- JettyModuleBuilder.java	12 Jul 2004 06:07:50 -0000	1.14
  +++ JettyModuleBuilder.java	18 Jul 2004 22:04:27 -0000	1.15
  @@ -84,12 +84,19 @@
   import org.apache.geronimo.xbeans.j2ee.WebAppType;
   import org.apache.xmlbeans.XmlException;
   import org.apache.xmlbeans.XmlObject;
  +import org.apache.xmlbeans.SchemaTypeLoader;
  +import org.apache.xmlbeans.XmlBeans;
   
   
   /**
    * @version $Revision$ $Date$
    */
   public class JettyModuleBuilder implements ModuleBuilder {
  +    static final SchemaTypeLoader SCHEMA_TYPE_LOADER = XmlBeans.typeLoaderUnion(new SchemaTypeLoader[] {
  +        XmlBeans.typeLoaderForClassLoader(org.apache.geronimo.xbeans.j2ee.String.class.getClassLoader()),
  +        XmlBeans.typeLoaderForClassLoader(JettyWebAppDocument.class.getClassLoader())
  +    });
  +
       private static final String PARENT_ID = "org/apache/geronimo/Server";
   
       public XmlObject getDeploymentPlan(URL module) throws XmlException {
  @@ -104,13 +111,13 @@
               if (plan == null) {
                   return createDefaultPlan(moduleBase);
               }
  -            return plan.getWebApp();
  +            return plan;
           } catch (MalformedURLException e) {
               return null;
           }
       }
   
  -    private JettyWebAppType createDefaultPlan(URL moduleBase) throws XmlException {
  +    private JettyWebAppDocument createDefaultPlan(URL moduleBase) throws XmlException {
           // load the web.xml
           URL webXmlUrl = null;
           try {
  @@ -130,7 +137,8 @@
           }
   
           // construct the empty geronimo-jetty.xml
  -        JettyWebAppType jettyWebApp = JettyWebAppType.Factory.newInstance();
  +        JettyWebAppDocument jettyWebAppDocument = JettyWebAppDocument.Factory.newInstance();
  +        JettyWebAppType jettyWebApp = jettyWebAppDocument.addNewWebApp();
   
           // set the parentId, configId and context root
           jettyWebApp.setParentId(PARENT_ID);
  @@ -148,15 +156,15 @@
   
           jettyWebApp.setConfigId(id);
           jettyWebApp.setContextRoot(id);
  -        return jettyWebApp;
  +        return jettyWebAppDocument;
       }
   
       public boolean canHandlePlan(XmlObject plan) {
  -        return plan instanceof JettyWebAppType;
  +        return plan instanceof JettyWebAppDocument;
       }
   
       public URI getParentId(XmlObject plan) throws DeploymentException {
  -        JettyWebAppType jettyWebApp = (JettyWebAppType) plan;
  +        JettyWebAppType jettyWebApp = ((JettyWebAppDocument) plan).getWebApp();
           try {
               return new URI(jettyWebApp.getParentId());
           } catch (URISyntaxException e) {
  @@ -165,7 +173,7 @@
       }
   
       public URI getConfigId(XmlObject plan) throws DeploymentException {
  -        JettyWebAppType jettyWebApp = (JettyWebAppType) plan;
  +        JettyWebAppType jettyWebApp = ((JettyWebAppDocument) plan).getWebApp();
           try {
               return new URI(jettyWebApp.getConfigId());
           } catch (URISyntaxException e) {
  @@ -174,7 +182,7 @@
       }
   
       public Module createModule(String name, XmlObject plan) throws DeploymentException {
  -        JettyWebAppType jettyWebApp = (JettyWebAppType) plan;
  +        JettyWebAppType jettyWebApp = ((JettyWebAppDocument) plan).getWebApp();
           WebModule module = new WebModule(name, URI.create("/"), jettyWebApp.getContextRoot());
           module.setVendorDD(jettyWebApp);
           return module;
  @@ -228,7 +236,9 @@
               }
               webModule.setSpecDD(webApp);
   
  -            assert jettyWebApp != null: "geronimo-jetty.xml not defined";
  +            if (jettyWebApp == null) {
  +                throw new DeploymentException("No plan or WEB-INF/jetty-web.xml found");
  +            }
               webModule.setVendorDD(jettyWebApp);
   
               // add the dependencies declared in the geronimo-jetty.xml file
  @@ -294,7 +304,7 @@
   
               String PolicyContextID = (earContext.getApplicationObjectName()==null? module.getName():earContext.getApplicationObjectName().toString());
   
  -            gbean.setAttribute("URI", warRoot);
  +            gbean.setAttribute("uri", warRoot);
               gbean.setAttribute("contextPath", webModule.getContextRoot());
               gbean.setAttribute("contextPriorityClassLoader", Boolean.valueOf(jettyWebApp.getContextPriorityClassloader()));
               if (security != null) {
  @@ -304,14 +314,18 @@
               gbean.setAttribute("componentContext", compContext);
               gbean.setAttribute("userTransaction", userTransaction);
               setResourceEnvironment(gbean, webApp.getResourceRefArray(), jettyWebApp.getResourceRefArray());
  -            gbean.setReferencePatterns("Configuration", Collections.singleton(new ObjectName("geronimo.config:name=" + ObjectName.quote(configID.toString())))); // @todo this is used to resolve relative URIs, we should fix this
  -            gbean.setReferencePatterns("JettyContainer", Collections.singleton(new ObjectName("*:type=WebContainer,container=Jetty"))); // @todo configurable
  -            gbean.setReferencePatterns("TransactionManager", Collections.singleton(earContext.getTransactionManagerObjectName()));
  -            gbean.setReferencePatterns("TrackedConnectionAssociator", Collections.singleton(earContext.getConnectionTrackerObjectName()));
  +            gbean.setReferencePattern("Configuration", new ObjectName("geronimo.config:name=" + ObjectName.quote(configID.toString()))); // @todo this is used to resolve relative URIs, we should fix this
  +            gbean.setReferencePattern("JettyContainer", new ObjectName("*:type=WebContainer,container=Jetty")); // @todo configurable
  +            gbean.setReferencePattern("TransactionContextManager", earContext.getTransactionContextManagerObjectName());
  +            gbean.setReferencePattern("TrackedConnectionAssociator", earContext.getConnectionTrackerObjectName());
           } catch (Exception e) {
               throw new DeploymentException("Unable to initialize webapp GBean", e);
           }
           earContext.addGBean(name, gbean);
  +    }
  +
  +    public SchemaTypeLoader getSchemaTypeLoader() {
  +       return SCHEMA_TYPE_LOADER;
       }
   
       private ReadOnlyContext buildComponentContext(EARContext earContext, WebModule webModule, WebAppType webApp, JettyWebAppType jettyWebApp, UserTransaction userTransaction, ClassLoader cl) throws DeploymentException {
  
  
  
  1.15      +11 -4     incubator-geronimo/modules/jetty/src/test/org/apache/geronimo/jetty/ApplicationTest.java
  
  Index: ApplicationTest.java
  ===================================================================
  RCS file: /home/cvs/incubator-geronimo/modules/jetty/src/test/org/apache/geronimo/jetty/ApplicationTest.java,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- ApplicationTest.java	15 Jul 2004 17:57:56 -0000	1.14
  +++ ApplicationTest.java	18 Jul 2004 22:04:27 -0000	1.15
  @@ -35,6 +35,7 @@
   import org.apache.geronimo.kernel.Kernel;
   import org.apache.geronimo.transaction.GeronimoTransactionManager;
   import org.apache.geronimo.transaction.UserTransactionImpl;
  +import org.apache.geronimo.transaction.context.TransactionContextManager;
   
   /**
    * @version $Revision$ $Date$
  @@ -52,6 +53,8 @@
       private ObjectName tcaName;
       private GBeanMBean tm;
       private GBeanMBean ctc;
  +    private ObjectName tcmName;
  +    private GBeanMBean tcm;
   
       public void testDummy() throws Exception {
       }
  @@ -59,15 +62,15 @@
       public void testApplication() throws Exception {
           URL url = Thread.currentThread().getContextClassLoader().getResource("deployables/war1/");
           GBeanMBean app = new GBeanMBean(JettyWebAppContext.GBEAN_INFO);
  -        app.setAttribute("URI", URI.create(url.toString()));
  +        app.setAttribute("uri", URI.create(url.toString()));
           app.setAttribute("contextPath", "/test");
           app.setAttribute("componentContext", null);
           UserTransactionImpl userTransaction = new UserTransactionImpl();
           app.setAttribute("userTransaction", userTransaction);
           app.setReferencePatterns("Configuration", Collections.EMPTY_SET);
           app.setReferencePatterns("JettyContainer", containerPatterns);
  -        app.setReferencePatterns("TransactionManager", Collections.singleton(tmName));
  -        app.setReferencePatterns("TrackedConnectionAssociator", Collections.singleton(tcaName));
  +        app.setReferencePattern("TransactionContextManager", tcmName);
  +        app.setReferencePattern("TrackedConnectionAssociator", tcaName);
           start(appName, app);
   
   
  @@ -95,6 +98,7 @@
           appName = new ObjectName("geronimo.jetty:app=test");
   
           tmName = new ObjectName("geronimo.test:role=TransactionManager");
  +        tcmName = new ObjectName("geronimo.test:role=TransactionContextManager");
           tcaName = new ObjectName("geronimo.test:role=ConnectionTrackingCoordinator");
   
           kernel = new Kernel("test.kernel", "test");
  @@ -114,6 +118,9 @@
           patterns.add(ObjectName.getInstance("geronimo.server:j2eeType=JCAManagedConnectionFactory,*"));
           tm.setReferencePatterns("ResourceManagers", patterns);
           start(tmName, tm);
  +        tcm = new GBeanMBean(TransactionContextManager.GBEAN_INFO);
  +        tcm.setReferencePattern("TransactionManager", tmName);
  +        start(tcmName, tcm);
           ctc = new GBeanMBean(ConnectionTrackingCoordinator.GBEAN_INFO);
           start(tcaName, ctc);
       }
  
  
  

Mime
View raw message