Author: djencks
Date: Fri Jan 21 16:26:15 2005
New Revision: 125989

URL: http://svn.apache.org/viewcvs?view=rev&rev=125989
Log:
GERONIMO-450 progress: get the domain and J2EEServer for gbeans from the parent 
config, or specify them explicitly if there is not parent.  Also some 
improvements in storing enhanced/generated classes in a config.
Added:
   
geronimo/trunk/modules/connector-builder/src/test/org/apache/geronimo/connector/deployment/ConnectorModuleBuilderTest.java
      - copied, changed from r125375, 
geronimo/trunk/modules/connector-builder/src/test/org/apache/geronimo/connector/deployment/RAR_1_0ConfigBuilderTest.java
   geronimo/trunk/modules/j2ee-schema/src/test-data/j2ee_1_4schema/web-2-24.xml
Removed:
   
geronimo/trunk/modules/connector-builder/src/test/org/apache/geronimo/connector/deployment/RAR_1_0ConfigBuilderTest.java
   
geronimo/trunk/modules/connector-builder/src/test/org/apache/geronimo/connector/deployment/RAR_1_5ConfigBuilderTest.java
Modified:
   geronimo/trunk/modules/assembly/maven.xml
   geronimo/trunk/modules/assembly/src/plan/client-system-plan.xml
   geronimo/trunk/modules/assembly/src/plan/deployer-system-plan.xml
   geronimo/trunk/modules/assembly/src/plan/j2ee-deployer-plan.xml
   geronimo/trunk/modules/assembly/src/plan/j2ee-runtime-deployer-plan.xml
   geronimo/trunk/modules/assembly/src/plan/system-plan.xml
   
geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/AxisBuilder.java
   
geronimo/trunk/modules/axis-builder/src/test/org/apache/geronimo/axis/builder/ServiceReferenceTest.java
   
geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/AbstractWebServiceTest.java
   
geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/preconditions/DynamicEJBDeploymentTest.java
   
geronimo/trunk/modules/client-builder/src/java/org/apache/geronimo/client/builder/AppClientModuleBuilder.java
   
geronimo/trunk/modules/connector-builder/src/test/org/apache/geronimo/connector/deployment/PlanParsingTest.java
   
geronimo/trunk/modules/deploy-tool/src/java/org/apache/geronimo/deployment/Bootstrap.java
   
geronimo/trunk/modules/deployment/src/java/org/apache/geronimo/deployment/DeploymentContext.java
   
geronimo/trunk/modules/deployment/src/test/org/apache/geronimo/deployment/DeploymentContextTest.java
   
geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/AppClientModule.java
   
geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/ConnectorModule.java
   
geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder.java
   
geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/EARContext.java
   
geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/EJBModule.java
   
geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/Module.java
   
geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/RefContext.java
   
geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/ServiceReferenceBuilder.java
   
geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/WebModule.java
   
geronimo/trunk/modules/j2ee-builder/src/test/org/apache/geronimo/j2ee/deployment/EARConfigBuilderTest.java
   
geronimo/trunk/modules/j2ee-builder/src/test/org/apache/geronimo/j2ee/deployment/EJBRefContextTest.java
   geronimo/trunk/modules/j2ee-schema/maven.xml
   
geronimo/trunk/modules/j2ee-schema/src/test/org/apache/geronimo/schema/SchemaConversionUtilsTest.java
   
geronimo/trunk/modules/jetty-builder/src/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java
   
geronimo/trunk/modules/jetty-builder/src/test/org/apache/geronimo/jetty/deployment/JettyModuleBuilderTest.java
   
geronimo/trunk/modules/jetty-builder/src/test/org/apache/geronimo/jetty/deployment/PlanParsingTest.java
   
geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/config/Configuration.java
   
geronimo/trunk/modules/naming-builder/src/java/org/apache/geronimo/naming/deployment/ENCConfigBuilder.java
   
geronimo/trunk/modules/service-builder/src/java/org/apache/geronimo/deployment/service/ServiceConfigBuilder.java
   geronimo/trunk/modules/service-builder/src/schema/geronimo-config.xsd

Modified: geronimo/trunk/modules/assembly/maven.xml
Url: 
http://svn.apache.org/viewcvs/geronimo/trunk/modules/assembly/maven.xml?view=diff&rev=125989&p1=geronimo/trunk/modules/assembly/maven.xml&r1=125988&p2=geronimo/trunk/modules/assembly/maven.xml&r2=125989
==============================================================================
--- geronimo/trunk/modules/assembly/maven.xml   (original)
+++ geronimo/trunk/modules/assembly/maven.xml   Fri Jan 21 16:26:15 2005
@@ -222,7 +222,7 @@
             
deployerSystemPlan="${basedir}/target/plan/deployer-system-plan.xml"
             j2eeDeployerPlan="${basedir}/target/plan/j2ee-deployer-plan.xml"
             deployerClassPath="${deploy.classpath}"
-            
deployerGBean="geronimo.server:name=Deployer,J2EEApplication=null,J2EEModule=org/apache/geronimo/J2EEDeployer,j2eeType=Deployer,J2EEServer=geronimo"
+            
deployerGBean="geronimo.deployer:name=Deployer,J2EEApplication=null,J2EEModule=org/apache/geronimo/J2EEDeployer,j2eeType=Deployer,J2EEServer=deployer"
             
deploymentFactory="org.apache.geronimo.deployment.plugin.factories.DeploymentFactoryImpl"
             />
 

Modified: geronimo/trunk/modules/assembly/src/plan/client-system-plan.xml
Url: 
http://svn.apache.org/viewcvs/geronimo/trunk/modules/assembly/src/plan/client-system-plan.xml?view=diff&rev=125989&p1=geronimo/trunk/modules/assembly/src/plan/client-system-plan.xml&r1=125988&p2=geronimo/trunk/modules/assembly/src/plan/client-system-plan.xml&r2=125989
==============================================================================
--- geronimo/trunk/modules/assembly/src/plan/client-system-plan.xml     
(original)
+++ geronimo/trunk/modules/assembly/src/plan/client-system-plan.xml     Fri Jan 
21 16:26:15 2005
@@ -28,8 +28,9 @@
 -->
 <configuration
     xmlns="http://geronimo.apache.org/xml/ns/deployment";
-    parentId=""
     configId="org/apache/geronimo/ClientSystem"
+    domain="geronimo.client"
+    server="client"
     >
 
     <!-- ServerInfo service -->

Modified: geronimo/trunk/modules/assembly/src/plan/deployer-system-plan.xml
Url: 
http://svn.apache.org/viewcvs/geronimo/trunk/modules/assembly/src/plan/deployer-system-plan.xml?view=diff&rev=125989&p1=geronimo/trunk/modules/assembly/src/plan/deployer-system-plan.xml&r1=125988&p2=geronimo/trunk/modules/assembly/src/plan/deployer-system-plan.xml&r2=125989
==============================================================================
--- geronimo/trunk/modules/assembly/src/plan/deployer-system-plan.xml   
(original)
+++ geronimo/trunk/modules/assembly/src/plan/deployer-system-plan.xml   Fri Jan 
21 16:26:15 2005
@@ -24,7 +24,8 @@
 <configuration
     xmlns="http://geronimo.apache.org/xml/ns/deployment";
     configId="org/apache/geronimo/DeployerSystem"
-    parentId=""
+    domain="geronimo.deployer"
+    server="deployer"
     >
 
     <!-- ServerInfo service -->
@@ -34,20 +35,20 @@
     <!-- Configuration Store service -->
     <gbean namePart="Local" type="ConfigurationStore" 
class="org.apache.geronimo.system.configuration.LocalConfigStore">
         <attribute name="root" type="java.net.URI">config-store/</attribute>
-        <reference 
name="ServerInfo">geronimo.server:name=ServerInfo,*</reference>
+        <reference 
name="ServerInfo">geronimo.deployer:name=ServerInfo,*</reference>
     </gbean>
 
 
     <!-- Repository -->
     <gbean namePart="Repository" 
class="org.apache.geronimo.system.repository.ReadOnlyRepository">
         <attribute name="root" type="java.net.URI">repository/</attribute>
-        <reference 
name="ServerInfo">geronimo.server:name=ServerInfo,*</reference>
+        <reference 
name="ServerInfo">geronimo.deployer:name=ServerInfo,*</reference>
     </gbean>
 
     <!-- Logging service -->
     <gbean namePart="Logger" 
class="org.apache.geronimo.system.logging.log4j.Log4jService">
         <attribute 
name="configurationFile">var/log/deployer-log4j.properties</attribute>
         <attribute name="refreshPeriod">60</attribute>
-        <reference 
name="ServerInfo">geronimo.server:name=ServerInfo,*</reference>
+        <reference 
name="ServerInfo">geronimo.deployer:name=ServerInfo,*</reference>
     </gbean>
 </configuration>

Modified: geronimo/trunk/modules/assembly/src/plan/j2ee-deployer-plan.xml
Url: 
http://svn.apache.org/viewcvs/geronimo/trunk/modules/assembly/src/plan/j2ee-deployer-plan.xml?view=diff&rev=125989&p1=geronimo/trunk/modules/assembly/src/plan/j2ee-deployer-plan.xml&r1=125988&p2=geronimo/trunk/modules/assembly/src/plan/j2ee-deployer-plan.xml&r2=125989
==============================================================================
--- geronimo/trunk/modules/assembly/src/plan/j2ee-deployer-plan.xml     
(original)
+++ geronimo/trunk/modules/assembly/src/plan/j2ee-deployer-plan.xml     Fri Jan 
21 16:26:15 2005
@@ -125,31 +125,31 @@
 
 
     <gbean namePart="Deployer" type="Deployer" 
class="org.apache.geronimo.deployment.Deployer">
-        <reference 
name="Builders">geronimo.server:j2eeType=ConfigBuilder,J2EEModule=org/apache/geronimo/J2EEDeployer,*</reference>
-        <reference 
name="Store">geronimo.server:j2eeType=ConfigurationStore,*</reference>
+        <reference 
name="Builders">geronimo.deployer:j2eeType=ConfigBuilder,J2EEModule=org/apache/geronimo/J2EEDeployer,*</reference>
+        <reference 
name="Store">geronimo.deployer:j2eeType=ConfigurationStore,*</reference>
     </gbean>
 
     <gbean namePart="ServiceBuilder" type="ConfigBuilder" 
class="org.apache.geronimo.deployment.service.ServiceConfigBuilder">
         <attribute 
name="defaultParentId">org/apache/geronimo/Server</attribute>
-        <attribute name="j2eeServer" 
type="javax.management.ObjectName">geronimo.server:j2eeType=J2EEServer,name=geronimo</attribute>
         <reference name="Repository">*:name=Repository,*</reference>
     </gbean>
 
     <gbean namePart="EARBuilder" type="ConfigBuilder" 
class="org.apache.geronimo.j2ee.deployment.EARConfigBuilder">
         <attribute 
name="defaultParentId">org/apache/geronimo/Server</attribute>
-        <attribute name="j2eeServer" 
type="javax.management.ObjectName">geronimo.server:j2eeType=J2EEServer,name=geronimo</attribute>
-        <attribute name="transactionContextManagerObjectName" 
type="javax.management.ObjectName">geronimo.server:name=TransactionContextManager,*</attribute>
-        <attribute name="connectionTrackerObjectName" 
type="javax.management.ObjectName">geronimo.server:name=ConnectionTracker,*</attribute>
+        <!--domain set to wildcard so datasources may be deployed 
independently on client. -->
+        <!--a better solution is to get the domain and server from the parent 
configuration -->
+        <attribute name="transactionContextManagerObjectName" 
type="javax.management.ObjectName">*:name=TransactionContextManager,*</attribute>
+        <attribute name="connectionTrackerObjectName" 
type="javax.management.ObjectName">*:name=ConnectionTracker,*</attribute>
         <attribute name="transactionalTimerObjectName" 
type="javax.management.ObjectName">geronimo.server:name=TransactionalThreadPooledTimer,*</attribute>
         <attribute name="nonTransactionalTimerObjectName" 
type="javax.management.ObjectName">geronimo.server:name=NonTransactionalThreadPooledTimer,*</attribute>
         <reference name="Repository">*:name=Repository,*</reference>
-        <reference 
name="EJBConfigBuilder">geronimo.server:name=EJBBuilder,J2EEModule=org/apache/geronimo/J2EEDeployer,*</reference>
-        <reference 
name="EJBReferenceBuilder">geronimo.server:name=EJBBuilder,J2EEModule=org/apache/geronimo/J2EEDeployer,*</reference>
-        <reference 
name="WebConfigBuilder">geronimo.server:name=WebBuilder,J2EEModule=org/apache/geronimo/J2EEDeployer,*</reference>
-        <reference 
name="ConnectorConfigBuilder">geronimo.server:J2EEApplication=null,J2EEModule=org/apache/geronimo/J2EEDeployer,J2EEServer=geronimo,j2eeType=ModuleBuilder,name=ConnectorBuilder</reference>
-        <reference 
name="ResourceReferenceBuilder">geronimo.server:J2EEApplication=null,J2EEModule=org/apache/geronimo/J2EEDeployer,J2EEServer=geronimo,j2eeType=ModuleBuilder,name=ConnectorBuilder</reference>
-        <reference 
name="AppClientConfigBuilder">geronimo.server:name=AppClientBuilder,J2EEModule=org/apache/geronimo/J2EEDeployer,*</reference>
-        <reference 
name="ServiceReferenceBuilder">geronimo.server:J2EEApplication=null,J2EEModule=org/apache/geronimo/J2EEDeployer,J2EEServer=geronimo,j2eeType=ModuleBuilder,name=WebServiceBuilder</reference>
+        <reference 
name="EJBConfigBuilder">geronimo.deployer:name=EJBBuilder,J2EEModule=org/apache/geronimo/J2EEDeployer,*</reference>
+        <reference 
name="EJBReferenceBuilder">geronimo.deployer:name=EJBBuilder,J2EEModule=org/apache/geronimo/J2EEDeployer,*</reference>
+        <reference 
name="WebConfigBuilder">geronimo.deployer:name=WebBuilder,J2EEModule=org/apache/geronimo/J2EEDeployer,*</reference>
+        <reference 
name="ConnectorConfigBuilder">geronimo.deployer:J2EEApplication=null,J2EEModule=org/apache/geronimo/J2EEDeployer,J2EEServer=deployer,j2eeType=ModuleBuilder,name=ConnectorBuilder</reference>
+        <reference 
name="ResourceReferenceBuilder">geronimo.deployer:J2EEApplication=null,J2EEModule=org/apache/geronimo/J2EEDeployer,J2EEServer=deployer,j2eeType=ModuleBuilder,name=ConnectorBuilder</reference>
+        <reference 
name="AppClientConfigBuilder">geronimo.deployer:name=AppClientBuilder,J2EEModule=org/apache/geronimo/J2EEDeployer,*</reference>
+        <reference 
name="ServiceReferenceBuilder">geronimo.deployer:J2EEApplication=null,J2EEModule=org/apache/geronimo/J2EEDeployer,J2EEServer=deployer,j2eeType=ModuleBuilder,name=WebServiceBuilder</reference>
         </gbean>
 
     <gbean namePart="SecurityService" 
class="org.apache.geronimo.security.SecurityServiceImpl">
@@ -161,7 +161,7 @@
         <attribute name="defaultSessionTimeoutSeconds">1800</attribute>
         <attribute 
name="defaultWelcomeFiles">index.html,index.htm,index.jsp</attribute>
         <attribute 
name="jettyContainerObjectName">geronimo.server:name=JettyWebContainer,*</attribute>
-        <attribute 
name="defaultServlets">geronimo.server:j2eeType=DefaultServlet,*</attribute>
+        <attribute 
name="defaultServlets">geronimo.deployer:j2eeType=DefaultServlet,*</attribute>
         <reference name="Repository">*:name=Repository,*</reference>
     </gbean>
 
@@ -236,13 +236,13 @@
     <gbean namePart="AppClientBuilder" type="ModuleBuilder" 
class="org.apache.geronimo.client.builder.AppClientModuleBuilder">
         <attribute 
name="defaultClientParentId">org/apache/geronimo/Client</attribute>
         <attribute 
name="defaultServerParentId">org/apache/geronimo/Server</attribute>
-        <attribute name="transactionContextManagerObjectName" 
type="javax.management.ObjectName">geronimo.client:name=TransactionContextManager,*</attribute>
-        <attribute name="connectionTrackerObjectName" 
type="javax.management.ObjectName">geronimo.client:name=ConnectionTracker,*</attribute>
-        <reference 
name="EJBReferenceBuilder">geronimo.server:J2EEApplication=null,J2EEModule=org/apache/geronimo/J2EEDeployer,J2EEServer=geronimo,j2eeType=GBean,name=ClientEJBReferenceBuilder</reference>
-        <reference 
name="ConnectorModuleBuilder">geronimo.server:J2EEApplication=null,J2EEModule=org/apache/geronimo/J2EEDeployer,J2EEServer=geronimo,j2eeType=ModuleBuilder,name=ConnectorBuilder</reference>
-        <reference 
name="ResourceReferenceBuilder">geronimo.server:J2EEApplication=null,J2EEModule=org/apache/geronimo/J2EEDeployer,J2EEServer=geronimo,j2eeType=ModuleBuilder,name=ConnectorBuilder</reference>
-        <reference 
name="ServiceReferenceBuilder">geronimo.server:J2EEApplication=null,J2EEModule=org/apache/geronimo/J2EEDeployer,J2EEServer=geronimo,j2eeType=ModuleBuilder,name=WebServiceBuilder</reference>
-        <reference 
name="Store">geronimo.server:j2eeType=ConfigurationStore,*</reference>
+        <attribute 
name="transactionContextManagerObjectName">geronimo.client:name=TransactionContextManager,*</attribute>
+        <attribute 
name="connectionTrackerObjectName">geronimo.client:name=ConnectionTracker,*</attribute>
+        <reference 
name="EJBReferenceBuilder">geronimo.deployer:J2EEApplication=null,J2EEModule=org/apache/geronimo/J2EEDeployer,J2EEServer=deployer,j2eeType=GBean,name=ClientEJBReferenceBuilder</reference>
+        <reference 
name="ConnectorModuleBuilder">geronimo.deployer:J2EEApplication=null,J2EEModule=org/apache/geronimo/J2EEDeployer,J2EEServer=deployer,j2eeType=ModuleBuilder,name=ConnectorBuilder</reference>
+        <reference 
name="ResourceReferenceBuilder">geronimo.deployer:J2EEApplication=null,J2EEModule=org/apache/geronimo/J2EEDeployer,J2EEServer=deployer,j2eeType=ModuleBuilder,name=ConnectorBuilder</reference>
+        <reference 
name="ServiceReferenceBuilder">geronimo.deployer:J2EEApplication=null,J2EEModule=org/apache/geronimo/J2EEDeployer,J2EEServer=deployer,j2eeType=ModuleBuilder,name=WebServiceBuilder</reference>
+        <reference 
name="Store">geronimo.deployer:j2eeType=ConfigurationStore,*</reference>
         <reference name="Repository">*:name=Repository,*</reference>
     </gbean>
 

Modified: 
geronimo/trunk/modules/assembly/src/plan/j2ee-runtime-deployer-plan.xml
Url: 
http://svn.apache.org/viewcvs/geronimo/trunk/modules/assembly/src/plan/j2ee-runtime-deployer-plan.xml?view=diff&rev=125989&p1=geronimo/trunk/modules/assembly/src/plan/j2ee-runtime-deployer-plan.xml&r1=125988&p2=geronimo/trunk/modules/assembly/src/plan/j2ee-runtime-deployer-plan.xml&r2=125989
==============================================================================
--- geronimo/trunk/modules/assembly/src/plan/j2ee-runtime-deployer-plan.xml     
(original)
+++ geronimo/trunk/modules/assembly/src/plan/j2ee-runtime-deployer-plan.xml     
Fri Jan 21 16:26:15 2005
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!--
 
-    Copyright 2004 The Apache Software Foundation
+    Copyright 2004-2005 The Apache Software Foundation
 
     Licensed under the Apache License, Version 2.0 (the "License");
     you may not use this file except in compliance with the License.
@@ -73,13 +73,11 @@
 
     <gbean namePart="ServiceBuilder" type="ConfigBuilder" 
class="org.apache.geronimo.deployment.service.ServiceConfigBuilder">
         <attribute 
name="defaultParentId">org/apache/geronimo/Server</attribute>
-        <attribute name="j2eeServer" 
type="javax.management.ObjectName">geronimo.server:j2eeType=J2EEServer,name=geronimo</attribute>
         <reference name="Repository">*:name=Repository,*</reference>
     </gbean>
 
     <gbean namePart="EARBuilder" type="ConfigBuilder" 
class="org.apache.geronimo.j2ee.deployment.EARConfigBuilder">
         <attribute 
name="defaultParentId">org/apache/geronimo/Server</attribute>
-        <attribute name="j2eeServer" 
type="javax.management.ObjectName">geronimo.server:j2eeType=J2EEServer,name=geronimo</attribute>
         <attribute name="transactionContextManagerObjectName" 
type="javax.management.ObjectName">geronimo.server:name=TransactionContextManager,*</attribute>
         <attribute name="connectionTrackerObjectName" 
type="javax.management.ObjectName">geronimo.server:name=ConnectionTracker,*</attribute>
         <attribute name="transactionalTimerObjectName" 
type="javax.management.ObjectName">geronimo.server:name=TransactionalThreadPooledTimer,*</attribute>
@@ -91,7 +89,7 @@
         <reference 
name="ConnectorConfigBuilder">geronimo.server:name=ConnectorBuilder,J2EEModule=org/apache/geronimo/RuntimeDeployer,*</reference>
         <reference 
name="ResourceReferenceBuilder">geronimo.server:name=ConnectorBuilder,J2EEModule=org/apache/geronimo/RuntimeDeployer,*</reference>
         <reference 
name="AppClientConfigBuilder">geronimo.server:name=AppClientBuilder,J2EEModule=org/apache/geronimo/RuntimeDeployer,*</reference>
-        <reference 
name="ServiceReferenceBuilder">geronimo.server:name=WebServiceBuilder,J2EEModule=org/apache/geronimo/RuntimeDeployer,*</reference>
+        <reference 
name="ServiceReferenceBuilder">geronimo.server:J2EEApplication=null,J2EEModule=org/apache/geronimo/RuntimeDeployer,J2EEServer=geronimo,j2eeType=ModuleBuilder,name=WebServiceBuilder</reference>
     </gbean>
 
     <gbean namePart="WebBuilder" type="ModuleBuilder" 
class="org.apache.geronimo.jetty.deployment.JettyModuleBuilder">
@@ -138,24 +136,24 @@
 
     <gbean namePart="ConnectorBuilder" type="ModuleBuilder" 
class="org.apache.geronimo.connector.deployment.ConnectorModuleBuilder">
         <attribute 
name="defaultParentId">org/apache/geronimo/Server</attribute>
-        <attribute name="defaultMaxSize" type="int">10</attribute>
-        <attribute name="defaultMinSize" type="int">0</attribute>
-        <attribute name="defaultBlockingTimeoutMilliseconds" 
type="int">5000</attribute>
-        <attribute name="defaultIdleTimeoutMinutes" type="int">15</attribute>
-        <attribute name="defaultXATransactionCaching" 
type="boolean">true</attribute>
-        <attribute name="defaultXAThreadCaching" 
type="boolean">false</attribute>
+        <attribute name="defaultMaxSize">10</attribute>
+        <attribute name="defaultMinSize">0</attribute>
+        <attribute name="defaultBlockingTimeoutMilliseconds">5000</attribute>
+        <attribute name="defaultIdleTimeoutMinutes">15</attribute>
+        <attribute name="defaultXATransactionCaching">true</attribute>
+        <attribute name="defaultXAThreadCaching">false</attribute>
         <reference name="Repository">*:name=Repository,*</reference>
     </gbean>
 
     <gbean namePart="AppClientBuilder" type="ModuleBuilder" 
class="org.apache.geronimo.client.builder.AppClientModuleBuilder">
         <attribute 
name="defaultClientParentId">org/apache/geronimo/Client</attribute>
         <attribute 
name="defaultServerParentId">org/apache/geronimo/Server</attribute>
-        <attribute name="transactionContextManagerObjectName" 
type="javax.management.ObjectName">geronimo.server:name=TransactionContextManager,*</attribute>
-        <attribute name="connectionTrackerObjectName" 
type="javax.management.ObjectName">geronimo.server:name=ConnectionTracker,*</attribute>
+        <attribute 
name="transactionContextManagerObjectName">geronimo.client:name=TransactionContextManager,*</attribute>
+        <attribute 
name="connectionTrackerObjectName">geronimo.client:name=ConnectionTracker,*</attribute>
         <reference 
name="EJBReferenceBuilder">geronimo.server:name=ClientEJBReferenceBuilder,J2EEModule=org/apache/geronimo/RuntimeDeployer,*</reference>
         <reference 
name="ConnectorModuleBuilder">geronimo.server:name=ConnectorBuilder,J2EEModule=org/apache/geronimo/RuntimeDeployer,*</reference>
         <reference 
name="ResourceReferenceBuilder">geronimo.server:name=ConnectorBuilder,J2EEModule=org/apache/geronimo/RuntimeDeployer,*</reference>
-        <reference 
name="ServiceReferenceBuilder">geronimo.server:name=WebServiceBuilder,J2EEModule=org/apache/geronimo/RuntimeDeployer,*</reference>
+        <reference 
name="ServiceReferenceBuilder">geronimo.server:J2EEApplication=null,J2EEModule=org/apache/geronimo/RuntimeDeployer,J2EEServer=geronimo,j2eeType=ModuleBuilder,name=WebServiceBuilder</reference>
         <reference name="Store">*:j2eeType=ConfigurationStore,*</reference>
         <reference name="Repository">*:name=Repository,*</reference>
     </gbean>

Modified: geronimo/trunk/modules/assembly/src/plan/system-plan.xml
Url: 
http://svn.apache.org/viewcvs/geronimo/trunk/modules/assembly/src/plan/system-plan.xml?view=diff&rev=125989&p1=geronimo/trunk/modules/assembly/src/plan/system-plan.xml&r1=125988&p2=geronimo/trunk/modules/assembly/src/plan/system-plan.xml&r2=125989
==============================================================================
--- geronimo/trunk/modules/assembly/src/plan/system-plan.xml    (original)
+++ geronimo/trunk/modules/assembly/src/plan/system-plan.xml    Fri Jan 21 
16:26:15 2005
@@ -29,7 +29,8 @@
 <configuration
     xmlns="http://geronimo.apache.org/xml/ns/deployment";
     configId="org/apache/geronimo/System"
-    parentId=""
+    domain="geronimo.server"
+    server="geronimo"
     >
 
     <!-- ServerInfo service -->

Modified: 
geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/AxisBuilder.java
Url: 
http://svn.apache.org/viewcvs/geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/AxisBuilder.java?view=diff&rev=125989&p1=geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/AxisBuilder.java&r1=125988&p2=geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/AxisBuilder.java&r2=125989
==============================================================================
--- 
geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/AxisBuilder.java
      (original)
+++ 
geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/AxisBuilder.java
      Fri Jan 21 16:26:15 2005
@@ -17,6 +17,7 @@
 package org.apache.geronimo.axis.builder;
 
 import java.beans.Introspector;
+import java.io.File;
 import java.io.IOException;
 import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
@@ -64,26 +65,26 @@
 import org.apache.axis.enum.Style;
 import org.apache.axis.enum.Use;
 import org.apache.axis.soap.SOAPConstants;
-import org.apache.geronimo.axis.client.GenericServiceEndpoint;
 import org.apache.geronimo.axis.client.GenericServiceEndpointWrapper;
+import org.apache.geronimo.axis.client.NoOverrideCallbackFilter;
 import org.apache.geronimo.axis.client.OperationInfo;
 import org.apache.geronimo.axis.client.SEIFactory;
 import org.apache.geronimo.axis.client.SEIFactoryImpl;
-import org.apache.geronimo.axis.client.ServiceEndpointMethodInterceptor;
+import org.apache.geronimo.axis.client.SerializableNoOp;
 import org.apache.geronimo.axis.client.ServiceImpl;
 import org.apache.geronimo.axis.client.ServiceMethodInterceptor;
 import org.apache.geronimo.axis.client.ServiceReference;
-import org.apache.geronimo.axis.client.SerializableNoOp;
-import org.apache.geronimo.axis.client.NoOverrideCallbackFilter;
 import org.apache.geronimo.common.DeploymentException;
 import org.apache.geronimo.deployment.DeploymentContext;
+import org.apache.geronimo.gbean.GBeanInfo;
+import org.apache.geronimo.gbean.GBeanInfoBuilder;
 import org.apache.geronimo.j2ee.deployment.ServiceReferenceBuilder;
+import org.apache.geronimo.j2ee.deployment.Module;
 import org.apache.geronimo.xbeans.j2ee.JavaWsdlMappingDocument;
 import org.apache.geronimo.xbeans.j2ee.JavaWsdlMappingType;
-import org.apache.geronimo.gbean.GBeanInfo;
-import org.apache.geronimo.gbean.GBeanInfoBuilder;
 import org.apache.xmlbeans.XmlException;
 import org.objectweb.asm.Type;
+import org.xml.sax.InputSource;
 
 /**
  * @version $Rev:  $ $Date:  $
@@ -91,7 +92,7 @@
 public class AxisBuilder implements ServiceReferenceBuilder {
     private static final Class[] SERVICE_CONSTRUCTOR_TYPES = new 
Class[]{Map.class};
 
-    private static final URI ENHANCED_LOCATION = URI.create("cglib");
+    private static final URI ENHANCED_LOCATION = URI.create("cglib/");
     private static final SOAPConstants SOAP_VERSION = 
SOAPConstants.SOAP11_CONSTANTS;
 
     public ServiceReference createServiceReference(Class serviceInterface, URI 
wsdlURI, URI jaxrpcMappingURI, QName serviceQName, Map portComponentRefMap, 
List handlers, DeploymentContext deploymentContext, ClassLoader classLoader) 
throws DeploymentException {
@@ -111,8 +112,17 @@
         return new ServiceReference(enhanced, null, null);
     }
 
-    public Object createService(Class serviceInterface, URI wsdlURI, URI 
jaxrpcMappingURI, QName serviceQName, Map portComponentRefMap, List handlers, 
DeploymentContext deploymentContext, ClassLoader classLoader) throws 
DeploymentException {
-        URL wsdlURL = classLoader.getResource(wsdlURI.toString());
+    public Object createService(Class serviceInterface, URI wsdlURI, URI 
jaxrpcMappingURI, QName serviceQName, Map portComponentRefMap, List handlers, 
DeploymentContext deploymentContext, Module module, ClassLoader classLoader) 
throws DeploymentException {
+        String wsdlFile = null;
+        try {
+            wsdlFile = 
deploymentContext.getTargetFile(module.getTargetPathURI().resolve(wsdlURI)).toURL().toString();
+        } catch (MalformedURLException e) {
+            throw new DeploymentException("Could not resolve wsdlfile", e);
+        }
+        //TODO trying to read in the doc from the wsdlFile directly doesn't 
work in running geronimo, but does work in
+        //unit tests.  You get a java.net.UnknownServiceException with message 
"no content-type".  Perhaps something
+        //is wrong with the geronimo url handler??
+        InputSource is = new InputSource(wsdlFile);
         WSDLFactory wsdlFactory = null;
         try {
             wsdlFactory = WSDLFactory.newInstance();
@@ -120,17 +130,18 @@
             throw new DeploymentException("Could not create WSDLFactory", e);
         }
         WSDLReader wsdlReader = wsdlFactory.newWSDLReader();
+        wsdlReader.setFeature("javax.wsdl.importDocuments", false);
         Definition definition = null;
         try {
-            definition = wsdlReader.readWSDL(wsdlURL.toString());
+            definition = wsdlReader.readWSDL(null, is);
         } catch (WSDLException e) {
             throw new DeploymentException("Failed to read wsdl document", e);
         }
 
-        URL jaxrpcMappingURL = 
classLoader.getResource(jaxrpcMappingURI.toString());
+        File jaxrpcMappingFile = 
deploymentContext.getTargetFile(module.getTargetPathURI().resolve(jaxrpcMappingURI));
         JavaWsdlMappingDocument mappingDocument = null;
         try {
-            mappingDocument = 
JavaWsdlMappingDocument.Factory.parse(jaxrpcMappingURL);
+            mappingDocument = 
JavaWsdlMappingDocument.Factory.parse(jaxrpcMappingFile);
         } catch (XmlException e) {
             throw new DeploymentException("Could not parse jaxrpc mapping 
document", e);
         } catch (IOException e) {
@@ -138,17 +149,17 @@
         }
         JavaWsdlMappingType mapping = mappingDocument.getJavaWsdlMapping();
 
-        return createService(serviceInterface, definition, mapping, 
serviceQName, SOAP_VERSION, deploymentContext, classLoader);
+        return createService(serviceInterface, definition, mapping, 
serviceQName, SOAP_VERSION, deploymentContext, module, classLoader);
     }
 
-    public javax.xml.rpc.Service createService(Class serviceInterface, 
Definition definition, JavaWsdlMappingType mapping, QName serviceQName, 
SOAPConstants soapVersion, DeploymentContext context, ClassLoader classloader) 
throws DeploymentException {
+    public javax.xml.rpc.Service createService(Class serviceInterface, 
Definition definition, JavaWsdlMappingType mapping, QName serviceQName, 
SOAPConstants soapVersion, DeploymentContext context, Module module, 
ClassLoader classloader) throws DeploymentException {
         Map seiFactoryMap = new HashMap();
-        ServiceImpl serviceInstance = createService(serviceInterface, 
seiFactoryMap, context, classloader);
-        buildSEIFactoryMap(serviceInterface, definition, mapping, 
serviceQName, soapVersion, seiFactoryMap, serviceInstance, context, 
classloader);
+        ServiceImpl serviceInstance = createService(serviceInterface, 
seiFactoryMap, context, module, classloader);
+        buildSEIFactoryMap(serviceInterface, definition, mapping, 
serviceQName, soapVersion, seiFactoryMap, serviceInstance, context, module, 
classloader);
         return serviceInstance;
     }
 
-    public ServiceImpl createService(Class serviceInterface, Map 
seiFactoryMap, DeploymentContext deploymentContext, ClassLoader classLoader) 
throws DeploymentException {
+    public ServiceImpl createService(Class serviceInterface, Map 
seiFactoryMap, DeploymentContext deploymentContext, Module module, ClassLoader 
classLoader) throws DeploymentException {
 
         Callback callback = new ServiceMethodInterceptor(seiFactoryMap);
         Callback[] methodInterceptors = new 
Callback[]{SerializableNoOp.INSTANCE, callback};
@@ -164,7 +175,13 @@
         enhancer.setStrategy(strategy);
         Class serviceClass = enhancer.createClass();
 
-        saveClass(deploymentContext, serviceClass.getName(), 
strategy.getClassBytes());
+        try {
+            module.addClass(serviceClass.getName(), strategy.getClassBytes(), 
deploymentContext);
+        } catch (IOException e) {
+            throw new DeploymentException("Could not write out class bytes", 
e);
+        } catch (URISyntaxException e) {
+            throw new DeploymentException("Could not constuct URI for location 
of enhanced class", e);
+        }
         Enhancer.registerCallbacks(serviceClass, methodInterceptors);
         FastConstructor constructor = 
FastClass.create(serviceClass).getConstructor(SERVICE_CONSTRUCTOR_TYPES);
         try {
@@ -174,7 +191,7 @@
         }
     }
 
-    public Map buildSEIFactoryMap(Class serviceInterface, Definition 
definition, JavaWsdlMappingType mapping, QName serviceQName, SOAPConstants 
soapVersion, Map seiFactoryMap, ServiceImpl serviceImpl, DeploymentContext 
context, ClassLoader classloader) throws DeploymentException {
+    public Map buildSEIFactoryMap(Class serviceInterface, Definition 
definition, JavaWsdlMappingType mapping, QName serviceQName, SOAPConstants 
soapVersion, Map seiFactoryMap, ServiceImpl serviceImpl, DeploymentContext 
context, Module module, ClassLoader classloader) throws DeploymentException {
 
         //find the service we are working with
         javax.wsdl.Service service = definition.getService(serviceQName);
@@ -189,7 +206,7 @@
             String portName = (String) entry.getKey();
             Port port = (Port) entry.getValue();
             Class serviceEndpointInterface = 
getServiceEndpointInterface(serviceInterface, port);
-            Class enhancedServiceEndpointClass = 
enhanceServiceEndpointInterface(classloader, serviceEndpointInterface, context);
+            Class enhancedServiceEndpointClass = 
enhanceServiceEndpointInterface(serviceEndpointInterface, context, module, 
classloader);
 
             SOAPAddress soapAddress = (SOAPAddress) 
getExtensibilityElement(SOAPAddress.class, port.getExtensibilityElements());
             String locationURIString = soapAddress.getLocationURI();
@@ -290,7 +307,7 @@
         return factory;
     }
 
-    public Class enhanceServiceEndpointInterface(ClassLoader classLoader, 
Class serviceEndpointInterface, DeploymentContext deploymentContext) throws 
DeploymentException {
+    public Class enhanceServiceEndpointInterface(Class 
serviceEndpointInterface, DeploymentContext deploymentContext, Module module, 
ClassLoader classLoader) throws DeploymentException {
         Enhancer enhancer = new Enhancer();
         enhancer.setClassLoader(classLoader);
         enhancer.setSuperclass(GenericServiceEndpointWrapper.class);
@@ -302,7 +319,13 @@
         enhancer.setStrategy(strategy);
         Class serviceEndpointClass = enhancer.createClass();
 
-        saveClass(deploymentContext, serviceEndpointClass.getName(), 
strategy.getClassBytes());
+        try {
+            module.addClass(serviceEndpointClass.getName(), 
strategy.getClassBytes(), deploymentContext);
+        } catch (IOException e) {
+            throw new DeploymentException("Could not write out class bytes", 
e);
+        } catch (URISyntaxException e) {
+            throw new DeploymentException("Could not constuct URI for location 
of enhanced class", e);
+        }
         return serviceEndpointClass;
     }
 
@@ -402,7 +425,7 @@
 
     private void saveClass(DeploymentContext deploymentContext, String 
className, byte[] classBytes) throws DeploymentException {
         try {
-            deploymentContext.addClass(ENHANCED_LOCATION, className, 
classBytes);
+            deploymentContext.addClass(ENHANCED_LOCATION, className, 
classBytes, true);
         } catch (IOException e) {
             throw new DeploymentException("Could not save enhanced class 
bytes", e);
         } catch (URISyntaxException e) {

Modified: 
geronimo/trunk/modules/axis-builder/src/test/org/apache/geronimo/axis/builder/ServiceReferenceTest.java
Url: 
http://svn.apache.org/viewcvs/geronimo/trunk/modules/axis-builder/src/test/org/apache/geronimo/axis/builder/ServiceReferenceTest.java?view=diff&rev=125989&p1=geronimo/trunk/modules/axis-builder/src/test/org/apache/geronimo/axis/builder/ServiceReferenceTest.java&r1=125988&p2=geronimo/trunk/modules/axis-builder/src/test/org/apache/geronimo/axis/builder/ServiceReferenceTest.java&r2=125989
==============================================================================
--- 
geronimo/trunk/modules/axis-builder/src/test/org/apache/geronimo/axis/builder/ServiceReferenceTest.java
     (original)
+++ 
geronimo/trunk/modules/axis-builder/src/test/org/apache/geronimo/axis/builder/ServiceReferenceTest.java
     Fri Jan 21 16:26:15 2005
@@ -80,6 +80,8 @@
 import org.apache.geronimo.xbeans.j2ee.JavaWsdlMappingDocument;
 import org.apache.geronimo.xbeans.j2ee.JavaWsdlMappingType;
 import org.apache.geronimo.xbeans.j2ee.PackageMappingType;
+import org.apache.geronimo.j2ee.deployment.Module;
+import org.apache.geronimo.j2ee.deployment.EJBModule;
 
 /**
  * @version $Rev:  $ $Date:  $
@@ -94,13 +96,15 @@
     private ClassLoader isolatedCl = new URLClassLoader(new URL[0], 
this.getClass().getClassLoader());
     private final String operationName = "doMockOperation";
 
+    private final Module module = new EJBModule(true, configID, null, null, 
"ejb", null, null, null);
+
     private boolean runExternalWSTest;
 
     protected void setUp() throws Exception {
         tmpbasedir = File.createTempFile("car", "tmp");
         tmpbasedir.delete();
         tmpbasedir.mkdirs();
-        context = new DeploymentContext(tmpbasedir, configID, 
ConfigurationModuleType.CAR, null, null);
+        context = new DeploymentContext(tmpbasedir, configID, 
ConfigurationModuleType.CAR, null, "foo", "geronimo", null);
 
         runExternalWSTest = 
System.getProperty("geronimo.run.external.webservicetest", 
"false").equals("true");
     }
@@ -127,8 +131,7 @@
         Map portMap = new HashMap();
         portMap.put("MockPort", new MockSEIFactory());
         AxisBuilder builder = new AxisBuilder();
-        org.apache.axis.client.Service delegate = new 
org.apache.axis.client.Service();
-        Service service = builder.createService(MockService.class, portMap, 
context, isolatedCl);
+        Service service = builder.createService(MockService.class, portMap, 
context, module, isolatedCl);
         assertTrue(service instanceof MockService);
         MockService mockService = (MockService) service;
         MockPort mockPort = mockService.getMockPort();
@@ -145,7 +148,7 @@
 
         OperationInfo op = buildOperationInfoForMockOperation(builder);
         OperationInfo[] operationInfos = new OperationInfo[]{op};
-        Class serviceEndpointClass = 
builder.enhanceServiceEndpointInterface(isolatedCl, MockPort.class, context);
+        Class serviceEndpointClass = 
builder.enhanceServiceEndpointInterface(MockPort.class, context, module, 
isolatedCl);
         SEIFactory serviceInterfaceFactory = 
builder.createSEIFactory(serviceEndpointClass, serviceInstance, typeMappings, 
location, operationInfos, context, isolatedCl);
         assertNotNull(serviceInterfaceFactory);
         Remote serviceInterface = 
serviceInterfaceFactory.createServiceEndpoint();
@@ -165,7 +168,7 @@
         JavaWsdlMappingType mapping = buildLightweightMappingType();
         QName serviceQName = new QName(NAMESPACE, "MockService");
         AxisBuilder builder = new AxisBuilder();
-        Object proxy = builder.createService(MockService.class, definition, 
mapping, serviceQName, SOAPConstants.SOAP11_CONSTANTS, context, isolatedCl);
+        Object proxy = builder.createService(MockService.class, definition, 
mapping, serviceQName, SOAPConstants.SOAP11_CONSTANTS, context, module, 
isolatedCl);
         assertNotNull(proxy);
         assertTrue(proxy instanceof MockService);
         MockPort mockPort = ((MockService) proxy).getMockPort();
@@ -182,7 +185,7 @@
         JavaWsdlMappingType mapping = mappingDocument.getJavaWsdlMapping();
         QName serviceQName = new 
QName("http://www.Monson-Haefel.com/jwsbook/BookQuote";, "BookQuoteService");
         AxisBuilder builder = new AxisBuilder();
-        Object proxy = builder.createService(BookQuoteService.class, 
definition, mapping, serviceQName, SOAPConstants.SOAP11_CONSTANTS, context, 
isolatedCl);
+        Object proxy = builder.createService(BookQuoteService.class, 
definition, mapping, serviceQName, SOAPConstants.SOAP11_CONSTANTS, context, 
module, isolatedCl);
         assertNotNull(proxy);
         assertTrue(proxy instanceof BookQuoteService);
         BookQuote bookQuote = ((BookQuoteService) proxy).getBookQuotePort();
@@ -199,7 +202,7 @@
         JavaWsdlMappingType mapping = mappingDocument.getJavaWsdlMapping();
         QName serviceQName = new 
QName("http://tempuri.org/4s4c/1/3/wsdl/def/interopLab";, "interopLab");
         AxisBuilder builder = new AxisBuilder();
-        Object proxy = builder.createService(InteropLab.class, definition, 
mapping, serviceQName, SOAPConstants.SOAP11_CONSTANTS, context, isolatedCl);
+        Object proxy = builder.createService(InteropLab.class, definition, 
mapping, serviceQName, SOAPConstants.SOAP11_CONSTANTS, context, module, 
isolatedCl);
         assertNotNull(proxy);
         assertTrue(proxy instanceof InteropLab);
         InteropTestPortType interopTestPort = ((InteropLab) 
proxy).getinteropTestPort();
@@ -215,14 +218,18 @@
 
     public void testBuildInteropProxyFromURIs() throws Exception {
         File wsdldir = new File(basedir, "src/test-resources/interop");
-        ClassLoader cl = new URLClassLoader(new URL[]{wsdldir.toURL()}, 
isolatedCl);
-        URI wsdlURI = new URI("interop.wsdl");
-        URI jaxrpcmappingURI = new URI("interop-jaxrpcmapping.xml");
+        //ejb is from the EJBModule "ejb" targetPath.
+        context.addFile(new URI("ejb/META-INF/wsdl/interop.wsdl"), new 
File(wsdldir, "interop.wsdl"));
+        context.addFile(new 
URI("ejb/META-INF/wsdl/interop-jaxrpcmapping.xml"), new File(wsdldir, 
"interop-jaxrpcmapping.xml"));
+        ClassLoader cl = context.getClassLoader(null);
+                //new URLClassLoader(new URL[]{wsdldir.toURL()}, isolatedCl);
+        URI wsdlURI = new URI("META-INF/wsdl/interop.wsdl");
+        URI jaxrpcmappingURI = new 
URI("META-INF/wsdl/interop-jaxrpcmapping.xml");
         QName serviceQName = new 
QName("http://tempuri.org/4s4c/1/3/wsdl/def/interopLab";, "interopLab");
         AxisBuilder builder = new AxisBuilder();
         Map portComponentRefMap = null;
         List handlers = null;
-        Object proxy = builder.createService(InteropLab.class, wsdlURI, 
jaxrpcmappingURI, serviceQName, portComponentRefMap, handlers, context, cl);
+        Object proxy = builder.createService(InteropLab.class, wsdlURI, 
jaxrpcmappingURI, serviceQName, portComponentRefMap, handlers, context, module, 
cl);
         assertNotNull(proxy);
         ClassLoader contextCl = context.getClassLoader(null);
         proxy = reserialize(proxy, contextCl);

Modified: 
geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/AbstractWebServiceTest.java
Url: 
http://svn.apache.org/viewcvs/geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/AbstractWebServiceTest.java?view=diff&rev=125989&p1=geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/AbstractWebServiceTest.java&r1=125988&p2=geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/AbstractWebServiceTest.java&r2=125989
==============================================================================
--- 
geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/AbstractWebServiceTest.java
   (original)
+++ 
geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/AbstractWebServiceTest.java
   Fri Jan 21 16:26:15 2005
@@ -131,7 +131,6 @@
         
        EARConfigBuilder earConfigBuilder =
                 new EARConfigBuilder(defaultParentId,
-                        new ObjectName(j2eeDomainName + 
":j2eeType=J2EEServer,name=" + j2eeServerName),
                         transactionManagerObjectName,
                         connectionTrackerObjectName,
                         null,

Modified: 
geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/preconditions/DynamicEJBDeploymentTest.java
Url: 
http://svn.apache.org/viewcvs/geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/preconditions/DynamicEJBDeploymentTest.java?view=diff&rev=125989&p1=geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/preconditions/DynamicEJBDeploymentTest.java&r1=125988&p2=geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/preconditions/DynamicEJBDeploymentTest.java&r2=125989
==============================================================================
--- 
geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/preconditions/DynamicEJBDeploymentTest.java
   (original)
+++ 
geronimo/trunk/modules/axis/src/test/org/apache/geronimo/axis/preconditions/DynamicEJBDeploymentTest.java
   Fri Jan 21 16:26:15 2005
@@ -77,7 +77,6 @@
         
         EARConfigBuilder earConfigBuilder =
                 new EARConfigBuilder(defaultParentId,
-                        new ObjectName(j2eeDomainName + 
":j2eeType=J2EEServer,name=" + j2eeServerName),
                         transactionManagerObjectName,
                         connectionTrackerObjectName,
                         null,

Modified: 
geronimo/trunk/modules/client-builder/src/java/org/apache/geronimo/client/builder/AppClientModuleBuilder.java
Url: 
http://svn.apache.org/viewcvs/geronimo/trunk/modules/client-builder/src/java/org/apache/geronimo/client/builder/AppClientModuleBuilder.java?view=diff&rev=125989&p1=geronimo/trunk/modules/client-builder/src/java/org/apache/geronimo/client/builder/AppClientModuleBuilder.java&r1=125988&p2=geronimo/trunk/modules/client-builder/src/java/org/apache/geronimo/client/builder/AppClientModuleBuilder.java&r2=125989
==============================================================================
--- 
geronimo/trunk/modules/client-builder/src/java/org/apache/geronimo/client/builder/AppClientModuleBuilder.java
       (original)
+++ 
geronimo/trunk/modules/client-builder/src/java/org/apache/geronimo/client/builder/AppClientModuleBuilder.java
       Fri Jan 21 16:26:15 2005
@@ -18,6 +18,7 @@
 
 import java.io.File;
 import java.io.IOException;
+import java.net.MalformedURLException;
 import java.net.URI;
 import java.net.URISyntaxException;
 import java.net.URL;
@@ -84,8 +85,6 @@
     private final Repository repository;
     private final ConfigurationStore store;
 
-    private final String clientDomainName = "geronimo.client";
-    private final String clientServerName = "client";
     private final String clientApplicationName = "client-application";
     private final ObjectName transactionContextManagerObjectName;
     private final ObjectName connectionTrackerObjectName;
@@ -250,7 +249,7 @@
     }
 
     public void installModule(JarFile earFile, EARContext earContext, Module 
module) throws DeploymentException {
-        // extract the ejbJar file into a standalone packed jar file and add 
the contents to the output
+        // extract the app client jar file into a standalone packed jar file 
and add the contents to the output
         JarFile moduleFile = module.getModuleFile();
         try {
             
earContext.addIncludeAsPackedJar(URI.create(module.getTargetPath()), 
moduleFile);
@@ -311,8 +310,8 @@
             }
             appClientModuleGBeanData.setAttribute("deploymentDescriptor", 
null);
 
-            componentContext = buildComponentContext(earContext, 
appClientModule, appClient, geronimoAppClient, earClassLoader);
-            appClientModuleGBeanData.setAttribute("componentContext", 
componentContext);
+//            componentContext = buildComponentContext(earContext, 
appClientModule, appClient, geronimoAppClient, earClassLoader);
+//            appClientModuleGBeanData.setAttribute("componentContext", 
componentContext);
         } catch (Exception e) {
             throw new DeploymentException("Unable to initialize 
AppClientModule GBean", e);
         }
@@ -340,8 +339,6 @@
                             ConfigurationModuleType.APP_CLIENT,
                             clientParentId,
                             kernel,
-                            clientDomainName,
-                            clientServerName,
                             clientApplicationName,
                             transactionContextManagerObjectName,
                             connectionTrackerObjectName,
@@ -388,15 +385,33 @@
                             JarFile connectorFile;
                             if (resource.isSetExternalRar()) {
                                 path = resource.getExternalRar();
-                                URI pathURI = new URI(path);
+                                URI pathURI = null;
+                                try {
+                                    pathURI = new URI(path);
+                                } catch (URISyntaxException e) {
+                                    throw new DeploymentException("Bad path to 
external rar", e);
+                                }
                                 if (!repository.hasURI(pathURI)) {
                                     throw new DeploymentException("Missing rar 
in repository: " + path);
                                 }
-                                URL pathURL = repository.getURL(pathURI);
-                                connectorFile = new JarFile(pathURL.getFile());
+                                URL pathURL = null;
+                                try {
+                                    pathURL = repository.getURL(pathURI);
+                                } catch (MalformedURLException e) {
+                                    throw new DeploymentException("Could not 
locate external rar in repository", e);
+                                }
+                                try {
+                                    connectorFile = new 
JarFile(pathURL.getFile());
+                                } catch (IOException e) {
+                                    throw new DeploymentException("Could not 
access rar contents", e);
+                                }
                             } else {
                                 path = resource.getInternalRar();
-                                connectorFile = new 
NestedJarFile(appClientModule.getEarFile(), path);
+                                try {
+                                    connectorFile = new 
NestedJarFile(appClientModule.getEarFile(), path);
+                                } catch (IOException e) {
+                                    throw new DeploymentException("Could not 
locate connector inside ear", e);
+                                }
                             }
                             XmlObject connectorPlan = resource.getConnector();
                             Module connectorModule = 
connectorModuleBuilder.createModule(connectorPlan, connectorFile, path, null, 
null);
@@ -542,8 +557,8 @@
     private ReadOnlyContext buildComponentContext(EARContext earContext, 
AppClientModule appClientModule, ApplicationClientType appClient, 
GerApplicationClientType geronimoAppClient, ClassLoader cl) throws 
DeploymentException {
 
         return ENCConfigBuilder.buildComponentContext(earContext,
-                appClientModule.getModuleURI(),
-                null,
+                appClientModule,
+                null, //no user transaction yet
                 appClient.getEnvEntryArray(),
                 appClient.getEjbRefArray(), geronimoAppClient.getEjbRefArray(),
                 new EjbLocalRefType[0], null,
@@ -553,27 +568,6 @@
                 appClient.getServiceRefArray(),
                 cl);
 
-    }
-
-
-    private URI getDependencyURI(DependencyType dep) throws 
DeploymentException {
-        URI uri;
-        if (dep.isSetUri()) {
-            try {
-                uri = new URI(dep.getUri());
-            } catch (URISyntaxException e) {
-                throw new DeploymentException("Invalid dependency URI " + 
dep.getUri(), e);
-            }
-        } else {
-            // @todo support more than just jars
-            String id = dep.getGroupId() + "/jars/" + dep.getArtifactId() + 
'-' + dep.getVersion() + ".jar";
-            try {
-                uri = new URI(id);
-            } catch (URISyntaxException e) {
-                throw new DeploymentException("Unable to construct URI for 
groupId=" + dep.getGroupId() + ", artifactId=" + dep.getArtifactId() + ", 
version=" + dep.getVersion(), e);
-            }
-        }
-        return uri;
     }
 
     public static final GBeanInfo GBEAN_INFO;

Copied: 
geronimo/trunk/modules/connector-builder/src/test/org/apache/geronimo/connector/deployment/ConnectorModuleBuilderTest.java
 (from r125375, 
geronimo/trunk/modules/connector-builder/src/test/org/apache/geronimo/connector/deployment/RAR_1_0ConfigBuilderTest.java)
Url: 
http://svn.apache.org/viewcvs/geronimo/trunk/modules/connector-builder/src/test/org/apache/geronimo/connector/deployment/ConnectorModuleBuilderTest.java?view=diff&rev=125989&p1=geronimo/trunk/modules/connector-builder/src/test/org/apache/geronimo/connector/deployment/RAR_1_0ConfigBuilderTest.java&r1=125375&p2=geronimo/trunk/modules/connector-builder/src/test/org/apache/geronimo/connector/deployment/ConnectorModuleBuilderTest.java&r2=125989
==============================================================================
--- 
geronimo/trunk/modules/connector-builder/src/test/org/apache/geronimo/connector/deployment/RAR_1_0ConfigBuilderTest.java
    (original)
+++ 
geronimo/trunk/modules/connector-builder/src/test/org/apache/geronimo/connector/deployment/ConnectorModuleBuilderTest.java
  Fri Jan 21 16:26:15 2005
@@ -18,32 +18,37 @@
 package org.apache.geronimo.connector.deployment;
 
 import java.io.BufferedInputStream;
+import java.io.ByteArrayOutputStream;
 import java.io.File;
 import java.io.FileInputStream;
+import java.io.IOException;
 import java.io.InputStream;
 import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
 import java.net.MalformedURLException;
 import java.net.URI;
 import java.net.URL;
 import java.net.URLClassLoader;
 import java.sql.Connection;
 import java.sql.Statement;
-import java.util.ArrayList;
 import java.util.Collections;
 import java.util.List;
-import java.util.Set;
 import java.util.Map;
+import java.util.Set;
+import java.util.Iterator;
 import java.util.jar.JarFile;
+import javax.management.MalformedObjectNameException;
 import javax.management.ObjectName;
 import javax.sql.DataSource;
 import javax.xml.namespace.QName;
 
 import junit.framework.TestCase;
 import org.apache.geronimo.common.DeploymentException;
-import org.apache.geronimo.deployment.util.DeploymentUtil;
 import org.apache.geronimo.deployment.DeploymentContext;
+import org.apache.geronimo.deployment.util.DeploymentUtil;
 import org.apache.geronimo.gbean.GBeanData;
-import org.apache.geronimo.gbean.jmx.GBeanMBean;
+import org.apache.geronimo.gbean.GBeanInfo;
+import org.apache.geronimo.gbean.GBeanInfoBuilder;
 import org.apache.geronimo.j2ee.deployment.EARConfigBuilder;
 import org.apache.geronimo.j2ee.deployment.EARContext;
 import org.apache.geronimo.j2ee.deployment.Module;
@@ -55,22 +60,21 @@
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
 import org.apache.geronimo.j2ee.management.impl.J2EEServerImpl;
 import org.apache.geronimo.kernel.Kernel;
+import org.apache.geronimo.kernel.jmx.JMXUtil;
+import org.apache.geronimo.kernel.registry.BasicGBeanRegistry;
+import org.apache.geronimo.kernel.config.Configuration;
+import org.apache.geronimo.kernel.config.ConfigurationStore;
+import org.apache.geronimo.kernel.config.InvalidConfigException;
+import org.apache.geronimo.kernel.config.NoSuchConfigException;
 import org.apache.geronimo.kernel.management.State;
 import org.apache.geronimo.system.serverinfo.ServerInfo;
-import org.apache.geronimo.xbeans.geronimo.GerConnectorDocument;
-import org.apache.geronimo.schema.SchemaConversionUtils;
-import org.apache.xmlbeans.XmlOptions;
 import org.tranql.sql.jdbc.JDBCUtil;
 
 /**
  * @version $Rev$ $Date$
  */
-public class RAR_1_0ConfigBuilderTest extends TestCase {
+public class ConnectorModuleBuilderTest extends TestCase {
     private static final File basedir = new File(System.getProperty("basedir", 
System.getProperty("user.dir")));
-    private URL j2eeDD;
-    private URL geronimoDD;
-    XmlOptions xmlOptions;
-    private List errors;
     private boolean defaultXATransactionCaching = true;
     private boolean defaultXAThreadCaching = false;
     private int defaultMaxSize = 10;
@@ -80,15 +84,32 @@
     private URI defaultParentId;
 
 
-    public void testLoadGeronimoDeploymentDescriptor() throws Exception {
-        InputStream geronimoInputStream = geronimoDD.openStream();
-        GerConnectorDocument connectorDocument = 
GerConnectorDocument.Factory.parse(geronimoInputStream);
-        connectorDocument = 
(GerConnectorDocument)SchemaConversionUtils.convertToGeronimoServiceSchema(connectorDocument);
-        assertEquals(1, 
connectorDocument.getConnector().getResourceadapterArray().length);
-        if (!connectorDocument.validate(xmlOptions)) {
-            fail(errors.toString());
-        }
+    public void testBuildEar() throws Exception {
+        ObjectName connectionTrackerName = new 
ObjectName("geronimo.connector:service=ConnectionTracker");
+        JarFile rarFile = null;
+        Kernel kernel = new Kernel("foo", new BasicGBeanRegistry());
+        try {
+            kernel.boot();
+
+            GBeanData store = new 
GBeanData(JMXUtil.getObjectName("foo:j2eeType=ConfigurationStore,name=mock"), 
MockConfigStore.GBEAN_INFO);
+            kernel.loadGBean(store, this.getClass().getClassLoader());
+            kernel.startGBean(store.getName());
 
+            rarFile = DeploymentUtil.createJarFile(new File(basedir, 
"target/test-ear-noger.ear"));
+            EARConfigBuilder configBuilder = new 
EARConfigBuilder(defaultParentId, null, connectionTrackerName, null, null, 
null, null, null, null, new ConnectorModuleBuilder(defaultParentId, 
defaultMaxSize, defaultMinSize, defaultBlockingTimeoutMilliseconds, 
defaultidleTimeoutMinutes, defaultXATransactionCaching, defaultXAThreadCaching, 
null, kernel), null, null, null, kernel);
+            File tempDir = null;
+            try {
+                tempDir = DeploymentUtil.createTempDir();
+                File planFile = new File(basedir, 
"src/test-data/data/external-application-plan.xml");
+                Object plan = configBuilder.getDeploymentPlan(planFile, 
rarFile);
+                configBuilder.buildConfiguration(plan, rarFile, tempDir);
+            } finally {
+                DeploymentUtil.recursiveDelete(tempDir);
+            }
+        } finally {
+            kernel.shutdown();
+            DeploymentUtil.close(rarFile);
+        }
     }
 
     public void testBuildUnpackedModule() throws Exception {
@@ -97,7 +118,7 @@
                 return new File(basedir, "target/test-rar-10");
             }
         };
-        executeTestBuildModule(action);
+        executeTestBuildModule(action, false);
     }
 
     public void testBuildUnpackedAltSpecDDModule() throws Exception {
@@ -115,7 +136,7 @@
             }
         };
         try {
-            executeTestBuildModule(action);
+            executeTestBuildModule(action, false);
             fail("Spec alt-dd does not exist.");
         } catch (DeploymentException e) {
         }
@@ -137,7 +158,7 @@
             }
         };
         try {
-            executeTestBuildModule(action);
+            executeTestBuildModule(action, false);
             fail("Vendor alt-dd does not exist.");
         } catch (DeploymentException e) {
         }
@@ -157,8 +178,8 @@
             public File getRARFile() {
                 return new File(basedir, "target/test-rar-10");
             }
-       };
-        executeTestBuildModule(action);
+        };
+        executeTestBuildModule(action, false);
     }
 
     public void testBuildPackedModule() throws Exception {
@@ -167,122 +188,146 @@
                 return new File(basedir, "target/test-rar-10.rar");
             }
         };
-        executeTestBuildModule(action);
+        executeTestBuildModule(action, false);
     }
 
-    private void executeTestBuildModule(InstallAction action) throws Exception 
{
-        J2eeContext j2eeContext = new J2eeContextImpl("test.domain", 
"testServer", "null", "org/apache/geronimo/j2ee/deployment/test", null, null);
-        ObjectName connectionTrackerName = new 
ObjectName("geronimo.connector:service=ConnectionTracker");
+    //1.5 tests
+    public void testBuildUnpackedModule15() throws Exception {
+        InstallAction action = new InstallAction() {
+            private File rarFile = new File(basedir, "target/test-rar-15");
 
-        Kernel kernel = new Kernel("testServer");
-        ConnectorModuleBuilder moduleBuilder = new 
ConnectorModuleBuilder(defaultParentId, defaultMaxSize, defaultMinSize, 
defaultBlockingTimeoutMilliseconds, defaultidleTimeoutMinutes, 
defaultXATransactionCaching, defaultXAThreadCaching, null, kernel);
-        File rarFile = action.getRARFile();
+            public File getRARFile() {
+                return rarFile;
+            }
 
-        ClassLoader oldCl = Thread.currentThread().getContextClassLoader();
-        ClassLoader cl = new URLClassLoader(new URL[]{rarFile.toURL()}, oldCl);
+        };
+        executeTestBuildModule(action, true);
+    }
 
-        Thread.currentThread().setContextClassLoader(cl);
 
-        JarFile rarJarFile = DeploymentUtil.createJarFile(rarFile);
-        Module module = moduleBuilder.createModule(action.getVendorDD(), 
rarJarFile, j2eeContext.getJ2eeModuleName(), action.getSpecDD(), null);
-        if (module == null) {
-            throw new DeploymentException("Was not a connector module");
-        }
+    public void testBuildPackedModule15() throws Exception {
+        InstallAction action = new InstallAction() {
+            private File rarFile = new File(basedir, "target/test-rar-15.rar");
 
-        File tempDir = null;
-        try {
-            tempDir = DeploymentUtil.createTempDir();
-            EARContext earContext = new EARContext(tempDir,
-                    module.getConfigId(),
-                    module.getType(),
-                    module.getParentId(),
-                    null,
-                    j2eeContext.getJ2eeDomainName(),
-                    j2eeContext.getJ2eeServerName(),
-                    j2eeContext.getJ2eeApplicationName(),
-                    null,
-                    connectionTrackerName,
-                    null,
-                    null,
-                    new RefContext(null,
-                            moduleBuilder,
-                            new ServiceReferenceBuilder() {
-                        //it could return a Service or a Reference, we don't 
care
-                        public Object createService(Class serviceInterface, 
URI wsdlURI, URI jaxrpcMappingURI, QName serviceQName, Map portComponentRefMap, 
List handlers, DeploymentContext deploymentContext, ClassLoader classLoader) 
throws DeploymentException {
-                            return null;
-                        }
-                    }));
-
-            action.install(moduleBuilder, earContext, module);
-            earContext.getClassLoader(null);
-            moduleBuilder.initContext(earContext, module, cl);
-            moduleBuilder.addGBeans(earContext, module, cl);
-            earContext.close();
+            public File getRARFile() {
+                return rarFile;
+            }
 
-            verifyDeployment(tempDir, j2eeContext, oldCl);
-        } finally {
-            module.close();
-            DeploymentUtil.recursiveDelete(tempDir);
-        }
+        };
+        executeTestBuildModule(action, true);
     }
 
-    public void testBuildEar() throws Exception {
-        String j2eeDomainName = "geronimo.server";
-        String j2eeServerName = "TestGeronimoServer";
+
+    private void executeTestBuildModule(InstallAction action, boolean is15) 
throws Exception {
+        J2eeContext j2eeContext = new J2eeContextImpl("test", "bar", "null", 
"org/apache/geronimo/j2ee/deployment/test", null, null);
+        String resourceAdapterName = "testRA";
         ObjectName connectionTrackerName = new 
ObjectName("geronimo.connector:service=ConnectionTracker");
-        ObjectName j2eeServer = new ObjectName(j2eeDomainName + ":name=" + 
j2eeServerName);
-        Kernel kernel = new Kernel("blah");
-        kernel.boot();
-        JarFile rarFile = null;
+
+        Kernel kernel = new Kernel("foo", new BasicGBeanRegistry());
         try {
-            rarFile = DeploymentUtil.createJarFile(new File(basedir, 
"target/test-ear-noger.ear"));
-            EARConfigBuilder configBuilder = new 
EARConfigBuilder(defaultParentId, j2eeServer, null, connectionTrackerName, 
null, null, null, null, null, null, new ConnectorModuleBuilder(defaultParentId, 
defaultMaxSize, defaultMinSize, defaultBlockingTimeoutMilliseconds, 
defaultidleTimeoutMinutes, defaultXATransactionCaching, defaultXAThreadCaching, 
null, kernel), null, null, null, kernel);
+            kernel.boot();
+
+            GBeanData store = new 
GBeanData(JMXUtil.getObjectName("foo:j2eeType=ConfigurationStore,name=mock"), 
MockConfigStore.GBEAN_INFO);
+            kernel.loadGBean(store, this.getClass().getClassLoader());
+            kernel.startGBean(store.getName());
+            ConnectorModuleBuilder moduleBuilder = new 
ConnectorModuleBuilder(defaultParentId, defaultMaxSize, defaultMinSize, 
defaultBlockingTimeoutMilliseconds, defaultidleTimeoutMinutes, 
defaultXATransactionCaching, defaultXAThreadCaching, null, kernel);
+            File rarFile = action.getRARFile();
+
+            ClassLoader oldCl = Thread.currentThread().getContextClassLoader();
+            ClassLoader cl = new URLClassLoader(new URL[]{rarFile.toURL()}, 
oldCl);
+
+            Thread.currentThread().setContextClassLoader(cl);
+
+            JarFile rarJarFile = DeploymentUtil.createJarFile(rarFile);
+            Module module = moduleBuilder.createModule(action.getVendorDD(), 
rarJarFile, j2eeContext.getJ2eeModuleName(), action.getSpecDD(), null);
+            if (module == null) {
+                throw new DeploymentException("Was not a connector module");
+            }
+            assertEquals(j2eeContext.getJ2eeModuleName(), 
module.getConfigId().toString());
+
             File tempDir = null;
             try {
                 tempDir = DeploymentUtil.createTempDir();
-                File planFile = new File(basedir, 
"src/test-data/data/external-application-plan.xml");
-                Object plan = configBuilder.getDeploymentPlan(planFile, 
rarFile);
-                configBuilder.buildConfiguration(plan, rarFile, tempDir);
+                EARContext earContext = new EARContext(tempDir,
+                        module.getConfigId(),
+                        module.getType(),
+                        module.getParentId(),
+                        kernel,
+                        j2eeContext.getJ2eeApplicationName(),
+                        null,
+                        connectionTrackerName,
+                        null,
+                        null,
+                        new RefContext(null,
+                                moduleBuilder,
+                                new ServiceReferenceBuilder() {
+                                    //it could return a Service or a 
Reference, we don't care
+                                    public Object createService(Class 
serviceInterface, URI wsdlURI, URI jaxrpcMappingURI, QName serviceQName, Map 
portComponentRefMap, List handlers, DeploymentContext deploymentContext, Module 
module, ClassLoader classLoader) {
+                                        return null;
+                                    }
+                                }));
+
+                action.install(moduleBuilder, earContext, module);
+                earContext.getClassLoader(null);
+                moduleBuilder.initContext(earContext, module, cl);
+                moduleBuilder.addGBeans(earContext, module, cl);
+                earContext.close();
+
+                verifyDeployment(tempDir, oldCl, j2eeContext, 
resourceAdapterName, is15);
             } finally {
+                module.close();
                 DeploymentUtil.recursiveDelete(tempDir);
             }
         } finally {
             kernel.shutdown();
-            DeploymentUtil.close(rarFile);
         }
     }
 
-
-    private void verifyDeployment(File unpackedDir, J2eeContext j2eeContext, 
ClassLoader cl) throws Exception {
+    private void verifyDeployment(File unpackedDir, ClassLoader cl, 
J2eeContext j2eeContext, String resourceAdapterName, boolean is15) throws 
Exception {
         DataSource ds = null;
         Kernel kernel = null;
         try {
-            GBeanMBean config = loadConfig(unpackedDir, cl);
+            GBeanData config = loadConfig(unpackedDir);
+            ObjectName objectName = 
ObjectName.getInstance("test:configuration=test-ejb-jar");
+            config.setName(objectName);
 
-            kernel = new Kernel("blah");
+            kernel = new Kernel("bar", new BasicGBeanRegistry());
             kernel.boot();
+            GBeanData store = new 
GBeanData(JMXUtil.getObjectName("foo:j2eeType=ConfigurationStore,name=mock"), 
MockConfigStore.GBEAN_INFO);
+            kernel.loadGBean(store, this.getClass().getClassLoader());
+            kernel.startGBean(store.getName());
+
+            GBeanData baseConfig = (GBeanData) kernel.invoke(store.getName(), 
"getConfiguration", new Object[]{defaultParentId}, new 
String[]{URI.class.getName()});
+            kernel.loadGBean(baseConfig, this.getClass().getClassLoader());
+            kernel.startGBean(baseConfig.getName());
 
-            GBeanMBean serverInfoGBean = new GBeanMBean(ServerInfo.GBEAN_INFO);
+            ObjectName serverInfoObjectName = 
ObjectName.getInstance(j2eeContext.getJ2eeDomainName() + ":name=ServerInfo");
+            GBeanData serverInfoGBean = new GBeanData(serverInfoObjectName, 
ServerInfo.GBEAN_INFO);
             serverInfoGBean.setAttribute("baseDirectory", ".");
-            ObjectName serverInfoObjectName = 
ObjectName.getInstance(j2eeContext.getJ2eeDomainName() + ":type=ServerInfo");
-            kernel.loadGBean(serverInfoObjectName, serverInfoGBean);
+            kernel.loadGBean(serverInfoGBean, cl);
             kernel.startGBean(serverInfoObjectName);
             assertRunning(kernel, serverInfoObjectName);
 
-            GBeanMBean j2eeServerGBean = new 
GBeanMBean(J2EEServerImpl.GBEAN_INFO);
-            j2eeServerGBean.setReferencePatterns("ServerInfo", 
Collections.singleton(serverInfoObjectName));
             ObjectName j2eeServerObjectName = NameFactory.getServerName(null, 
null, j2eeContext);
-            kernel.loadGBean(j2eeServerObjectName, j2eeServerGBean);
+            GBeanData j2eeServerGBean = new GBeanData(j2eeServerObjectName, 
J2EEServerImpl.GBEAN_INFO);
+            j2eeServerGBean.setReferencePatterns("ServerInfo", 
Collections.singleton(serverInfoObjectName));
+            kernel.loadGBean(j2eeServerGBean, cl);
             kernel.startGBean(j2eeServerObjectName);
             assertRunning(kernel, j2eeServerObjectName);
 
             // load the configuration
-            ObjectName objectName = 
ObjectName.getInstance("test:configuration=test-ejb-jar");
-            kernel.loadGBean(objectName, config);
             config.setAttribute("baseURL", unpackedDir.toURL());
+            kernel.loadGBean(config, cl);
 
             // start the configuration
             kernel.startRecursiveGBean(objectName);
+            Set gb = kernel.listGBeans(JMXUtil.getObjectName("test:*"));
+            for (Iterator iterator = gb.iterator(); iterator.hasNext();) {
+                ObjectName name = (ObjectName) iterator.next();
+                if (State.RUNNING_INDEX != ((Integer) 
kernel.getAttribute(name, "state")).intValue()) {
+                    System.out.println("Not running: " + name);
+                }
+            }
             assertRunning(kernel, objectName);
 
             ObjectName applicationObjectName = 
NameFactory.getApplicationName(null, null, null, j2eeContext);
@@ -296,6 +341,41 @@
             ObjectName moduleName = NameFactory.getModuleName(null, null, 
null, null, NameFactory.RESOURCE_ADAPTER_MODULE, j2eeContext);
             assertRunning(kernel, moduleName);
 
+            //1.5 only
+            if (is15) {
+                Map activationSpecInfoMap = (Map) 
kernel.getAttribute(moduleName, "activationSpecInfoMap");
+                assertEquals(1, activationSpecInfoMap.size());
+                GBeanData activationSpecInfo = (GBeanData) 
activationSpecInfoMap.get("javax.jms.MessageListener");
+                assertNotNull(activationSpecInfo);
+                GBeanInfo activationSpecGBeanInfo = 
activationSpecInfo.getGBeanInfo();
+                List attributes1 = 
activationSpecGBeanInfo.getPersistentAttributes();
+                assertEquals(2, attributes1.size());
+
+                Map adminObjectInfoMap = (Map) kernel.getAttribute(moduleName, 
"adminObjectInfoMap");
+                assertEquals(1, adminObjectInfoMap.size());
+                GBeanData adminObjectInfo = (GBeanData) 
adminObjectInfoMap.get("org.apache.geronimo.connector.mock.MockAdminObject");
+                assertNotNull(adminObjectInfo);
+                GBeanInfo adminObjectGBeanInfo = 
adminObjectInfo.getGBeanInfo();
+                List attributes2 = 
adminObjectGBeanInfo.getPersistentAttributes();
+                assertEquals(3, attributes2.size());
+
+                // ResourceAdapter
+                ObjectName resourceAdapterObjectName = 
NameFactory.getResourceComponentName(null, null, null, null, 
resourceAdapterName, NameFactory.JCA_RESOURCE_ADAPTER, j2eeContext);
+
+                assertRunning(kernel, resourceAdapterObjectName);
+                assertAttributeValue(kernel, resourceAdapterObjectName, 
"RAStringProperty", "NewStringValue");
+
+                //both, except 1.0 has only one mcf type
+                Map managedConnectionFactoryInfoMap = (Map) 
kernel.getAttribute(moduleName, "managedConnectionFactoryInfoMap");
+                assertEquals(2, managedConnectionFactoryInfoMap.size());
+                GBeanData managedConnectionFactoryInfo = (GBeanData) 
managedConnectionFactoryInfoMap.get("javax.resource.cci.ConnectionFactory");
+                assertNotNull(managedConnectionFactoryInfo);
+                GBeanInfo managedConnectionFactoryGBeanInfo = 
managedConnectionFactoryInfo.getGBeanInfo();
+                List attributes3 = 
managedConnectionFactoryGBeanInfo.getPersistentAttributes();
+                assertEquals(11, attributes3.size());
+            }
+
+
             // FirstTestOutboundConnectionFactory
             ObjectName firstConnectionManagerFactory = 
NameFactory.getResourceComponentName(null, null, null, null, 
"FirstTestOutboundConnectionFactory", NameFactory.JCA_CONNECTION_MANAGER, 
j2eeContext);
             assertRunning(kernel, firstConnectionManagerFactory);
@@ -309,6 +389,9 @@
 
             ObjectName firstOutMCF = 
NameFactory.getResourceComponentName(null, null, null, null, 
"FirstTestOutboundConnectionFactory", 
NameFactory.JCA_MANAGED_CONNECTION_FACTORY, j2eeContext);
             assertRunning(kernel, firstOutMCF);
+            assertAttributeValue(kernel, firstOutMCF, 
"OutboundStringProperty1", "newvalue1");
+            assertAttributeValue(kernel, firstOutMCF, 
"OutboundStringProperty2", "originalvalue2");
+            assertAttributeValue(kernel, firstOutMCF, 
"OutboundStringProperty3", "newvalue2");
 
             // SecondTestOutboundConnectionFactory
             ObjectName secondConnectionManagerFactory = 
NameFactory.getResourceComponentName(null, null, null, null, 
"SecondTestOutboundConnectionFactory", NameFactory.JCA_CONNECTION_MANAGER, 
j2eeContext);
@@ -332,6 +415,19 @@
             ObjectName thirdOutMCF = 
NameFactory.getResourceComponentName(null, null, null, null, 
"ThirdTestOutboundConnectionFactory", 
NameFactory.JCA_MANAGED_CONNECTION_FACTORY, j2eeContext);
             assertRunning(kernel, thirdOutMCF);
 
+            // 1.5 only
+            //  Admin objects
+            //
+
+            if (is15) {
+                ObjectName tweedledeeAdminObject = 
NameFactory.getResourceComponentName(null, null, null, null, "tweedledee", 
NameFactory.JCA_ADMIN_OBJECT, j2eeContext);
+                assertRunning(kernel, tweedledeeAdminObject);
+
+                ObjectName tweedledumAdminObject = 
NameFactory.getResourceComponentName(null, null, null, null, "tweedledum", 
NameFactory.JCA_ADMIN_OBJECT, j2eeContext);
+                assertRunning(kernel, tweedledumAdminObject);
+            }
+
+
             kernel.stopGBean(objectName);
         } finally {
             if (ds != null) {
@@ -354,32 +450,30 @@
         }
     }
 
+    private void assertAttributeValue(Kernel kernel, ObjectName objectName, 
String attributeName, String attributeValue) throws Exception {
+        Object value = kernel.getAttribute(objectName, attributeName);
+        assertEquals(attributeValue, value);
+    }
+
     private void assertRunning(Kernel kernel, ObjectName objectName) throws 
Exception {
         int state = ((Integer) kernel.getAttribute(objectName, 
"state")).intValue();
         assertEquals(State.RUNNING_INDEX, state);
     }
 
-    private GBeanMBean loadConfig(File unpackedCar, ClassLoader classLoader) 
throws Exception {
+    private GBeanData loadConfig(File unpackedCar) throws Exception {
         InputStream in = new FileInputStream(new File(unpackedCar, 
"META-INF/config.ser"));
         try {
             ObjectInputStream ois = new ObjectInputStream(new 
BufferedInputStream(in));
             GBeanData config = new GBeanData();
             config.readExternal(ois);
-            return new GBeanMBean(config, classLoader);
+            return config;
         } finally {
             in.close();
         }
     }
 
     protected void setUp() throws Exception {
-        defaultParentId = null;//new URI("org/apache/geronimo/Server");
-        File docDir = new File(basedir, "src/test-data/connector_1_0");
-        j2eeDD = new File(docDir, "ra.xml").toURL();
-        geronimoDD = new File(docDir, "geronimo-ra.xml").toURL();
-        xmlOptions = new XmlOptions();
-        xmlOptions.setLoadLineNumbers();
-        errors = new ArrayList();
-        xmlOptions.setErrorListener(errors);
+        defaultParentId = new URI("org/apache/geronimo/Server");
     }
 
     private abstract class InstallAction {
@@ -397,5 +491,76 @@
             moduleBuilder.installModule(module.getModuleFile(), earContext, 
module);
         }
     }
+
+    public static class MockConfigStore implements ConfigurationStore {
+        public URI install(URL source) throws IOException, 
InvalidConfigException {
+            return null;
+        }
+
+        public URI install(File source) throws IOException, 
InvalidConfigException {
+            return null;
+        }
+
+        public void uninstall(URI configID) throws NoSuchConfigException, 
IOException {
+
+        }
+
+        public boolean containsConfiguration(URI configID) {
+            return true;
+        }
+
+        public GBeanData getConfiguration(URI id) throws 
NoSuchConfigException, IOException, InvalidConfigException {
+            GBeanData configData = null;
+            try {
+                configData = new 
GBeanData(Configuration.getConfigurationObjectName(id), 
Configuration.GBEAN_INFO);
+            } catch (MalformedObjectNameException e) {
+                throw new InvalidConfigException(e);
+            }
+            configData.setAttribute("ID", id);
+            configData.setAttribute("domain", "test");
+            configData.setAttribute("server", "bar");
+            configData.setAttribute("gBeanState", NO_OBJECTS_OS);
+            return configData;
+        }
+
+        public void updateConfiguration(Configuration configuration) throws 
NoSuchConfigException, Exception {
+
+        }
+
+        public URL getBaseURL(URI id) throws NoSuchConfigException {
+            return null;
+        }
+
+        public String getObjectName() {
+            return null;
+        }
+
+        public List listConfiguations() {
+            return null;
+        }
+
+        public File createNewConfigurationDir() {
+            return null;
+        }
+
+        public final static GBeanInfo GBEAN_INFO;
+
+        private static final byte[] NO_OBJECTS_OS;
+
+        static {
+            GBeanInfoBuilder infoBuilder = new 
GBeanInfoBuilder(MockConfigStore.class);
+            infoBuilder.addInterface(ConfigurationStore.class);
+            GBEAN_INFO = infoBuilder.getBeanInfo();
+
+            ByteArrayOutputStream baos = new ByteArrayOutputStream();
+            try {
+                ObjectOutputStream oos = new ObjectOutputStream(baos);
+                oos.flush();
+                NO_OBJECTS_OS = baos.toByteArray();
+            } catch (IOException e) {
+                throw new RuntimeException(e);
+            }
+        }
+    };
 
 }

Modified: 
geronimo/trunk/modules/connector-builder/src/test/org/apache/geronimo/connector/deployment/PlanParsingTest.java
Url: 
http://svn.apache.org/viewcvs/geronimo/trunk/modules/connector-builder/src/test/org/apache/geronimo/connector/deployment/PlanParsingTest.java?view=diff&rev=125989&p1=geronimo/trunk/modules/connector-builder/src/test/org/apache/geronimo/connector/deployment/PlanParsingTest.java&r1=125988&p2=geronimo/trunk/modules/connector-builder/src/test/org/apache/geronimo/connector/deployment/PlanParsingTest.java&r2=125989
==============================================================================
--- 
geronimo/trunk/modules/connector-builder/src/test/org/apache/geronimo/connector/deployment/PlanParsingTest.java
     (original)
+++ 
geronimo/trunk/modules/connector-builder/src/test/org/apache/geronimo/connector/deployment/PlanParsingTest.java
     Fri Jan 21 16:26:15 2005
@@ -5,6 +5,7 @@
 import junit.framework.TestCase;
 import org.apache.geronimo.schema.SchemaConversionUtils;
 import org.apache.geronimo.xbeans.geronimo.GerConnectorDocument;
+import org.apache.geronimo.xbeans.j2ee.ConnectorDocument;
 import org.apache.xmlbeans.XmlException;
 import org.apache.xmlbeans.XmlObject;
 
@@ -12,7 +13,37 @@
  */
 public class PlanParsingTest extends TestCase {
 
-    File basedir = new File(System.getProperty("basedir", "."));
+    File basedir = new File(System.getProperty("basedir", 
System.getProperty("user.dir")));
+
+    public void testLoadGeronimoDeploymentDescriptor10() throws Exception {
+        File geronimoDD = new File(basedir, 
"src/test-data/connector_1_0/geronimo-ra.xml");
+        assertTrue(geronimoDD.exists());
+        XmlObject plan = SchemaConversionUtils.parse(geronimoDD.toURL());
+        GerConnectorDocument connectorDocument = (GerConnectorDocument) 
plan.changeType(GerConnectorDocument.type);
+        connectorDocument = 
(GerConnectorDocument)SchemaConversionUtils.convertToGeronimoServiceSchema(connectorDocument);
+        SchemaConversionUtils.validateDD(connectorDocument);
+        assertEquals(1, 
connectorDocument.getConnector().getResourceadapterArray().length);
+    }
+
+    public void testLoadJ2eeDeploymentDescriptor() throws Exception {
+        File j2eeDD = new File(basedir, "src/test-data/connector_1_5/ra.xml");
+        assertTrue(j2eeDD.exists());
+        XmlObject plan = SchemaConversionUtils.parse(j2eeDD.toURL());
+        ConnectorDocument connectorDocument = (ConnectorDocument) 
plan.changeType(ConnectorDocument.type);
+        assertNotNull(connectorDocument.getConnector().getResourceadapter());
+        SchemaConversionUtils.validateDD(connectorDocument);
+    }
+
+    public void testLoadGeronimoDeploymentDescriptor15() throws Exception {
+        File geronimoDD = new File(basedir, 
"src/test-data/connector_1_5/geronimo-ra.xml");
+        assertTrue(geronimoDD.exists());
+        XmlObject plan = SchemaConversionUtils.parse(geronimoDD.toURL());
+        GerConnectorDocument connectorDocument = (GerConnectorDocument) 
plan.changeType(GerConnectorDocument.type);
+        connectorDocument = (GerConnectorDocument) 
SchemaConversionUtils.convertToGeronimoServiceSchema(connectorDocument);
+        connectorDocument = (GerConnectorDocument) 
SchemaConversionUtils.convertToGeronimoNamingSchema(connectorDocument);
+        assertEquals(1, 
connectorDocument.getConnector().getResourceadapterArray().length);
+        SchemaConversionUtils.validateDD(connectorDocument);
+    }
 
     public void testResourceAdapterNameUniqueness() throws Exception {
         File resourcePlan = new File(basedir, 
"src/test-data/data/dup-resourceadapter-name.xml");

Deleted: 
/geronimo/trunk/modules/connector-builder/src/test/org/apache/geronimo/connector/deployment/RAR_1_0ConfigBuilderTest.java
Url: 
http://svn.apache.org/viewcvs/geronimo/trunk/modules/connector-builder/src/test/org/apache/geronimo/connector/deployment/RAR_1_0ConfigBuilderTest.java?view=auto&rev=125988
==============================================================================

Deleted: 
/geronimo/trunk/modules/connector-builder/src/test/org/apache/geronimo/connector/deployment/RAR_1_5ConfigBuilderTest.java
Url: 
http://svn.apache.org/viewcvs/geronimo/trunk/modules/connector-builder/src/test/org/apache/geronimo/connector/deployment/RAR_1_5ConfigBuilderTest.java?view=auto&rev=125988
==============================================================================

Modified: 
geronimo/trunk/modules/deploy-tool/src/java/org/apache/geronimo/deployment/Bootstrap.java
Url: 
http://svn.apache.org/viewcvs/geronimo/trunk/modules/deploy-tool/src/java/org/apache/geronimo/deployment/Bootstrap.java?view=diff&rev=125989&p1=geronimo/trunk/modules/deploy-tool/src/java/org/apache/geronimo/deployment/Bootstrap.java&r1=125988&p2=geronimo/trunk/modules/deploy-tool/src/java/org/apache/geronimo/deployment/Bootstrap.java&r2=125989
==============================================================================
--- 
geronimo/trunk/modules/deploy-tool/src/java/org/apache/geronimo/deployment/Bootstrap.java
   (original)
+++ 
geronimo/trunk/modules/deploy-tool/src/java/org/apache/geronimo/deployment/Bootstrap.java
   Fri Jan 21 16:26:15 2005
@@ -163,38 +163,42 @@
                 startupJarTag.createNewFile();
 
                 // jar up the directory
-                DeploymentUtil.jarDirectory(configurationDir,  new 
File(deployerJar));
+                DeploymentUtil.jarDirectory(configurationDir, new 
File(deployerJar));
 
                 // delete the startup file before moving this to the config 
store
                 startupJarTag.delete();
 
                 // install the configuration
                 configStore.install(configurationDir);
-            } catch(Throwable e) {
+            } catch (Throwable e) {
                 DeploymentUtil.recursiveDelete(configurationDir);
                 if (e instanceof Error) {
-                    throw (Error)e;
+                    throw (Error) e;
                 } else if (e instanceof Exception) {
-                    throw (Exception)e;
+                    throw (Exception) e;
                 }
                 throw new Error(e);
             }
+            
+            //get the domain and server from the parent xml config
+            String domain = deployerSystemConfig.getDomain();
+            String server = deployerSystemConfig.getServer();
 
             // build and install the j2ee-deployer configuration
             try {
                 configurationDir = configStore.createNewConfigurationDir();
 
                 // build the j2ee-deployer configuration into the 
configurationDir
-                builder.buildConfiguration(j2eeDeployerConfig, null, 
configurationDir);
+                builder.buildConfiguration(j2eeDeployerConfig, domain, server, 
configurationDir);
 
                 // install the configuration
                 configStore.install(configurationDir);
-            } catch(Throwable e) {
+            } catch (Throwable e) {
                 DeploymentUtil.recursiveDelete(configurationDir);
                 if (e instanceof Error) {
-                    throw (Error)e;
+                    throw (Error) e;
                 } else if (e instanceof Exception) {
-                    throw (Exception)e;
+                    throw (Exception) e;
                 }
                 throw new Error(e);
             }

Modified: 
geronimo/trunk/modules/deployment/src/java/org/apache/geronimo/deployment/DeploymentContext.java
Url: 
http://svn.apache.org/viewcvs/geronimo/trunk/modules/deployment/src/java/org/apache/geronimo/deployment/DeploymentContext.java?view=diff&rev=125989&p1=geronimo/trunk/modules/deployment/src/java/org/apache/geronimo/deployment/DeploymentContext.java&r1=125988&p2=geronimo/trunk/modules/deployment/src/java/org/apache/geronimo/deployment/DeploymentContext.java&r2=125989
==============================================================================
--- 
geronimo/trunk/modules/deployment/src/java/org/apache/geronimo/deployment/DeploymentContext.java
    (original)
+++ 
geronimo/trunk/modules/deployment/src/java/org/apache/geronimo/deployment/DeploymentContext.java
    Fri Jan 21 16:26:15 2005
@@ -82,6 +82,10 @@
     private final ClassLoader parentCL;
 
     public DeploymentContext(File baseDir, URI configID, 
ConfigurationModuleType type, URI parentID, Kernel kernel) throws 
MalformedObjectNameException, DeploymentException {
+        this(baseDir,  configID,  type, parentID, null, null, kernel);
+    }
+
+    public DeploymentContext(File baseDir, URI configID, 
ConfigurationModuleType type, URI parentID, String domain, String server, 
Kernel kernel) throws MalformedObjectNameException, DeploymentException {
         assert baseDir != null: "baseDir is null";
         assert configID != null: "configID is null";
         assert type != null: "type is null";
@@ -105,6 +109,8 @@
             config.setAttribute("ID", configID);
             config.setAttribute("type", type);
             config.setAttribute("parentID", parentID);
+            config.setAttribute("domain", domain);
+            config.setAttribute("server", server);
         } catch (Exception e) {
             // we created this GBean ...
             throw new AssertionError();
@@ -113,7 +119,7 @@
         if (kernel != null && parentID != null) {
             ConfigurationManager configurationManager = 
kernel.getConfigurationManager();
             ObjectName parentName = 
Configuration.getConfigurationObjectName(parentID);
-            config.setReferencePatterns("Parent", 
Collections.singleton(parentName));
+            config.setReferencePattern("Parent", parentName);
             try {
                 loadedAncestors = configurationManager.loadRecursive(parentID);
             } catch (Exception e) {
@@ -121,6 +127,13 @@
             }
 
             try {
+                config.setAttribute("domain", kernel.getAttribute(parentName, 
"domain"));
+                config.setAttribute("server", kernel.getAttribute(parentName, 
"server"));
+            } catch (Exception e) {
+                throw new DeploymentException("Unable to copy domain and 
server from parent configuration", e);
+            }
+
+            try {
                 startedAncestors = new LinkedList();
                 ObjectName ancestorName = parentName;
                 while (ancestorName != null && !isRunning(kernel, 
ancestorName)) {
@@ -159,6 +172,12 @@
             // which is normally the system class loader but not always, so be 
safe
             parentCL = getClass().getClassLoader();
         }
+
+        //check that domain and server are now known
+        if (config.getAttribute("domain") == null || 
config.getAttribute("server") == null) {
+            throw new IllegalStateException("Domain or server could not be 
determined from explicit args or parent configuration. ParentID: " + parentID + 
", domain: " + config.getAttribute("domain") + ", server: " + 
config.getAttribute("server"));
+        }
+
     }
 
     private static boolean isRunning(Kernel kernel, ObjectName name) throws 
Exception {
@@ -177,6 +196,14 @@
         return baseDir;
     }
 
+    public String getDomain() {
+        return (String) config.getAttribute("domain");
+    }
+
+    public String getServer() {
+        return (String) config.getAttribute("server");
+    }
+
     /**
      * @deprecated use addGBean(GBeanData gbean)
      */
@@ -341,10 +368,14 @@
         addFile(getTargetFile(targetPath), new 
ByteArrayInputStream(source.getBytes()));
     }
 
-    public void addClass(URI location, String fqcn, byte[] bytes) throws 
IOException, URISyntaxException {
-        classPath.add(location);
+    public void addClass(URI location, String fqcn, byte[] bytes, boolean 
addToClasspath) throws IOException, URISyntaxException {
+        assert location.toString().endsWith("/");
+
+        if (addToClasspath) {
+            classPath.add(location);
+        }
         String classFileName = fqcn.replace('.', '/') + ".class";
-        addFile(getTargetFile(new URI(location.toString() + "/" + 
classFileName)), new ByteArrayInputStream(bytes));
+        addFile(getTargetFile(new URI(location.toString() + classFileName)), 
new ByteArrayInputStream(bytes));
     }
 
     private void addFile(File targetFile, ZipFile zipFile, ZipEntry zipEntry) 
throws IOException {

Modified: 
geronimo/trunk/modules/deployment/src/test/org/apache/geronimo/deployment/DeploymentContextTest.java
Url: 
http://svn.apache.org/viewcvs/geronimo/trunk/modules/deployment/src/test/org/apache/geronimo/deployment/DeploymentContextTest.java?view=diff&rev=125989&p1=geronimo/trunk/modules/deployment/src/test/org/apache/geronimo/deployment/DeploymentContextTest.java&r1=125988&p2=geronimo/trunk/modules/deployment/src/test/org/apache/geronimo/deployment/DeploymentContextTest.java&r2=125989
==============================================================================
--- 
geronimo/trunk/modules/deployment/src/test/org/apache/geronimo/deployment/DeploymentContextTest.java
        (original)
+++ 
geronimo/trunk/modules/deployment/src/test/org/apache/geronimo/deployment/DeploymentContextTest.java
        Fri Jan 21 16:26:15 2005
@@ -42,7 +42,7 @@
         try {
             basedir.deleteOnExit();
             URI configID = new URI("test");
-            DeploymentContext context = new DeploymentContext(basedir, 
configID, ConfigurationModuleType.CAR, null, null);
+            DeploymentContext context = new DeploymentContext(basedir, 
configID, ConfigurationModuleType.CAR, null, "foo", "bar", null);
             Enhancer enhancer = new Enhancer();
             enhancer.setInterfaces(new Class[]{DataSource.class});
             enhancer.setCallbackType(MethodInterceptor.class);
@@ -54,8 +54,8 @@
             });
             enhancer.setClassLoader(new URLClassLoader(new URL[0], 
this.getClass().getClassLoader()));
             Class type = enhancer.createClass();
-            URI location = new URI("cglib");
-            context.addClass(location, type.getName(), classBytes);
+            URI location = new URI("cglib/");
+            context.addClass(location, type.getName(), classBytes, true);
             ClassLoader cl = context.getClassLoader(null);
             Class loadedType = cl.loadClass(type.getName());
             assertTrue(DataSource.class.isAssignableFrom(loadedType));

Modified: 
geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/AppClientModule.java
Url: 
http://svn.apache.org/viewcvs/geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/AppClientModule.java?view=diff&rev=125989&p1=geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/AppClientModule.java&r1=125988&p2=geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/AppClientModule.java&r2=125989
==============================================================================
--- 
geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/AppClientModule.java
       (original)
+++ 
geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/AppClientModule.java
       Fri Jan 21 16:26:15 2005
@@ -17,9 +17,14 @@
 package org.apache.geronimo.j2ee.deployment;
 
 import java.net.URI;
+import java.net.URISyntaxException;
 import java.util.jar.JarFile;
+import java.util.Collection;
+import java.util.Set;
+import java.io.IOException;
 
 import org.apache.geronimo.kernel.config.ConfigurationModuleType;
+import org.apache.geronimo.deployment.DeploymentContext;
 import org.apache.xmlbeans.XmlObject;
 
 /**
@@ -27,6 +32,7 @@
  */
 public class AppClientModule extends Module {
     private JarFile earFile;
+    private Collection resourceModules;
 
     public AppClientModule(boolean standAlone, URI configId, URI parentId, 
JarFile moduleFile, String targetPath, XmlObject specDD, XmlObject vendorDD, 
String originalSpecDD) {
         super(standAlone, configId, parentId, moduleFile, targetPath, specDD, 
vendorDD, originalSpecDD);
@@ -42,6 +48,18 @@
 
     public void setEarFile(JarFile earFile) {
         this.earFile = earFile;
+    }
+
+    public void addClass(URI location, String fqcn, byte[] bytes, 
DeploymentContext context) throws IOException, URISyntaxException {
+        context.addClass(location, fqcn, bytes, true);
+    }
+
+    public void setResourceModules(Collection resourceModules) {
+        this.resourceModules = resourceModules;
+    }
+
+    public Collection getResourceModules() {
+        return resourceModules;
     }
 }
 

Modified: 
geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/ConnectorModule.java
Url: 
http://svn.apache.org/viewcvs/geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/ConnectorModule.java?view=diff&rev=125989&p1=geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/ConnectorModule.java&r1=125988&p2=geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/ConnectorModule.java&r2=125989
==============================================================================
--- 
geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/ConnectorModule.java
       (original)
+++ 
geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/ConnectorModule.java
       Fri Jan 21 16:26:15 2005
@@ -17,10 +17,13 @@
 package org.apache.geronimo.j2ee.deployment;
 
 import java.net.URI;
+import java.net.URISyntaxException;
 import java.util.jar.JarFile;
+import java.io.IOException;
 
 import org.apache.xmlbeans.XmlObject;
 import org.apache.geronimo.kernel.config.ConfigurationModuleType;
+import org.apache.geronimo.deployment.DeploymentContext;
 
 /**
  * @version $Rev$ $Date$
@@ -33,5 +36,10 @@
     public ConfigurationModuleType getType() {
         return ConfigurationModuleType.RAR;
     }
+
+    public void addClass(URI location, String fqcn, byte[] bytes, 
DeploymentContext context) throws IOException, URISyntaxException {
+        context.addClass(location, fqcn, bytes, true);
+    }
+
 }
 

Modified: 
geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder.java
Url: 
http://svn.apache.org/viewcvs/geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder.java?view=diff&rev=125989&p1=geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder.java&r1=125988&p2=geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder.java&r2=125989
==============================================================================
--- 
geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder.java
      (original)
+++ 
geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder.java
      Fri Jan 21 16:26:15 2005
@@ -79,22 +79,16 @@
     private final ServiceReferenceBuilder serviceReferenceBuilder;
 
     private final URI defaultParentId;
-    private final String j2eeServerName;
-    private final String j2eeDomainName;
-    private final ObjectName j2eeServer;
     private final ObjectName transactionContextManagerObjectName;
     private final ObjectName connectionTrackerObjectName;
     private final ObjectName transactionalTimerObjectName;
     private final ObjectName nonTransactionalTimerObjectName;
 
 
-    public EARConfigBuilder(URI defaultParentId, ObjectName j2eeServer, 
ObjectName transactionContextManagerObjectName, ObjectName 
connectionTrackerObjectName, ObjectName transactionalTimerObjectName, 
ObjectName nonTransactionalTimerObjectName, Repository repository, 
ModuleBuilder ejbConfigBuilder, EJBReferenceBuilder ejbReferenceBuilder, 
ModuleBuilder webConfigBuilder, ModuleBuilder connectorConfigBuilder, 
ResourceReferenceBuilder resourceReferenceBuilder, ModuleBuilder 
appClientConfigBuilder, ServiceReferenceBuilder serviceReferenceBuilder, Kernel 
kernel) {
+    public EARConfigBuilder(URI defaultParentId, ObjectName 
transactionContextManagerObjectName, ObjectName connectionTrackerObjectName, 
ObjectName transactionalTimerObjectName, ObjectName 
nonTransactionalTimerObjectName, Repository repository, ModuleBuilder 
ejbConfigBuilder, EJBReferenceBuilder ejbReferenceBuilder, ModuleBuilder 
webConfigBuilder, ModuleBuilder connectorConfigBuilder, 
ResourceReferenceBuilder resourceReferenceBuilder, ModuleBuilder 
appClientConfigBuilder, ServiceReferenceBuilder serviceReferenceBuilder, Kernel 
kernel) {
         this.kernel = kernel;
         this.repository = repository;
         this.defaultParentId = defaultParentId;
-        this.j2eeServer = j2eeServer;
-        j2eeServerName = j2eeServer.getKeyProperty("name");
-        j2eeDomainName = j2eeServer.getDomain();
 
         this.ejbConfigBuilder = ejbConfigBuilder;
         this.ejbReferenceBuilder = ejbReferenceBuilder;
@@ -282,8 +276,6 @@
                         applicationType,
                         applicationInfo.getParentId(),
                         kernel,
-                        j2eeDomainName,
-                        j2eeServerName,
                         applicationInfo.getApplicationName(),
                         transactionContextManagerObjectName,
                         connectionTrackerObjectName,
@@ -340,7 +332,11 @@
                 } catch (Exception e) {
                     throw new DeploymentException("Error initializing 
J2EEApplication managed object");
                 }
-                gbeanData.setReferencePatterns("j2eeServer", 
Collections.singleton(j2eeServer));
+                try {
+                    gbeanData.setReferencePattern("j2eeServer", 
NameFactory.getServerName(earContext.getDomain(), earContext.getServer(), 
earContext.getJ2eeContext()));
+                } catch (MalformedObjectNameException e) {
+                    throw new DeploymentException("Error constructing 
J2EEServer name for application", e);
+                }
                 earContext.addGBean(gbeanData);
             }
 
@@ -523,7 +519,6 @@
     static {
         GBeanInfoBuilder infoFactory = new 
GBeanInfoBuilder(EARConfigBuilder.class);
         infoFactory.addAttribute("defaultParentId", URI.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);
@@ -544,7 +539,6 @@
 
         infoFactory.setConstructor(new String[]{
             "defaultParentId",
-            "j2eeServer",
             "transactionContextManagerObjectName",
             "connectionTrackerObjectName",
             "transactionalTimerObjectName",

Modified: 
geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/EARContext.java
Url: 
http://svn.apache.org/viewcvs/geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/EARContext.java?view=diff&rev=125989&p1=geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/EARContext.java&r1=125988&p2=geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/EARContext.java&r2=125989
==============================================================================
--- 
geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/EARContext.java
    (original)
+++ 
geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/EARContext.java
    Fri Jan 21 16:26:15 2005
@@ -46,9 +46,9 @@
     private final RefContext refContext;
     private final J2eeContext j2eeContext;
 
-    public EARContext(File baseDir, URI id, ConfigurationModuleType 
moduleType, URI parentID, Kernel kernel, String j2eeDomainName, String 
j2eeServerName, String j2eeApplicationName, ObjectName 
transactionContextManagerObjectName, ObjectName connectionTrackerObjectName, 
ObjectName transactedTimerName, ObjectName nonTransactedTimerName, RefContext 
refContext) throws MalformedObjectNameException, DeploymentException {
+    public EARContext(File baseDir, URI id, ConfigurationModuleType 
moduleType, URI parentID, Kernel kernel, String j2eeApplicationName, ObjectName 
transactionContextManagerObjectName, ObjectName connectionTrackerObjectName, 
ObjectName transactedTimerName, ObjectName nonTransactedTimerName, RefContext 
refContext) throws MalformedObjectNameException, DeploymentException {
         super(baseDir, id, moduleType, parentID, kernel);
-        j2eeContext = new J2eeContextImpl(j2eeDomainName, j2eeServerName, 
j2eeApplicationName == null ? NameFactory.NULL : j2eeApplicationName, null, 
null, null);
+        j2eeContext = new J2eeContextImpl(getDomain(), getServer(), 
j2eeApplicationName == null ? NameFactory.NULL : j2eeApplicationName, null, 
null, null);
         domainObjectName = NameFactory.getDomainName(null, j2eeContext);
         serverObjectName = NameFactory.getServerName(null, null, j2eeContext);
 

Modified: 
geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/EJBModule.java
Url: 
http://svn.apache.org/viewcvs/geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/EJBModule.java?view=diff&rev=125989&p1=geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/EJBModule.java&r1=125988&p2=geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/EJBModule.java&r2=125989
==============================================================================
--- 
geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/EJBModule.java
     (original)
+++ 
geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/EJBModule.java
     Fri Jan 21 16:26:15 2005
@@ -17,10 +17,13 @@
 package org.apache.geronimo.j2ee.deployment;
 
 import java.net.URI;
+import java.net.URISyntaxException;
 import java.util.jar.JarFile;
+import java.io.IOException;
 
 import org.apache.xmlbeans.XmlObject;
 import org.apache.geronimo.kernel.config.ConfigurationModuleType;
+import org.apache.geronimo.deployment.DeploymentContext;
 
 /**
  * @version $Rev$ $Date$
@@ -32,6 +35,10 @@
 
     public ConfigurationModuleType getType() {
         return ConfigurationModuleType.EJB;
+    }
+
+    public void addClass(URI location, String fqcn, byte[] bytes, 
DeploymentContext context) throws IOException, URISyntaxException {
+        context.addClass(location, fqcn, bytes, true);
     }
 }
 

Modified: 
geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/Module.java
Url: 
http://svn.apache.org/viewcvs/geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/Module.java?view=diff&rev=125989&p1=geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/Module.java&r1=125988&p2=geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/Module.java&r2=125989
==============================================================================
--- 
geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/Module.java
        (original)
+++ 
geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/Module.java
        Fri Jan 21 16:26:15 2005
@@ -18,10 +18,14 @@
 
 import java.util.jar.JarFile;
 import java.net.URI;
+import java.net.URISyntaxException;
+import java.io.IOException;
+import java.io.File;
 
 import org.apache.xmlbeans.XmlObject;
 import org.apache.geronimo.kernel.config.ConfigurationModuleType;
 import org.apache.geronimo.deployment.util.DeploymentUtil;
+import org.apache.geronimo.deployment.DeploymentContext;
 
 /**
  * @version $Rev$ $Date$
@@ -34,10 +38,13 @@
     private final URI moduleURI;
     private final JarFile moduleFile;
     private final String targetPath;
+    private final URI targetPathURI;
     private final XmlObject specDD;
     private final XmlObject vendorDD;
     private final String originalSpecDD;
 
+    private URI uniqueModuleLocation;
+
     protected Module(boolean standAlone, URI configId, URI parentId, JarFile 
moduleFile, String targetPath, XmlObject specDD, XmlObject vendorDD, String 
originalSpecDD) {
         assert targetPath != null: "targetPath is null";
 
@@ -57,9 +64,11 @@
             name = targetPath;
             moduleURI = URI.create(targetPath);
         }
+
+        targetPathURI = URI.create(targetPath + "/");
     }
 
-    public abstract ConfigurationModuleType  getType();
+    public abstract ConfigurationModuleType getType();
 
     public String getName() {
         return name;
@@ -89,6 +98,10 @@
         return targetPath;
     }
 
+    public URI getTargetPathURI() {
+        return targetPathURI;
+    }
+
     public XmlObject getSpecDD() {
         return specDD;
     }
@@ -119,4 +132,28 @@
     public void close() {
         DeploymentUtil.close(moduleFile);
     }
+
+    public void addClass(String fqcn, byte[] bytes, DeploymentContext context) 
throws IOException, URISyntaxException {
+        URI location = getUniqueModuleLocation(context);
+        addClass(location, fqcn, bytes, context);
+    }
+
+    private URI getUniqueModuleLocation(DeploymentContext context) {
+        if (uniqueModuleLocation == null) {
+            String suffix = "";
+            URI candidateURI;
+            File candidateFile;
+            int i = 1;
+            do {
+                candidateURI = URI.create(targetPath + "-generated" + suffix + 
"/");
+                candidateFile = context.getTargetFile(candidateURI);
+                suffix = "" + i++;
+            } while (candidateFile.exists());
+            candidateFile.mkdirs();
+            uniqueModuleLocation = candidateURI;
+        }
+        return uniqueModuleLocation;
+    }
+
+    public abstract void addClass(URI location, String fqcn, byte[] bytes, 
DeploymentContext context) throws IOException, URISyntaxException;
 }

Modified: 
geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/RefContext.java
Url: 
http://svn.apache.org/viewcvs/geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/RefContext.java?view=diff&rev=125989&p1=geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/RefContext.java&r1=125988&p2=geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/RefContext.java&r2=125989
==============================================================================
--- 
geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/RefContext.java
    (original)
+++ 
geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/RefContext.java
    Fri Jan 21 16:26:15 2005
@@ -285,8 +285,8 @@
         }
     }
 
-    public Object getServiceReference(Class serviceInterface, URI wsdlURI, URI 
jaxrpcMappingURI, QName serviceQName, Map portComponentRefMap, List handlers, 
DeploymentContext deploymentContext, ClassLoader classLoader) throws 
DeploymentException {
-        return serviceReferenceBuilder.createService(serviceInterface, 
wsdlURI, jaxrpcMappingURI, serviceQName, portComponentRefMap, handlers, 
deploymentContext, classLoader);
+    public Object getServiceReference(Class serviceInterface, URI wsdlURI, URI 
jaxrpcMappingURI, QName serviceQName, Map portComponentRefMap, List handlers, 
DeploymentContext deploymentContext, Module module, ClassLoader classLoader) 
throws DeploymentException {
+        return serviceReferenceBuilder.createService(serviceInterface, 
wsdlURI, jaxrpcMappingURI, serviceQName, portComponentRefMap, handlers, 
deploymentContext, module, classLoader);
     }
 
     private String getContainerId(URI module, String ejbLink, Map references) 
throws AmbiguousEJBRefException, UnknownEJBRefException {

Modified: 
geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/ServiceReferenceBuilder.java
Url: 
http://svn.apache.org/viewcvs/geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/ServiceReferenceBuilder.java?view=diff&rev=125989&p1=geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/ServiceReferenceBuilder.java&r1=125988&p2=geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/ServiceReferenceBuilder.java&r2=125989
==============================================================================
--- 
geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/ServiceReferenceBuilder.java
       (original)
+++ 
geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/ServiceReferenceBuilder.java
       Fri Jan 21 16:26:15 2005
@@ -31,7 +31,7 @@
 public interface ServiceReferenceBuilder {
 
     //it could return a Service or a Reference, we don't care
-    Object createService(Class serviceInterface, URI wsdlURI, URI 
jaxrpcMappingURI, QName serviceQName, Map portComponentRefMap, List handlers, 
DeploymentContext deploymentContext, ClassLoader classLoader) throws 
DeploymentException;
+    Object createService(Class serviceInterface, URI wsdlURI, URI 
jaxrpcMappingURI, QName serviceQName, Map portComponentRefMap, List handlers, 
DeploymentContext deploymentContext, Module module, ClassLoader classLoader) 
throws DeploymentException;
 
     //TODO a locate port method for links.
 }

Modified: 
geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/WebModule.java
Url: 
http://svn.apache.org/viewcvs/geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/WebModule.java?view=diff&rev=125989&p1=geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/WebModule.java&r1=125988&p2=geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/WebModule.java&r2=125989
==============================================================================
--- 
geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/WebModule.java
     (original)
+++ 
geronimo/trunk/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/WebModule.java
     Fri Jan 21 16:26:15 2005
@@ -17,15 +17,21 @@
 package org.apache.geronimo.j2ee.deployment;
 
 import java.util.jar.JarFile;
+import java.util.LinkedHashSet;
 import java.net.URI;
+import java.net.URISyntaxException;
+import java.io.IOException;
 
 import org.apache.xmlbeans.XmlObject;
 import org.apache.geronimo.kernel.config.ConfigurationModuleType;
+import org.apache.geronimo.deployment.DeploymentContext;
 
 /**
  * @version $Rev$ $Date$
  */
 public class WebModule extends Module {
+
+    private final LinkedHashSet webClassPath = new LinkedHashSet();
     private String contextRoot;
 
     public WebModule(boolean standAlone, URI configId, URI parentId, JarFile 
moduleFile, String targetPath, XmlObject specDD, XmlObject vendorDD, String 
originalSpecDD) {
@@ -43,5 +49,20 @@
     public ConfigurationModuleType getType() {
         return ConfigurationModuleType.WAR;
     }
+
+    public void addClass(URI location, String fqcn, byte[] bytes, 
DeploymentContext context) throws IOException, URISyntaxException {
+        context.addClass(location, fqcn, bytes, false);
+        addToWebClasspath(location);
+    }
+
+    public void addToWebClasspath(URI location) {
+        webClassPath.add(location);
+    }
+
+    public URI[] getWebClasspath() {
+        URI[] uris = new URI[webClassPath.size()];
+        return (URI[])webClassPath.toArray(uris);
+    }
+
 }
 

Modified: 
geronimo/trunk/modules/j2ee-builder/src/test/org/apache/geronimo/j2ee/deployment/EARConfigBuilderTest.java
Url: 
http://svn.apache.org/viewcvs/geronimo/trunk/modules/j2ee-builder/src/test/org/apache/geronimo/j2ee/deployment/EARConfigBuilderTest.java?view=diff&rev=125989&p1=geronimo/trunk/modules/j2ee-builder/src/test/org/apache/geronimo/j2ee/deployment/EARConfigBuilderTest.java&r1=125988&p2=geronimo/trunk/modules/j2ee-builder/src/test/org/apache/geronimo/j2ee/deployment/EARConfigBuilderTest.java&r2=125989
==============================================================================
--- 
geronimo/trunk/modules/j2ee-builder/src/test/org/apache/geronimo/j2ee/deployment/EARConfigBuilderTest.java
  (original)
+++ 
geronimo/trunk/modules/j2ee-builder/src/test/org/apache/geronimo/j2ee/deployment/EARConfigBuilderTest.java
  Fri Jan 21 16:26:15 2005
@@ -18,9 +18,15 @@
 package org.apache.geronimo.j2ee.deployment;
 
 import java.io.File;
+import java.io.IOException;
+import java.io.ByteArrayOutputStream;
+import java.io.ObjectOutputStream;
 import java.net.URI;
+import java.net.URL;
 import java.util.jar.JarFile;
+import java.util.List;
 import javax.management.ObjectName;
+import javax.management.MalformedObjectNameException;
 
 import junit.extensions.TestSetup;
 import junit.framework.Test;
@@ -29,6 +35,16 @@
 import org.apache.geronimo.common.DeploymentException;
 import org.apache.geronimo.deployment.util.DeploymentUtil;
 import org.apache.geronimo.kernel.jmx.JMXUtil;
+import org.apache.geronimo.kernel.Kernel;
+import org.apache.geronimo.kernel.config.ConfigurationStore;
+import org.apache.geronimo.kernel.config.InvalidConfigException;
+import org.apache.geronimo.kernel.config.NoSuchConfigException;
+import org.apache.geronimo.kernel.config.Configuration;
+import org.apache.geronimo.kernel.registry.GBeanRegistry;
+import org.apache.geronimo.kernel.registry.BasicGBeanRegistry;
+import org.apache.geronimo.gbean.GBeanData;
+import org.apache.geronimo.gbean.GBeanInfoBuilder;
+import org.apache.geronimo.gbean.GBeanInfo;
 
 /**
  * @version $Rev$ $Date$
@@ -60,7 +76,7 @@
         TestSuite inner = new TestSuite(EARConfigBuilderTest.class);
         TestSetup setup14 = new TestSetup(inner) {
             protected void setUp() throws Exception {
-                earFile = DeploymentUtil.createJarFile(new File(basedir,  
"target/test-ear14/test-ear.ear"));
+                earFile = DeploymentUtil.createJarFile(new File(basedir, 
"target/test-ear14/test-ear.ear"));
                 ejbConfigBuilder.ejbModule = new EJBModule(false, null, null, 
null, "test-ejb-jar.jar", null, null, null);
                 webConfigBuilder.contextRoot = "test";
                 webConfigBuilder.webModule = new WebModule(false, null, null, 
null, "test-war.war", null, null, null);
@@ -77,7 +93,7 @@
         };
         TestSetup setupNaked14 = new TestSetup(inner) {
             protected void setUp() throws Exception {
-                earFile = DeploymentUtil.createJarFile(new File(basedir,  
"target/test-ear14/test-naked-ear.ear"));
+                earFile = DeploymentUtil.createJarFile(new File(basedir, 
"target/test-ear14/test-naked-ear.ear"));
                 ejbConfigBuilder.ejbModule = new EJBModule(false, null, null, 
null, "test-ejb-jar.jar", null, null, null);
                 webConfigBuilder.contextRoot = "test";
                 webConfigBuilder.webModule = new WebModule(false, null, null, 
null, "test-war.war", null, null, null);
@@ -94,7 +110,7 @@
         };
         TestSetup setup13 = new TestSetup(inner) {
             protected void setUp() throws Exception {
-                earFile = DeploymentUtil.createJarFile(new File(basedir,  
"target/test-ear13/test-ear.ear"));
+                earFile = DeploymentUtil.createJarFile(new File(basedir, 
"target/test-ear13/test-ear.ear"));
                 ejbConfigBuilder.ejbModule = new EJBModule(false, null, null, 
null, "test-ejb-jar.jar", null, null, null);
                 webConfigBuilder.contextRoot = "test";
                 webConfigBuilder.webModule = new WebModule(false, null, null, 
null, "test-war.war", null, null, null);
@@ -128,7 +144,7 @@
         };
         TestSetup setupUnpacked = new TestSetup(inner) {
             protected void setUp() throws Exception {
-                earFile = DeploymentUtil.createJarFile(new File(basedir,  
"target/test-unpacked-ear/full/"));
+                earFile = DeploymentUtil.createJarFile(new File(basedir, 
"target/test-unpacked-ear/full/"));
                 ejbConfigBuilder.ejbModule = new EJBModule(false, null, null, 
null, "test-ejb-jar.jar/", null, null, null);
                 webConfigBuilder.contextRoot = "test";
                 webConfigBuilder.webModule = new WebModule(false, null, null, 
null, "test-war.war/", null, null, null);
@@ -145,7 +161,7 @@
         };
         TestSetup setupUnpackedNaked = new TestSetup(inner) {
             protected void setUp() throws Exception {
-                earFile = DeploymentUtil.createJarFile(new File(basedir,  
"target/test-unpacked-ear/naked/"));
+                earFile = DeploymentUtil.createJarFile(new File(basedir, 
"target/test-unpacked-ear/naked/"));
                 ejbConfigBuilder.ejbModule = new EJBModule(false, null, null, 
null, "test-ejb-jar.jar/", null, null, null);
                 webConfigBuilder.contextRoot = "test";
                 webConfigBuilder.webModule = new WebModule(false, null, null, 
null, "test-war.war", null, null, null);
@@ -162,7 +178,7 @@
         };
         TestSetup setupUnpackedAltDD = new TestSetup(inner) {
             protected void setUp() throws Exception {
-                earFile = DeploymentUtil.createJarFile(new File(basedir,  
"target/test-unpacked-ear/alt-dd/"));
+                earFile = DeploymentUtil.createJarFile(new File(basedir, 
"target/test-unpacked-ear/alt-dd/"));
                 ejbConfigBuilder.ejbModule = new EJBModule(false, null, null, 
null, "test-ejb-jar.jar/", null, null, null);
                 webConfigBuilder.contextRoot = "test";
                 webConfigBuilder.webModule = new WebModule(false, null, null, 
null, "test-war.war/", null, null, null);
@@ -179,7 +195,7 @@
         };
         TestSetup setupPackedAltDD = new TestSetup(inner) {
             protected void setUp() throws Exception {
-                earFile = DeploymentUtil.createJarFile(new File(basedir,  
"target/test-unpacked-ear/alt-dd.ear"));
+                earFile = DeploymentUtil.createJarFile(new File(basedir, 
"target/test-unpacked-ear/alt-dd.ear"));
                 ejbConfigBuilder.ejbModule = new EJBModule(false, null, null, 
null, "test-ejb-jar.jar/", null, null, null);
                 webConfigBuilder.contextRoot = "test";
                 webConfigBuilder.webModule = new WebModule(false, null, null, 
null, "test-war.war/", null, null, null);
@@ -194,7 +210,7 @@
                 close(connectorConfigBuilder.connectorModule);
             }
         };
-        
+
         TestSuite suite = new TestSuite();
         suite.addTest(setup14);
         suite.addTest(setupNaked14);
@@ -208,7 +224,15 @@
     }
 
     public void testBuildConfiguration() throws Exception {
-        EARConfigBuilder configBuilder = new EARConfigBuilder(defaultParentId, 
j2eeServer, transactionManagerObjectName, connectionTrackerObjectName, 
transactionalTimerObjectName, nonTransactionalTimerObjectName, null, 
ejbConfigBuilder, null, webConfigBuilder, connectorConfigBuilder, 
resourceReferenceBuilder, appClientConfigBuilder, serviceReferenceBuilder, 
null);
+        Kernel kernel = new Kernel("foo", new BasicGBeanRegistry());
+        kernel.boot();
+
+        GBeanData store = new 
GBeanData(JMXUtil.getObjectName("foo:j2eeType=ConfigurationStore,name=mock"), 
MockConfigStore.GBEAN_INFO);
+        kernel.loadGBean(store, this.getClass().getClassLoader());
+        kernel.startGBean(store.getName());
+
+        EARConfigBuilder configBuilder = new EARConfigBuilder(defaultParentId, 
transactionManagerObjectName, connectionTrackerObjectName, 
transactionalTimerObjectName, nonTransactionalTimerObjectName, null, 
ejbConfigBuilder, null, webConfigBuilder, connectorConfigBuilder, 
resourceReferenceBuilder, appClientConfigBuilder, serviceReferenceBuilder, 
kernel);
+
 
         File tempDir = null;
         try {
@@ -217,11 +241,12 @@
             configBuilder.buildConfiguration(plan, earFile, tempDir);
         } finally {
             DeploymentUtil.recursiveDelete(tempDir);
+            kernel.shutdown();
         }
     }
 
     public void testNoEJBDeployer() throws Exception {
-        EARConfigBuilder configBuilder = new EARConfigBuilder(defaultParentId, 
j2eeServer, transactionManagerObjectName, connectionTrackerObjectName, 
transactionalTimerObjectName, nonTransactionalTimerObjectName, null, null, 
null, webConfigBuilder, connectorConfigBuilder, resourceReferenceBuilder, 
appClientConfigBuilder, serviceReferenceBuilder, null);
+        EARConfigBuilder configBuilder = new EARConfigBuilder(defaultParentId, 
transactionManagerObjectName, connectionTrackerObjectName, 
transactionalTimerObjectName, nonTransactionalTimerObjectName, null, null, 
null, webConfigBuilder, connectorConfigBuilder, resourceReferenceBuilder, 
appClientConfigBuilder, serviceReferenceBuilder, null);
 
         File tempDir = null;
         try {
@@ -237,7 +262,7 @@
     }
 
     public void testNoWARDeployer() throws Exception {
-        EARConfigBuilder configBuilder = new EARConfigBuilder(defaultParentId, 
j2eeServer, transactionManagerObjectName, connectionTrackerObjectName, 
transactionalTimerObjectName, nonTransactionalTimerObjectName, null, 
ejbConfigBuilder, null, null, connectorConfigBuilder, resourceReferenceBuilder, 
appClientConfigBuilder, serviceReferenceBuilder, null);
+        EARConfigBuilder configBuilder = new EARConfigBuilder(defaultParentId, 
transactionManagerObjectName, connectionTrackerObjectName, 
transactionalTimerObjectName, nonTransactionalTimerObjectName, null, 
ejbConfigBuilder, null, null, connectorConfigBuilder, resourceReferenceBuilder, 
appClientConfigBuilder, serviceReferenceBuilder, null);
 
         File tempDir = null;
         try {
@@ -253,7 +278,7 @@
     }
 
     public void testNoConnectorDeployer() throws Exception {
-        EARConfigBuilder configBuilder = new EARConfigBuilder(defaultParentId, 
j2eeServer, transactionManagerObjectName, connectionTrackerObjectName, 
transactionalTimerObjectName, nonTransactionalTimerObjectName, null, 
ejbConfigBuilder, null, webConfigBuilder, null, resourceReferenceBuilder, 
appClientConfigBuilder, serviceReferenceBuilder, null);
+        EARConfigBuilder configBuilder = new EARConfigBuilder(defaultParentId, 
transactionManagerObjectName, connectionTrackerObjectName, 
transactionalTimerObjectName, nonTransactionalTimerObjectName, null, 
ejbConfigBuilder, null, webConfigBuilder, null, resourceReferenceBuilder, 
appClientConfigBuilder, serviceReferenceBuilder, null);
 
         File tempDir = null;
         try {
@@ -273,4 +298,77 @@
             module.close();
         }
     }
+
+    public static class MockConfigStore implements ConfigurationStore {
+        public URI install(URL source) throws IOException, 
InvalidConfigException {
+            return null;
+        }
+
+        public URI install(File source) throws IOException, 
InvalidConfigException {
+            return null;
+        }
+
+        public void uninstall(URI configID) throws NoSuchConfigException, 
IOException {
+
+        }
+
+        public boolean containsConfiguration(URI configID) {
+            return true;
+        }
+
+        public GBeanData getConfiguration(URI id) throws 
NoSuchConfigException, IOException, InvalidConfigException {
+            GBeanData configData = null;
+            try {
+                configData = new 
GBeanData(Configuration.getConfigurationObjectName(id), 
Configuration.GBEAN_INFO);
+            } catch (MalformedObjectNameException e) {
+                throw new InvalidConfigException(e);
+            }
+            configData.setAttribute("ID", id);
+            configData.setAttribute("domain", "test");
+            configData.setAttribute("server", "bar");
+            configData.setAttribute("gBeanState", NO_OBJECTS_OS);
+            return configData;
+        }
+
+        public void updateConfiguration(Configuration configuration) throws 
NoSuchConfigException, Exception {
+
+        }
+
+        public URL getBaseURL(URI id) throws NoSuchConfigException {
+            return null;
+        }
+
+        public String getObjectName() {
+            return null;
+        }
+
+        public List listConfiguations() {
+            return null;
+        }
+
+        public File createNewConfigurationDir() {
+            return null;
+        }
+
+        public final static GBeanInfo GBEAN_INFO;
+
+        private static final byte[] NO_OBJECTS_OS;
+
+        static {
+            GBeanInfoBuilder infoBuilder = new 
GBeanInfoBuilder(MockConfigStore.class);
+            infoBuilder.addInterface(ConfigurationStore.class);
+            GBEAN_INFO = infoBuilder.getBeanInfo();
+
+            ByteArrayOutputStream baos = new ByteArrayOutputStream();
+            try {
+                ObjectOutputStream oos = new ObjectOutputStream(baos);
+                oos.flush();
+                NO_OBJECTS_OS = baos.toByteArray();
+            } catch (IOException e) {
+                throw new RuntimeException(e);
+            }
+        }
+    };
+
+
 }

Modified: 
geronimo/trunk/modules/j2ee-builder/src/test/org/apache/geronimo/j2ee/deployment/EJBRefContextTest.java
Url: 
http://svn.apache.org/viewcvs/geronimo/trunk/modules/j2ee-builder/src/test/org/apache/geronimo/j2ee/deployment/EJBRefContextTest.java?view=diff&rev=125989&p1=geronimo/trunk/modules/j2ee-builder/src/test/org/apache/geronimo/j2ee/deployment/EJBRefContextTest.java&r1=125988&p2=geronimo/trunk/modules/j2ee-builder/src/test/org/apache/geronimo/j2ee/deployment/EJBRefContextTest.java&r2=125989
==============================================================================
--- 
geronimo/trunk/modules/j2ee-builder/src/test/org/apache/geronimo/j2ee/deployment/EJBRefContextTest.java
     (original)
+++ 
geronimo/trunk/modules/j2ee-builder/src/test/org/apache/geronimo/j2ee/deployment/EJBRefContextTest.java
     Fri Jan 21 16:26:15 2005
@@ -200,7 +200,7 @@
             }
         }, new ServiceReferenceBuilder() {
             //it could return a Service or a Reference, we don't care
-            public Object createService(Class serviceInterface, URI wsdlURI, 
URI jaxrpcMappingURI, QName serviceQName, Map portComponentRefMap, List 
handlers, DeploymentContext deploymentContext, ClassLoader classLoader) throws 
DeploymentException {
+            public Object createService(Class serviceInterface, URI wsdlURI, 
URI jaxrpcMappingURI, QName serviceQName, Map portComponentRefMap, List 
handlers, DeploymentContext deploymentContext, Module module, ClassLoader 
classLoader) throws DeploymentException {
                 return null;
             }
         });

Modified: geronimo/trunk/modules/j2ee-schema/maven.xml
Url: 
http://svn.apache.org/viewcvs/geronimo/trunk/modules/j2ee-schema/maven.xml?view=diff&rev=125989&p1=geronimo/trunk/modules/j2ee-schema/maven.xml&r1=125988&p2=geronimo/trunk/modules/j2ee-schema/maven.xml&r2=125989
==============================================================================
--- geronimo/trunk/modules/j2ee-schema/maven.xml        (original)
+++ geronimo/trunk/modules/j2ee-schema/maven.xml        Fri Jan 21 16:26:15 2005
@@ -28,7 +28,7 @@
     <preGoal name="java:compile">
         <xmlbeans:schema2java
             sourcedir="${basedir}/src"
-            
sourceschema="j2ee_1_4schema/application_1_4.xsd,j2ee_1_3schema/connector_1_0.xsd,j2ee_1_4schema/j2ee_1_4.xsd,j2ee_1_4schema/connector_1_5.xsd,j2ee_1_4schema/ejb-jar_2_1.xsd,j2ee_1_4schema/web-app_2_4.xsd,j2ee_1_4schema/application-client_1_4.xsd,j2ee_1_4schema/j2ee_jaxrpc_mapping_1_1.xsd"
+            
sourceschema="j2ee_1_4schema/application_1_4.xsd,j2ee_1_4schema/j2ee_jaxrpc_mapping_1_1.xsd,j2ee_1_3schema/connector_1_0.xsd,j2ee_1_4schema/j2ee_1_4.xsd,j2ee_1_4schema/connector_1_5.xsd,j2ee_1_4schema/ejb-jar_2_1.xsd,j2ee_1_4schema/web-app_2_4.xsd,j2ee_1_4schema/application-client_1_4.xsd"
             xmlconfigs="${basedir}/src/conf/xmlconfig.xml"
             targetdir="${basedir}/target/xmlbeans"
             cataloglocation="${basedir}/src/catalog/resolver-catalog.xml"/>

Added: 
geronimo/trunk/modules/j2ee-schema/src/test-data/j2ee_1_4schema/web-2-24.xml
Url: 
http://svn.apache.org/viewcvs/geronimo/trunk/modules/j2ee-schema/src/test-data/j2ee_1_4schema/web-2-24.xml?view=auto&rev=125989
==============================================================================
--- (empty file)
+++ 
geronimo/trunk/modules/j2ee-schema/src/test-data/j2ee_1_4schema/web-2-24.xml    
    Fri Jan 21 16:26:15 2005
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee 
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd";>
+    <display-name>naming itest</display-name>
+    <servlet>
+        <servlet-name>NamingTestServlet</servlet-name>
+        
<servlet-class>org.apache.geronimo.itests.naming.war.NamingTestServlet</servlet-class>
+    </servlet>
+    <servlet-mapping>
+        <servlet-name>NamingTestServlet</servlet-name>
+        <url-pattern>/</url-pattern>
+    </servlet-mapping>
+
+    <service-ref>
+        <service-ref-name>service/InteropLab</service-ref-name>
+        
<service-interface>org.apache.geronimo.itests.naming.common.webservice.interop.InteropLab</service-interface>
+        <wsdl-file>WEB-INF/wsdl/interop.wsdl</wsdl-file>
+        
<jaxrpc-mapping-file>WEB-INF/wsdl/interop-jaxrpcmapping.xml</jaxrpc-mapping-file>
+        <service-qname 
xmlns:interop="http://tempuri.org/4s4c/1/3/wsdl/def/interopLab";>interop:interopLab</service-qname>
+    </service-ref>
+</web-app>
\ No newline at end of file

Modified: 
geronimo/trunk/modules/j2ee-schema/src/test/org/apache/geronimo/schema/SchemaConversionUtilsTest.java
Url: 
http://svn.apache.org/viewcvs/geronimo/trunk/modules/j2ee-schema/src/test/org/apache/geronimo/schema/SchemaConversionUtilsTest.java?view=diff&rev=125989&p1=geronimo/trunk/modules/j2ee-schema/src/test/org/apache/geronimo/schema/SchemaConversionUtilsTest.java&r1=125988&p2=geronimo/trunk/modules/j2ee-schema/src/test/org/apache/geronimo/schema/SchemaConversionUtilsTest.java&r2=125989
==============================================================================
--- 
geronimo/trunk/modules/j2ee-schema/src/test/org/apache/geronimo/schema/SchemaConversionUtilsTest.java
       (original)
+++ 
geronimo/trunk/modules/j2ee-schema/src/test/org/apache/geronimo/schema/SchemaConversionUtilsTest.java
       Fri Jan 21 16:26:15 2005
@@ -315,6 +315,12 @@
         }
     }
 
+    public void testParseWeb24() throws Exception {
+        File srcXml = new File(basedir, 
"src/test-data/j2ee_1_4schema/web-2-24.xml");
+        XmlObject xmlObject = XmlObject.Factory.parse(srcXml);
+        xmlObject = SchemaConversionUtils.convertToServletSchema(xmlObject);
+    }
+
     public void testEJB21To21DoesNothing() throws Exception {
         File srcXml = new File(basedir, 
"src/test-data/j2ee_1_4schema/ejb-jar.xml");
         File expectedOutputXml = new File(basedir, 
"src/test-data/j2ee_1_4schema/ejb-jar.xml");
@@ -331,7 +337,7 @@
         File expectedOutputXml = new File(basedir, 
"src/test-data/geronimo/ejb-naming-post.xml");
         XmlObject xmlObject = XmlObject.Factory.parse(srcXml);
         xmlObject = 
SchemaConversionUtils.convertToGeronimoNamingSchema(xmlObject);
-       //        System.out.println(xmlObject.toString());
+        //        System.out.println(xmlObject.toString());
         XmlObject expected = XmlObject.Factory.parse(expectedOutputXml);
         List problems = new ArrayList();
         boolean ok = compareXmlObjects(xmlObject, expected, problems);

Modified: 
geronimo/trunk/modules/jetty-builder/src/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java
Url: 
http://svn.apache.org/viewcvs/geronimo/trunk/modules/jetty-builder/src/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java?view=diff&rev=125989&p1=geronimo/trunk/modules/jetty-builder/src/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java&r1=125988&p2=geronimo/trunk/modules/jetty-builder/src/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java&r2=125989
==============================================================================
--- 
geronimo/trunk/modules/jetty-builder/src/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java
  (original)
+++ 
geronimo/trunk/modules/jetty-builder/src/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java
  Fri Jan 21 16:26:15 2005
@@ -33,7 +33,6 @@
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.Iterator;
-import java.util.LinkedList;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
@@ -331,7 +330,8 @@
         JettyWebAppType jettyWebApp = (JettyWebAppType) 
webModule.getVendorDD();
 
         // construct the webClassLoader
-        URI[] webClassPath = getWebClassPath(earContext, webModule);
+        getWebClassPath(earContext, webModule);
+        URI[] webClassPath = webModule.getWebClasspath();
         URI baseUri = 
earContext.getTargetFile(URI.create(webModule.getTargetPath() + "/")).toURI();
         URL[] webClassPathURLs = new URL[webClassPath.length];
         for (int i = 0; i < webClassPath.length; i++) {
@@ -369,6 +369,7 @@
         }
 
         UserTransaction userTransaction = new OnlineUserTransaction();
+        //this may add to the web classpath with enhanced classes.
         ReadOnlyContext compContext = buildComponentContext(earContext, 
webModule, webApp, jettyWebApp, userTransaction, webClassLoader);
 
         GBeanData webModuleData = new GBeanData(webModuleName, 
JettyWebAppContext.GBEAN_INFO);
@@ -388,7 +389,8 @@
             webModuleData.setAttribute("uri", 
URI.create(module.getTargetPath() + "/"));
             webModuleData.setAttribute("componentContext", compContext);
             webModuleData.setAttribute("userTransaction", userTransaction);
-            webModuleData.setAttribute("webClassPath", webClassPath);
+            //classpath may have been augmented with enhanced classes
+            webModuleData.setAttribute("webClassPath", 
webModule.getWebClasspath());
             // unsharableResources, applicationManagedSecurityResources
             GBeanResourceEnvironmentBuilder rebuilder = new 
GBeanResourceEnvironmentBuilder(webModuleData);
             ENCConfigBuilder.setResourceEnvironment(earContext, 
webModule.getModuleURI(), rebuilder, webApp.getResourceRefArray(), 
jettyWebApp.getResourceRefArray());
@@ -936,15 +938,14 @@
         return roleNames;
     }
 
-    private static URI[] getWebClassPath(EARContext earContext, WebModule 
webModule) {
-        LinkedList webClassPath = new LinkedList();
-        File baseDir = 
earContext.getTargetFile(URI.create(webModule.getTargetPath() + "/"));
+    private static void getWebClassPath(EARContext earContext, WebModule 
webModule) {
+        File baseDir = earContext.getTargetFile(webModule.getTargetPathURI());
         File webInfDir = new File(baseDir, "WEB-INF");
 
         // check for a classes dir
         File classesDir = new File(webInfDir, "classes");
         if (classesDir.isDirectory()) {
-            webClassPath.add(URI.create("WEB-INF/classes/"));
+            webModule.addToWebClasspath(URI.create("WEB-INF/classes/"));
         }
 
         // add all of the libs
@@ -959,17 +960,22 @@
             if (libs != null) {
                 for (int i = 0; i < libs.length; i++) {
                     File lib = libs[i];
-                    webClassPath.add(URI.create("WEB-INF/lib/" + 
lib.getName()));
+                    webModule.addToWebClasspath(URI.create("WEB-INF/lib/" + 
lib.getName()));
                 }
             }
         }
-        return (URI[]) webClassPath.toArray(new URI[webClassPath.size()]);
     }
 
-    private ReadOnlyContext buildComponentContext(EARContext earContext, 
WebModule webModule, WebAppType webApp, JettyWebAppType jettyWebApp, 
UserTransaction userTransaction, ClassLoader cl) throws DeploymentException {
+    private ReadOnlyContext buildComponentContext(EARContext earContext, 
Module webModule, WebAppType webApp, JettyWebAppType jettyWebApp, 
UserTransaction userTransaction, ClassLoader cl) throws DeploymentException {
 
+        URI targetPathUri = null;
+        try {
+            targetPathUri = new URI(webModule.getTargetPath() + "/");
+        } catch (URISyntaxException e) {
+            throw new DeploymentException("Could not locate module within 
configuration", e);
+        }
         return ENCConfigBuilder.buildComponentContext(earContext,
-                webModule.getModuleURI(),
+                webModule,
                 userTransaction,
                 webApp.getEnvEntryArray(),
                 webApp.getEjbRefArray(), jettyWebApp.getEjbRefArray(),

Modified: 
geronimo/trunk/modules/jetty-builder/src/test/org/apache/geronimo/jetty/deployment/JettyModuleBuilderTest.java
Url: 
http://svn.apache.org/viewcvs/geronimo/trunk/modules/jetty-builder/src/test/org/apache/geronimo/jetty/deployment/JettyModuleBuilderTest.java?view=diff&rev=125989&p1=geronimo/trunk/modules/jetty-builder/src/test/org/apache/geronimo/jetty/deployment/JettyModuleBuilderTest.java&r1=125988&p2=geronimo/trunk/modules/jetty-builder/src/test/org/apache/geronimo/jetty/deployment/JettyModuleBuilderTest.java&r2=125989
==============================================================================
--- 
geronimo/trunk/modules/jetty-builder/src/test/org/apache/geronimo/jetty/deployment/JettyModuleBuilderTest.java
      (original)
+++ 
geronimo/trunk/modules/jetty-builder/src/test/org/apache/geronimo/jetty/deployment/JettyModuleBuilderTest.java
      Fri Jan 21 16:26:15 2005
@@ -17,7 +17,11 @@
 package org.apache.geronimo.jetty.deployment;
 
 import java.io.File;
+import java.io.IOException;
+import java.io.ByteArrayOutputStream;
+import java.io.ObjectOutputStream;
 import java.net.URI;
+import java.net.URL;
 import java.util.Collections;
 import java.util.HashSet;
 import java.util.Iterator;
@@ -25,6 +29,7 @@
 import java.util.Map;
 import java.util.List;
 import javax.management.ObjectName;
+import javax.management.MalformedObjectNameException;
 import javax.naming.Reference;
 import javax.xml.namespace.QName;
 
@@ -34,6 +39,8 @@
 import org.apache.geronimo.deployment.util.UnpackedJarFile;
 import org.apache.geronimo.deployment.DeploymentContext;
 import org.apache.geronimo.gbean.GBeanData;
+import org.apache.geronimo.gbean.GBeanInfo;
+import org.apache.geronimo.gbean.GBeanInfoBuilder;
 import org.apache.geronimo.j2ee.deployment.EARContext;
 import org.apache.geronimo.j2ee.deployment.EJBReferenceBuilder;
 import org.apache.geronimo.j2ee.deployment.Module;
@@ -46,7 +53,13 @@
 import org.apache.geronimo.jetty.JettyContainerImpl;
 import org.apache.geronimo.jetty.connector.HTTPConnector;
 import org.apache.geronimo.kernel.Kernel;
+import org.apache.geronimo.kernel.jmx.JMXUtil;
+import org.apache.geronimo.kernel.registry.BasicGBeanRegistry;
 import org.apache.geronimo.kernel.config.ConfigurationModuleType;
+import org.apache.geronimo.kernel.config.ConfigurationStore;
+import org.apache.geronimo.kernel.config.InvalidConfigException;
+import org.apache.geronimo.kernel.config.NoSuchConfigException;
+import org.apache.geronimo.kernel.config.Configuration;
 import org.apache.geronimo.kernel.management.State;
 import org.apache.geronimo.security.SecurityServiceImpl;
 import org.apache.geronimo.transaction.manager.TransactionManagerImpl;
@@ -62,7 +75,6 @@
     private ObjectName containerName;
     private ObjectName connectorName;
     private GBeanData connector;
-    private ObjectName webModuleName;
     private ObjectName tmName;
     private ObjectName ctcName;
     private GBeanData tm;
@@ -73,6 +85,7 @@
     private J2eeContext moduleContext = new J2eeContextImpl("jetty.test", 
"test", "null", "jettyTest", null, null);
     private JettyModuleBuilder builder;
     private File basedir = new File(System.getProperty("basedir", "."));
+    private URI parentId = URI.create("org/apache/geronimo/Foo");
 
     public void testDeployWar4() throws Exception {
         File outputPath = new File(basedir, 
"target/test-resources/deployables/war4");
@@ -82,31 +95,26 @@
         UnpackedJarFile jarFile = new UnpackedJarFile(path);
         Module module = builder.createModule(null, jarFile);
         URI id = new URI("war4");
-        URI parentId = null;//new URI("org/apache/geronimo/Server");
-        EARContext earContext = new EARContext(
-                outputPath,
+        EARContext earContext = new EARContext(outputPath,
                 id,
                 ConfigurationModuleType.WAR,
                 parentId,
                 kernel,
-                moduleContext.getJ2eeDomainName(),
-                moduleContext.getJ2eeServerName(),
                 moduleContext.getJ2eeApplicationName(),
                 tcmName,
                 ctcName,
                 null,
                 null,
-                new RefContext(
-                        new EJBReferenceBuilder() {
+                new RefContext(new EJBReferenceBuilder() {
 
-                            public Reference createEJBLocalReference(String 
objectName, boolean isSession, String localHome, String local) throws 
DeploymentException {
-                                return null;
-                            }
-
-                            public Reference createEJBRemoteReference(String 
objectName, boolean isSession, String home, String remote) throws 
DeploymentException {
-                                return null;
-                            }
-                        },
+                    public Reference createEJBLocalReference(String 
objectName, boolean isSession, String localHome, String local) throws 
DeploymentException {
+                        return null;
+                    }
+
+                    public Reference createEJBRemoteReference(String 
objectName, boolean isSession, String home, String remote) throws 
DeploymentException {
+                        return null;
+                    }
+                },
                         new ResourceReferenceBuilder() {
 
                             public Reference createResourceRef(String 
containerId, Class iface) throws DeploymentException {
@@ -137,12 +145,12 @@
                                 return null;
                             }
                         },
-                         new ServiceReferenceBuilder() {
-                             //it could return a Service or a Reference, we 
don't care
-                             public Object createService(Class 
serviceInterface, URI wsdlURI, URI jaxrpcMappingURI, QName serviceQName, Map 
portComponentRefMap, List handlers, DeploymentContext deploymentContext, 
ClassLoader classLoader) throws DeploymentException {
-                                 return null;
-                             }
-                         }));
+                        new ServiceReferenceBuilder() {
+                            //it could return a Service or a Reference, we 
don't care
+                            public Object createService(Class 
serviceInterface, URI wsdlURI, URI jaxrpcMappingURI, QName serviceQName, Map 
portComponentRefMap, List handlers, DeploymentContext deploymentContext, Module 
module, ClassLoader classLoader) throws DeploymentException {
+                                return null;
+                            }
+                        }));
         builder.initContext(earContext, module, cl);
         builder.addGBeans(earContext, module, cl);
         earContext.close();
@@ -150,15 +158,19 @@
         GBeanData configData = earContext.getConfigurationGBeanData();
         configData.setAttribute("baseURL", path.toURL());
         kernel.loadGBean(configData, cl);
+
         kernel.startRecursiveGBean(configData.getName());
-        Set names = 
kernel.listGBeans(ObjectName.getInstance("jetty.test:J2EEApplication=null,J2EEServer=test,WebModule=war4,*"));
+        if (((Integer) kernel.getAttribute(configData.getName(), 
"state")).intValue() != State.RUNNING_INDEX) {
+            fail("gbean not started: " + configData.getName());
+        }
+        Set names = 
kernel.listGBeans(ObjectName.getInstance("test:J2EEApplication=null,J2EEServer=bar,WebModule=war4,*"));
         System.out.println("Object names: " + names);
         for (Iterator iterator = names.iterator(); iterator.hasNext();) {
             ObjectName objectName = (ObjectName) iterator.next();
             assertEquals(new Integer(State.RUNNING_INDEX), 
kernel.getAttribute(objectName, "state"));
         }
-        GBeanData filterMapping2Data = 
kernel.getGBeanData(ObjectName.getInstance("jetty.test:J2EEApplication=null,J2EEServer=test,Servlet=Servlet1,WebFilter=Filter2,WebModule=war4,j2eeType=WebFilterMapping"));
-        
assertEquals(Collections.singleton(ObjectName.getInstance("jetty.test:J2EEApplication=null,J2EEServer=test,Servlet=Servlet1,WebFilter=Filter1,WebModule=war4,j2eeType=WebFilterMapping")),
 filterMapping2Data.getReferencePatterns("Previous"));
+        GBeanData filterMapping2Data = 
kernel.getGBeanData(ObjectName.getInstance("test:J2EEApplication=null,J2EEServer=bar,Servlet=Servlet1,WebFilter=Filter2,WebModule=war4,j2eeType=WebFilterMapping"));
+        
assertEquals(Collections.singleton(ObjectName.getInstance("test:J2EEApplication=null,J2EEServer=bar,Servlet=Servlet1,WebFilter=Filter1,WebModule=war4,j2eeType=WebFilterMapping")),
 filterMapping2Data.getReferencePatterns("Previous"));
 
         kernel.stopGBean(configData.getName());
         kernel.unloadGBean(configData.getName());
@@ -172,7 +184,7 @@
     private void recursiveDelete(File path) {
         //does not delete top level dir passed in
         File[] listing = path.listFiles();
-        for (int i = 0; i < ((listing == null)? 0: listing.length); i++) {
+        for (int i = 0; i < ((listing == null) ? 0 : listing.length); i++) {
             File file = listing[i];
             if (file.isDirectory()) {
                 recursiveDelete(file);
@@ -185,14 +197,23 @@
         cl = this.getClass().getClassLoader();
         containerName = NameFactory.getWebComponentName(null, null, null, 
null, "jettyContainer", "WebResource", moduleContext);
         connectorName = NameFactory.getWebComponentName(null, null, null, 
null, "jettyConnector", "WebResource", moduleContext);
-        webModuleName = NameFactory.getWebComponentName(null, null, null, 
null, NameFactory.WEB_MODULE, "WebResource", moduleContext);
+//        webModuleName = NameFactory.getWebComponentName(null, null, null, 
null, NameFactory.WEB_MODULE, "WebResource", moduleContext);
 
         tmName = NameFactory.getComponentName(null, null, null, null, 
"TransactionManager", NameFactory.JTA_RESOURCE, moduleContext);
         tcmName = NameFactory.getComponentName(null, null, null, null, 
"TransactionContextManager", NameFactory.JTA_RESOURCE, moduleContext);
         ctcName = new 
ObjectName("geronimo.test:role=ConnectionTrackingCoordinator");
 
-        kernel = new Kernel("test.kernel");
+        kernel = new Kernel("foo", new BasicGBeanRegistry());
         kernel.boot();
+
+        GBeanData store = new 
GBeanData(JMXUtil.getObjectName("foo:j2eeType=ConfigurationStore,name=mock"), 
MockConfigStore.GBEAN_INFO);
+        kernel.loadGBean(store, this.getClass().getClassLoader());
+        kernel.startGBean(store.getName());
+
+        GBeanData baseConfig = (GBeanData) kernel.invoke(store.getName(), 
"getConfiguration", new Object[]{parentId}, new String[]{URI.class.getName()});
+        kernel.loadGBean(baseConfig, this.getClass().getClassLoader());
+        kernel.startGBean(baseConfig.getName());
+
         ObjectName defaultServlets = 
ObjectName.getInstance("test:name=test,type=none,*");
         //install the policy configuration factory
         SecurityServiceImpl securityService = new 
SecurityServiceImpl("org.apache.geronimo.security.jacc.GeronimoPolicyConfigurationFactory");
@@ -228,18 +249,90 @@
         stop(containerName);
         kernel.shutdown();
     }
+
     private void start(GBeanData gbeanData) throws Exception {
-         kernel.loadGBean(gbeanData, cl);
-         kernel.startGBean(gbeanData.getName());
-         if (((Integer)kernel.getAttribute(gbeanData.getName(), 
"state")).intValue() != State.RUNNING_INDEX ) {
-             fail("gbean not started: " + gbeanData.getName());
-         }
-     }
-
-     private void stop(ObjectName name) throws Exception {
-         kernel.stopGBean(name);
-         kernel.unloadGBean(name);
-     }
+        kernel.loadGBean(gbeanData, cl);
+        kernel.startGBean(gbeanData.getName());
+        if (((Integer) kernel.getAttribute(gbeanData.getName(), 
"state")).intValue() != State.RUNNING_INDEX) {
+            fail("gbean not started: " + gbeanData.getName());
+        }
+    }
+
+    private void stop(ObjectName name) throws Exception {
+        kernel.stopGBean(name);
+        kernel.unloadGBean(name);
+    }
+
+    public static class MockConfigStore implements ConfigurationStore {
+        public URI install(URL source) throws IOException, 
InvalidConfigException {
+            return null;
+        }
+
+        public URI install(File source) throws IOException, 
InvalidConfigException {
+            return null;
+        }
+
+        public void uninstall(URI configID) throws NoSuchConfigException, 
IOException {
+
+        }
+
+        public boolean containsConfiguration(URI configID) {
+            return true;
+        }
+
+        public GBeanData getConfiguration(URI id) throws 
NoSuchConfigException, IOException, InvalidConfigException {
+            GBeanData configData = null;
+            try {
+                configData = new 
GBeanData(Configuration.getConfigurationObjectName(id), 
Configuration.GBEAN_INFO);
+            } catch (MalformedObjectNameException e) {
+                throw new InvalidConfigException(e);
+            }
+            configData.setAttribute("ID", id);
+            configData.setAttribute("domain", "test");
+            configData.setAttribute("server", "bar");
+            configData.setAttribute("gBeanState", NO_OBJECTS_OS);
+            return configData;
+        }
+
+        public void updateConfiguration(Configuration configuration) throws 
NoSuchConfigException, Exception {
+
+        }
+
+        public URL getBaseURL(URI id) throws NoSuchConfigException {
+            return null;
+        }
+
+        public String getObjectName() {
+            return null;
+        }
+
+        public List listConfiguations() {
+            return null;
+        }
+
+        public File createNewConfigurationDir() {
+            return null;
+        }
+
+        public final static GBeanInfo GBEAN_INFO;
+
+        private static final byte[] NO_OBJECTS_OS;
+
+        static {
+            GBeanInfoBuilder infoBuilder = new 
GBeanInfoBuilder(MockConfigStore.class);
+            infoBuilder.addInterface(ConfigurationStore.class);
+            GBEAN_INFO = infoBuilder.getBeanInfo();
+
+            ByteArrayOutputStream baos = new ByteArrayOutputStream();
+            try {
+                ObjectOutputStream oos = new ObjectOutputStream(baos);
+                oos.flush();
+                NO_OBJECTS_OS = baos.toByteArray();
+            } catch (IOException e) {
+                throw new RuntimeException(e);
+            }
+        }
+    };
 
 
 }

Modified: 
geronimo/trunk/modules/jetty-builder/src/test/org/apache/geronimo/jetty/deployment/PlanParsingTest.java
Url: 
http://svn.apache.org/viewcvs/geronimo/trunk/modules/jetty-builder/src/test/org/apache/geronimo/jetty/deployment/PlanParsingTest.java?view=diff&rev=125989&p1=geronimo/trunk/modules/jetty-builder/src/test/org/apache/geronimo/jetty/deployment/PlanParsingTest.java&r1=125988&p2=geronimo/trunk/modules/jetty-builder/src/test/org/apache/geronimo/jetty/deployment/PlanParsingTest.java&r2=125989
==============================================================================
--- 
geronimo/trunk/modules/jetty-builder/src/test/org/apache/geronimo/jetty/deployment/PlanParsingTest.java
     (original)
+++ 
geronimo/trunk/modules/jetty-builder/src/test/org/apache/geronimo/jetty/deployment/PlanParsingTest.java
     Fri Jan 21 16:26:15 2005
@@ -37,4 +37,8 @@
         SchemaConversionUtils.validateDD(jettyWebAppType);
         System.out.println(jettyWebAppType.toString());
     }
+
+    public void testParseSpecDD() {
+
+    }
 }

Modified: 
geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/config/Configuration.java
Url: 
http://svn.apache.org/viewcvs/geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/config/Configuration.java?view=diff&rev=125989&p1=geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/config/Configuration.java&r1=125988&p2=geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/config/Configuration.java&r2=125989
==============================================================================
--- 
geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/config/Configuration.java
 (original)
+++ 
geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/config/Configuration.java
 Fri Jan 21 16:26:15 2005
@@ -123,6 +123,9 @@
      */
     private final ConfigurationStore configurationStore;
 
+    private final String domain;
+    private final String server;
+
     /**
      * The names of all GBeans contained in this configuration.
      */
@@ -140,6 +143,7 @@
      */
     private byte[] gbeanState;
 
+
     /**
      * Constructor that can be used to create an offline Configuration, 
typically
      * only used publically during the deployment process for initial 
configuration.
@@ -159,6 +163,8 @@
             URL baseURL,
             URI parentID,
             ConfigurationParent parent,
+            String domain,
+            String server,
             List classPath,
             byte[] gbeanState,
             Collection repositories,
@@ -175,6 +181,9 @@
 
         this.configurationStore = configurationStore;
 
+        this.domain = domain;
+        this.server = server;
+
         // build configurationClassLoader
         URL[] urls = resolveClassPath(classPath, baseURL, dependencies, 
repositories);
         log.debug("ClassPath for " + id + " resolved to " + 
Arrays.asList(urls));
@@ -259,6 +268,14 @@
         return objectNameString;
     }
 
+    public String getDomain() {
+        return domain;
+    }
+
+    public String getServer() {
+        return server;
+    }
+
     private static void setGBeanBaseUrl(GBeanData gbeanData, URL baseUrl) {
         GBeanInfo gbeanInfo = gbeanData.getGBeanInfo();
         Set attributes = gbeanInfo.getAttributes();
@@ -441,6 +458,8 @@
         infoFactory.addAttribute("ID", URI.class, true);
         infoFactory.addAttribute("type", ConfigurationModuleType.class, true);
         infoFactory.addAttribute("parentID", URI.class, true);
+        infoFactory.addAttribute("domain", String.class, true);
+        infoFactory.addAttribute("server", String.class, true);
         infoFactory.addAttribute("classPath", List.class, true);
         infoFactory.addAttribute("dependencies", List.class, true);
         infoFactory.addAttribute("gBeanState", byte[].class, true);
@@ -459,6 +478,8 @@
             "baseURL",
             "parentID",
             "Parent",
+            "domain",
+            "server",
             "classPath",
             "gBeanState",
             "Repositories",

Modified: 
geronimo/trunk/modules/naming-builder/src/java/org/apache/geronimo/naming/deployment/ENCConfigBuilder.java
Url: 
http://svn.apache.org/viewcvs/geronimo/trunk/modules/naming-builder/src/java/org/apache/geronimo/naming/deployment/ENCConfigBuilder.java?view=diff&rev=125989&p1=geronimo/trunk/modules/naming-builder/src/java/org/apache/geronimo/naming/deployment/ENCConfigBuilder.java&r1=125988&p2=geronimo/trunk/modules/naming-builder/src/java/org/apache/geronimo/naming/deployment/ENCConfigBuilder.java&r2=125989
==============================================================================
--- 
geronimo/trunk/modules/naming-builder/src/java/org/apache/geronimo/naming/deployment/ENCConfigBuilder.java
  (original)
+++ 
geronimo/trunk/modules/naming-builder/src/java/org/apache/geronimo/naming/deployment/ENCConfigBuilder.java
  Fri Jan 21 16:26:15 2005
@@ -39,6 +39,7 @@
 import org.apache.geronimo.common.DeploymentException;
 import org.apache.geronimo.j2ee.deployment.EARContext;
 import org.apache.geronimo.j2ee.deployment.RefContext;
+import org.apache.geronimo.j2ee.deployment.Module;
 import org.apache.geronimo.j2ee.j2eeobjectnames.J2eeContext;
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
 import org.apache.geronimo.kernel.Kernel;
@@ -417,7 +418,7 @@
     }
 
     //TODO current implementation does not deal with portComponentRefs or 
handlers.
-    public static void addServiceRefs(EARContext earContext, URI uri, 
ServiceRefType[] serviceRefs, ClassLoader cl, ComponentContextBuilder builder) 
throws DeploymentException {
+    public static void addServiceRefs(EARContext earContext, Module module, 
ServiceRefType[] serviceRefs, ClassLoader cl, ComponentContextBuilder builder) 
throws DeploymentException {
         RefContext refContext = earContext.getRefContext();
 
         for (int i = 0; i < serviceRefs.length; i++) {
@@ -466,7 +467,7 @@
             List handlers = Arrays.asList(handlerTypes);
 
             //we could get a Reference or the actual serializable Service back.
-            Object ref = refContext.getServiceReference(serviceInterface, 
wsdlURI, jaxrpcMappingURI, serviceQName, portComponentRefMap, handlers, 
earContext, cl);
+            Object ref = refContext.getServiceReference(serviceInterface, 
wsdlURI, jaxrpcMappingURI, serviceQName, portComponentRefMap, handlers, 
earContext, module, cl);
             try {
                 builder.bind(name, ref);
             } catch (NamingException e) {
@@ -559,7 +560,7 @@
         
builder.setApplicationManagedSecurityResources(applicationManagedSecurityResources);
     }
 
-    public static ReadOnlyContext buildComponentContext(EARContext earContext, 
URI uri, UserTransaction userTransaction, EnvEntryType[] envEntries, 
EjbRefType[] ejbRefs, GerEjbRefType[] gerEjbRefs, EjbLocalRefType[] 
ejbLocalRefs, GerEjbLocalRefType[] gerEjbLocalRef, ResourceRefType[] 
resourceRefs, GerResourceRefType[] gerResourceRef, ResourceEnvRefType[] 
resourceEnvRefs, GerResourceEnvRefType[] gerResourceEnvRef, 
MessageDestinationRefType[] messageDestinationRefs, ServiceRefType[] 
serviceRefs, ClassLoader cl) throws DeploymentException {
+    public static ReadOnlyContext buildComponentContext(EARContext earContext, 
Module module, UserTransaction userTransaction, EnvEntryType[] envEntries, 
EjbRefType[] ejbRefs, GerEjbRefType[] gerEjbRefs, EjbLocalRefType[] 
ejbLocalRefs, GerEjbLocalRefType[] gerEjbLocalRef, ResourceRefType[] 
resourceRefs, GerResourceRefType[] gerResourceRef, ResourceEnvRefType[] 
resourceEnvRefs, GerResourceEnvRefType[] gerResourceEnvRef, 
MessageDestinationRefType[] messageDestinationRefs, ServiceRefType[] 
serviceRefs, ClassLoader cl) throws DeploymentException {
         ComponentContextBuilder builder = new ComponentContextBuilder();
 
         if (userTransaction != null) {
@@ -570,6 +571,8 @@
             }
         }
 
+        URI uri = module.getConfigId();
+
         addEnvEntries(envEntries, builder, cl);
 
         // ejb-ref
@@ -586,7 +589,7 @@
 
         addMessageDestinationRefs(earContext, uri, messageDestinationRefs, cl, 
builder);
 
-        addServiceRefs(earContext, uri, serviceRefs, cl, builder);
+        addServiceRefs(earContext, module, serviceRefs, cl, builder);
 
         return builder.getContext();
     }

Modified: 
geronimo/trunk/modules/service-builder/src/java/org/apache/geronimo/deployment/service/ServiceConfigBuilder.java
Url: 
http://svn.apache.org/viewcvs/geronimo/trunk/modules/service-builder/src/java/org/apache/geronimo/deployment/service/ServiceConfigBuilder.java?view=diff&rev=125989&p1=geronimo/trunk/modules/service-builder/src/java/org/apache/geronimo/deployment/service/ServiceConfigBuilder.java&r1=125988&p2=geronimo/trunk/modules/service-builder/src/java/org/apache/geronimo/deployment/service/ServiceConfigBuilder.java&r2=125989
==============================================================================
--- 
geronimo/trunk/modules/service-builder/src/java/org/apache/geronimo/deployment/service/ServiceConfigBuilder.java
    (original)
+++ 
geronimo/trunk/modules/service-builder/src/java/org/apache/geronimo/deployment/service/ServiceConfigBuilder.java
    Fri Jan 21 16:26:15 2005
@@ -20,15 +20,15 @@
 import java.io.File;
 import java.io.IOException;
 import java.io.InputStream;
+import java.net.MalformedURLException;
 import java.net.URI;
 import java.net.URISyntaxException;
 import java.net.URL;
-import java.net.MalformedURLException;
 import java.net.URLClassLoader;
 import java.util.Collections;
+import java.util.HashSet;
 import java.util.List;
 import java.util.Set;
-import java.util.HashSet;
 import java.util.jar.JarFile;
 import javax.management.MalformedObjectNameException;
 import javax.management.ObjectName;
@@ -47,12 +47,12 @@
 import org.apache.geronimo.gbean.GBeanData;
 import org.apache.geronimo.gbean.GBeanInfo;
 import org.apache.geronimo.gbean.GBeanInfoBuilder;
-import org.apache.geronimo.kernel.Kernel;
-import org.apache.geronimo.kernel.config.ConfigurationModuleType;
-import org.apache.geronimo.kernel.repository.Repository;
 import org.apache.geronimo.j2ee.j2eeobjectnames.J2eeContext;
 import org.apache.geronimo.j2ee.j2eeobjectnames.J2eeContextImpl;
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
+import org.apache.geronimo.kernel.Kernel;
+import org.apache.geronimo.kernel.config.ConfigurationModuleType;
+import org.apache.geronimo.kernel.repository.Repository;
 import org.apache.xmlbeans.XmlException;
 
 /**
@@ -62,18 +62,13 @@
     private final URI defaultParentId;
     private final Repository repository;
     private final Kernel kernel;
-    private final String j2eeServerName;
-    private final String j2eeDomainName;
 
-    public ServiceConfigBuilder(URI defaultParentId, Repository repository) 
throws MalformedObjectNameException {
-        //todo include the objectname as a constructor arg
-        this(defaultParentId, new ObjectName("geronimo.server:name=geronimo"), 
repository, null);
+    public ServiceConfigBuilder(URI defaultParentId, Repository repository) {
+        this(defaultParentId, repository, null);
     }
 
-    public ServiceConfigBuilder(URI defaultParentId, ObjectName j2eeServer, 
Repository repository, Kernel kernel) {
+    public ServiceConfigBuilder(URI defaultParentId, Repository repository, 
Kernel kernel) {
         this.defaultParentId = defaultParentId;
-        j2eeServerName = j2eeServer.getKeyProperty("name");
-        j2eeDomainName = j2eeServer.getDomain();
         this.repository = repository;
         this.kernel = kernel;
     }
@@ -96,35 +91,56 @@
 
     public List buildConfiguration(Object plan, JarFile unused, File outfile) 
throws IOException, DeploymentException {
         ConfigurationType configType = (ConfigurationType) plan;
+        String domain = null;
+        String server = null;
+
+        buildConfiguration(configType, domain, server, outfile);
+
+        return Collections.EMPTY_LIST;
+    }
+
+    public void buildConfiguration(ConfigurationType configType, String 
domain, String server, File outfile) throws DeploymentException, IOException {
+        URI parentID = null;
+        if (configType.isSetParentId()) {
+            try {
+                parentID = new URI(configType.getParentId());
+            } catch (URISyntaxException e) {
+                throw new DeploymentException("Invalid parentId " + 
configType.getParentId(), e);
+            }
+        } else {
+            if (configType.isSetDomain()) {
+                if (!configType.isSetServer()) {
+                    throw new DeploymentException("You must set both domain 
and server");
+                }
+                domain = configType.getDomain();
+                server = configType.getServer();
+            } else {
+                parentID = defaultParentId;
+            }
+        }
+
+        if (domain == null) {
+            //get from parent id
+            if (kernel == null) {
+                throw new DeploymentException("You must supply a kernel or the 
domain and server names");
+            }
+        }
+
         URI configID;
         try {
             configID = new URI(configType.getConfigId());
         } catch (URISyntaxException e) {
             throw new DeploymentException("Invalid configId " + 
configType.getConfigId(), e);
         }
-        URI parentID;
-        if (configType.isSetParentId()) {
-            if (configType.getParentId().equals("")) {
-                parentID = null;
-            } else {
-                try {
-                    parentID = new URI(configType.getParentId());
-                } catch (URISyntaxException e) {
-                    throw new DeploymentException("Invalid parentId " + 
configType.getParentId(), e);
-                }
-            }
-        } else {
-            parentID = defaultParentId;
-        }
 
         DeploymentContext context = null;
         try {
-            context = new DeploymentContext(outfile, configID, 
ConfigurationModuleType.SERVICE, parentID, kernel);
+            context = new DeploymentContext(outfile, configID, 
ConfigurationModuleType.SERVICE, parentID, domain, server, kernel);
         } catch (MalformedObjectNameException e) {
             throw new DeploymentException(e);
         }
 
-        J2eeContext j2eeContext = new J2eeContextImpl(j2eeDomainName, 
j2eeServerName, NameFactory.NULL, configID.toString(), null, null);
+        J2eeContext j2eeContext = new J2eeContextImpl(context.getDomain(), 
context.getServer(), NameFactory.NULL, configID.toString(), null, null);
         DependencyType[] includes = configType.getIncludeArray();
         addIncludes(context, includes, repository);
         addDependencies(context, configType.getDependencyArray(), repository);
@@ -132,8 +148,6 @@
         GbeanType[] gbeans = configType.getGbeanArray();
         addGBeans(gbeans, cl, j2eeContext, context);
         context.close();
-
-        return Collections.EMPTY_LIST;
     }
 
     public static void addIncludes(DeploymentContext context, DependencyType[] 
includes, Repository repository) throws DeploymentException {
@@ -277,11 +291,10 @@
         infoFactory.addInterface(ConfigurationBuilder.class);
 
         infoFactory.addAttribute("defaultParentId", URI.class, true);
-        infoFactory.addAttribute("j2eeServer", ObjectName.class, true);
         infoFactory.addReference("Repository", Repository.class);
         infoFactory.addAttribute("kernel", Kernel.class, false);
 
-        infoFactory.setConstructor(new String[]{"defaultParentId", 
"j2eeServer", "Repository", "kernel"});
+        infoFactory.setConstructor(new String[]{"defaultParentId", 
"Repository", "kernel"});
 
         GBEAN_INFO = infoFactory.getBeanInfo();
     }

Modified: geronimo/trunk/modules/service-builder/src/schema/geronimo-config.xsd
Url: 
http://svn.apache.org/viewcvs/geronimo/trunk/modules/service-builder/src/schema/geronimo-config.xsd?view=diff&rev=125989&p1=geronimo/trunk/modules/service-builder/src/schema/geronimo-config.xsd&r1=125988&p2=geronimo/trunk/modules/service-builder/src/schema/geronimo-config.xsd&r2=125989
==============================================================================
--- geronimo/trunk/modules/service-builder/src/schema/geronimo-config.xsd       
(original)
+++ geronimo/trunk/modules/service-builder/src/schema/geronimo-config.xsd       
Fri Jan 21 16:26:15 2005
@@ -43,7 +43,16 @@
             <xs:element ref="sys:gbean" minOccurs="0" maxOccurs="unbounded"/>
         </xs:sequence>
         <xs:attribute name="configId" type="xs:string" use="required"/>
-        <xs:attribute name="parentId" type="xs:string" use="optional"/>
+        <xs:attribute name="parentId" type="xs:string" use="optional">
+            <xs:annotation>
+                <xs:documentation>
+                You are required to specify either parentId or both domain and 
server.  domain and server form
+                the domain and J2EEServer key for gbeans in this configuration 
and any descendant configurations.
+                </xs:documentation>
+            </xs:annotation>
+        </xs:attribute>
+        <xs:attribute name="domain" type="xs:string" use="optional"/>
+        <xs:attribute name="server" type="xs:string" use="optional"/>
     </xs:complexType>
 
     <xs:element name="dependency" type="sys:dependencyType"/>

Reply via email to