geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject svn commit: r386276 [1/4] - in /geronimo/branches/1.1: applications/console-core/src/java/org/apache/geronimo/console/util/ applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/handlers/ configs/client-system/src/plan/ configs/...
Date Thu, 16 Mar 2006 06:49:41 GMT
Author: dain
Date: Wed Mar 15 22:49:33 2006
New Revision: 386276

URL: http://svn.apache.org/viewcvs?rev=386276&view=rev
Log:
Split ConfigurationMangerImpl into a SimpleConfigurationManager and a KernelConfigurationManager.
Made Naming an interface which is retrieved from Kernel.

Added:
    geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/Jsr77Naming.java
      - copied, changed from r386128, geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/Naming.java
    geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/Naming.java
    geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/config/EditableKernelConfigurationManager.java   (contents, props changed)
      - copied, changed from r385892, geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/config/EditableConfigurationManagerImpl.java
    geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/config/KernelConfigurationManager.java   (contents, props changed)
      - copied, changed from r385892, geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/config/ConfigurationManagerImpl.java
    geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/config/SimpleConfigurationManager.java
Removed:
    geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/config/ConfigurationManagerImpl.java
    geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/config/EditableConfigurationManagerImpl.java
Modified:
    geronimo/branches/1.1/applications/console-core/src/java/org/apache/geronimo/console/util/KernelManagementHelper.java
    geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/handlers/CreateDestinationHandler.java
    geronimo/branches/1.1/configs/client-system/src/plan/plan.xml
    geronimo/branches/1.1/configs/j2ee-system/src/plan/plan.xml
    geronimo/branches/1.1/modules/axis-builder/src/test/org/apache/geronimo/axis/builder/ServiceReferenceTest.java
    geronimo/branches/1.1/modules/client-builder/src/java/org/apache/geronimo/client/builder/AppClientModuleBuilder.java
    geronimo/branches/1.1/modules/client-builder/src/test/org/apache/geronimo/client/builder/PlanParsingTest.java
    geronimo/branches/1.1/modules/connector-builder/src/java/org/apache/geronimo/connector/deployment/ConnectorModuleBuilder.java
    geronimo/branches/1.1/modules/connector-builder/src/test/org/apache/geronimo/connector/deployment/ConnectorModuleBuilderTest.java
    geronimo/branches/1.1/modules/deploy-tool/src/java/org/apache/geronimo/deployment/PluginBootstrap.java
    geronimo/branches/1.1/modules/deployment/src/java/org/apache/geronimo/deployment/DeploymentContext.java
    geronimo/branches/1.1/modules/deployment/src/test/org/apache/geronimo/deployment/DeploymentContextTest.java
    geronimo/branches/1.1/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder.java
    geronimo/branches/1.1/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/EARContext.java
    geronimo/branches/1.1/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/ModuleBuilder.java
    geronimo/branches/1.1/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/RefContext.java
    geronimo/branches/1.1/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/SwitchingModuleBuilder.java
    geronimo/branches/1.1/modules/j2ee-builder/src/test/org/apache/geronimo/j2ee/deployment/EARConfigBuilderTest.java
    geronimo/branches/1.1/modules/j2ee-builder/src/test/org/apache/geronimo/j2ee/deployment/EJBRefContextTest.java
    geronimo/branches/1.1/modules/j2ee-builder/src/test/org/apache/geronimo/j2ee/deployment/MockConnectorConfigBuilder.java
    geronimo/branches/1.1/modules/j2ee-builder/src/test/org/apache/geronimo/j2ee/deployment/MockEJBConfigBuilder.java
    geronimo/branches/1.1/modules/j2ee-builder/src/test/org/apache/geronimo/j2ee/deployment/MockWARConfigBuilder.java
    geronimo/branches/1.1/modules/j2ee/src/java/org/apache/geronimo/j2ee/j2eeobjectnames/NameFactory.java
    geronimo/branches/1.1/modules/jetty-builder/src/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java
    geronimo/branches/1.1/modules/jetty-builder/src/test/org/apache/geronimo/jetty/deployment/JettyModuleBuilderTest.java
    geronimo/branches/1.1/modules/jetty/src/java/org/apache/geronimo/jetty/JettyManagerImpl.java
    geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/gbean/AbstractName.java
    geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/gbean/GBeanData.java
    geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/Kernel.java
    geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/KernelGBean.java
    geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/basic/BasicKernel.java
    geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/config/Configuration.java
    geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/config/ConfigurationData.java
    geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/config/ConfigurationUtil.java
    geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/config/EditableConfigurationManager.java
    geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/jmx/KernelDelegate.java
    geronimo/branches/1.1/modules/kernel/src/test/org/apache/geronimo/gbean/Speed.java
    geronimo/branches/1.1/modules/kernel/src/test/org/apache/geronimo/gbean/runtime/GBeanAttributeTest.java
    geronimo/branches/1.1/modules/kernel/src/test/org/apache/geronimo/gbean/runtime/GBeanDependencyTest.java
    geronimo/branches/1.1/modules/kernel/src/test/org/apache/geronimo/kernel/ConfigTest.java
    geronimo/branches/1.1/modules/kernel/src/test/org/apache/geronimo/kernel/GBeanTest.java
    geronimo/branches/1.1/modules/kernel/src/test/org/apache/geronimo/kernel/config/ConfigurationManagerTest.java
    geronimo/branches/1.1/modules/kernel/src/test/org/apache/geronimo/kernel/repository/ArtifactResolverTest.java
    geronimo/branches/1.1/modules/naming-builder/src/test/org/apache/geronimo/naming/deployment/MessageDestinationTest.java
    geronimo/branches/1.1/modules/security-builder/src/java/org/apache/geronimo/security/deployment/LoginConfigBuilder.java
    geronimo/branches/1.1/modules/security-builder/src/java/org/apache/geronimo/security/deployment/SecurityBuilder.java
    geronimo/branches/1.1/modules/service-builder/src/java/org/apache/geronimo/deployment/service/ServiceConfigBuilder.java
    geronimo/branches/1.1/modules/service-builder/src/test/org/apache/geronimo/deployment/service/ServiceConfigBuilderTest.java
    geronimo/branches/1.1/modules/tomcat-builder/src/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilder.java
    geronimo/branches/1.1/modules/tomcat-builder/src/test/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilderTest.java
    geronimo/branches/1.1/modules/tomcat/src/java/org/apache/geronimo/tomcat/TomcatManagerImpl.java
    geronimo/branches/1.1/modules/web-builder/src/java/org/apache/geronimo/web/deployment/AbstractWebModuleBuilder.java
    geronimo/branches/1.1/plugins/geronimo-packaging-plugin/src/java/org/apache/geronimo/plugin/packaging/PackageBuilder.java

Modified: geronimo/branches/1.1/applications/console-core/src/java/org/apache/geronimo/console/util/KernelManagementHelper.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/applications/console-core/src/java/org/apache/geronimo/console/util/KernelManagementHelper.java?rev=386276&r1=386275&r2=386276&view=diff
==============================================================================
--- geronimo/branches/1.1/applications/console-core/src/java/org/apache/geronimo/console/util/KernelManagementHelper.java (original)
+++ geronimo/branches/1.1/applications/console-core/src/java/org/apache/geronimo/console/util/KernelManagementHelper.java Wed Mar 15 22:49:33 2006
@@ -90,7 +90,7 @@
  * kernel. That may be an in-VM kernel or a remote kernel, we don't really
  * care.
  *
- * @version $Rev$ $Date$
+ * @version $Rev: 385886 $ $Date$
  */
 public class KernelManagementHelper implements ManagementHelper {
     private final static Log log = LogFactory.getLog(KernelManagementHelper.class);
@@ -109,7 +109,7 @@
         int i = 0;
         for (Iterator iterator = domainNames.iterator(); iterator.hasNext();) {
             ObjectName domainName = (ObjectName) iterator.next();
-            result[i++] = (J2EEDomain) pm.createProxy(domainName, J2EEDomain.class)
+            result[i++] = (J2EEDomain) pm.createProxy(domainName, J2EEDomain.class);
         }
         return result;
     }

Modified: geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/handlers/CreateDestinationHandler.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/handlers/CreateDestinationHandler.java?rev=386276&r1=386275&r2=386276&view=diff
==============================================================================
--- geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/handlers/CreateDestinationHandler.java (original)
+++ geronimo/branches/1.1/applications/console-standard/src/java/org/apache/geronimo/console/jmsmanager/handlers/CreateDestinationHandler.java Wed Mar 15 22:49:33 2006
@@ -146,7 +146,8 @@
                     new LinkedHashSet(),
                     gbeans,
                     Collections.EMPTY_LIST,
-                    environment, configurationDir);
+                    environment, configurationDir,
+                    kernel.getNaming());
 
             //saves it.
             //deploymentContext.close();

Modified: geronimo/branches/1.1/configs/client-system/src/plan/plan.xml
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/configs/client-system/src/plan/plan.xml?rev=386276&r1=386275&r2=386276&view=diff
==============================================================================
--- geronimo/branches/1.1/configs/client-system/src/plan/plan.xml (original)
+++ geronimo/branches/1.1/configs/client-system/src/plan/plan.xml Wed Mar 15 22:49:33 2006
@@ -35,7 +35,7 @@
     <gbean name="ServerInfo" class="org.apache.geronimo.system.serverinfo.BasicServerInfo"/>
 
     <!-- Configuration Manager service -->
-    <gbean name="ConfigurationManager" class="org.apache.geronimo.kernel.config.ConfigurationManagerImpl">
+    <gbean name="ConfigurationManager" class="org.apache.geronimo.kernel.config.KernelConfigurationManager">
         <reference name="Stores">
             <gbean-name>*:j2eeType=ConfigurationStore,*</gbean-name>
         </reference>

Modified: geronimo/branches/1.1/configs/j2ee-system/src/plan/plan.xml
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/configs/j2ee-system/src/plan/plan.xml?rev=386276&r1=386275&r2=386276&view=diff
==============================================================================
--- geronimo/branches/1.1/configs/j2ee-system/src/plan/plan.xml (original)
+++ geronimo/branches/1.1/configs/j2ee-system/src/plan/plan.xml Wed Mar 15 22:49:33 2006
@@ -80,7 +80,7 @@
   </gbean>
 
   <!--Configuration Manager service-->
-  <gbean name="ConfigurationManager" class="org.apache.geronimo.kernel.config.EditableConfigurationManagerImpl">
+  <gbean name="ConfigurationManager" class="org.apache.geronimo.kernel.config.EditableKernelConfigurationManager">
     <reference name="Stores">
       <gbean-name>*:j2eeType=ConfigurationStore,*</gbean-name>
     </reference>

Modified: geronimo/branches/1.1/modules/axis-builder/src/test/org/apache/geronimo/axis/builder/ServiceReferenceTest.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/axis-builder/src/test/org/apache/geronimo/axis/builder/ServiceReferenceTest.java?rev=386276&r1=386275&r2=386276&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/axis-builder/src/test/org/apache/geronimo/axis/builder/ServiceReferenceTest.java (original)
+++ geronimo/branches/1.1/modules/axis-builder/src/test/org/apache/geronimo/axis/builder/ServiceReferenceTest.java Wed Mar 15 22:49:33 2006
@@ -71,6 +71,7 @@
 import org.apache.geronimo.j2ee.deployment.Module;
 import org.apache.geronimo.kernel.config.ConfigurationModuleType;
 import org.apache.geronimo.kernel.repository.Artifact;
+import org.apache.geronimo.kernel.Jsr77Naming;
 import org.apache.geronimo.naming.reference.DeserializingReference;
 import org.apache.geronimo.xbeans.j2ee.JavaWsdlMappingDocument;
 import org.apache.geronimo.xbeans.j2ee.JavaWsdlMappingType;
@@ -100,6 +101,7 @@
     private boolean runExternalWSTest;
 
     protected void setUp() throws Exception {
+        super.setUp();
         tmpbasedir = File.createTempFile("car", "tmp");
         tmpbasedir.delete();
         tmpbasedir.mkdirs();
@@ -107,7 +109,7 @@
         Map nameKeys = new HashMap();
         nameKeys.put("domain", "geronimo");
         environment.setProperties(nameKeys);
-        context = new DeploymentContext(tmpbasedir, environment, ConfigurationModuleType.CAR, null);
+        context = new DeploymentContext(tmpbasedir, environment, ConfigurationModuleType.CAR, new Jsr77Naming());
 
         File moduleLocation = new File(tmpbasedir, "ejb");
         moduleLocation.mkdirs();
@@ -118,6 +120,7 @@
 
     protected void tearDown() throws Exception {
         recursiveDelete(tmpbasedir);
+        super.tearDown();
     }
 
     public void testServiceProxy() throws Exception {

Modified: geronimo/branches/1.1/modules/client-builder/src/java/org/apache/geronimo/client/builder/AppClientModuleBuilder.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/client-builder/src/java/org/apache/geronimo/client/builder/AppClientModuleBuilder.java?rev=386276&r1=386275&r2=386276&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/client-builder/src/java/org/apache/geronimo/client/builder/AppClientModuleBuilder.java (original)
+++ geronimo/branches/1.1/modules/client-builder/src/java/org/apache/geronimo/client/builder/AppClientModuleBuilder.java Wed Mar 15 22:49:33 2006
@@ -43,7 +43,6 @@
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
 import org.apache.geronimo.j2ee.management.impl.J2EEAppClientModuleImpl;
 import org.apache.geronimo.kernel.GBeanAlreadyExistsException;
-import org.apache.geronimo.kernel.Kernel;
 import org.apache.geronimo.kernel.Naming;
 import org.apache.geronimo.kernel.config.ConfigurationAlreadyExistsException;
 import org.apache.geronimo.kernel.config.ConfigurationData;
@@ -94,7 +93,6 @@
     private final Environment defaultClientEnvironment;
     private final Environment defaultServerEnvironment;
     private final AbstractNameQuery corbaGBeanObjectName;
-    private final Kernel kernel;
 
     private final AbstractNameQuery transactionContextManagerObjectName;
     private final AbstractNameQuery connectionTrackerObjectName;
@@ -112,12 +110,10 @@
             EJBReferenceBuilder ejbReferenceBuilder,
             ModuleBuilder connectorModuleBuilder,
             ResourceReferenceBuilder resourceReferenceBuilder,
-            ServiceReferenceBuilder serviceReferenceBuilder,
-            Kernel kernel) {
+            ServiceReferenceBuilder serviceReferenceBuilder) {
         this.defaultClientEnvironment = defaultClientEnvironment;
         this.defaultServerEnvironment = defaultServerEnvironment;
         this.corbaGBeanObjectName = corbaGBeanObjectName;
-        this.kernel = kernel;
         this.transactionContextManagerObjectName = transactionContextManagerObjectName;
         this.connectionTrackerObjectName = connectionTrackerObjectName;
         this.ejbReferenceBuilder = ejbReferenceBuilder;
@@ -126,15 +122,15 @@
         this.serviceReferenceBuilder = serviceReferenceBuilder;
     }
 
-    public Module createModule(File plan, JarFile moduleFile) throws DeploymentException {
-        return createModule(plan, moduleFile, "app-client", null, null, true, null);
+    public Module createModule(File plan, JarFile moduleFile, Naming naming) throws DeploymentException {
+        return createModule(plan, moduleFile, "app-client", null, null, true, null, naming);
     }
 
-    public Module createModule(Object plan, JarFile moduleFile, String targetPath, URL specDDUrl, Environment environment, Object moduleContextInfo, AbstractName earName) throws DeploymentException {
-        return createModule(plan, moduleFile, targetPath, specDDUrl, environment, false, earName);
+    public Module createModule(Object plan, JarFile moduleFile, String targetPath, URL specDDUrl, Environment environment, Object moduleContextInfo, AbstractName earName, Naming naming) throws DeploymentException {
+        return createModule(plan, moduleFile, targetPath, specDDUrl, environment, false, earName, naming);
     }
 
-    private Module createModule(Object plan, JarFile moduleFile, String targetPath, URL specDDUrl, Environment environment, boolean standAlone, AbstractName earName) throws DeploymentException {
+    private Module createModule(Object plan, JarFile moduleFile, String targetPath, URL specDDUrl, Environment environment, boolean standAlone, AbstractName earName, Naming naming) throws DeploymentException {
         assert moduleFile != null: "moduleFile is null";
         assert targetPath != null: "targetPath is null";
         assert !targetPath.endsWith("/"): "targetPath must not end with a '/'";
@@ -180,7 +176,7 @@
                 throw new DeploymentException("Could not construct standalone app client module name", e);
             }
         } else {
-            moduleName = Naming.createChildName(earName, NameFactory.APP_CLIENT_MODULE, targetPath);
+            moduleName = naming.createChildName(earName, targetPath, NameFactory.APP_CLIENT_MODULE);
         }
 
         return new AppClientModule(standAlone, moduleName, serverEnvironment, clientEnvironment, moduleFile, targetPath, appClient, gerAppClient, specDD);
@@ -291,7 +287,9 @@
             EARContext appClientDeploymentContext = new EARContext(appClientDir,
                     clientEnvironment,
                     ConfigurationModuleType.CAR,
-                    kernel,
+                    earContext.getNaming(),
+                    repository,
+                    configurationStore,
                     null, //no server name needed on client
                     clientBaseName,
                     transactionContextManagerObjectName,
@@ -299,7 +297,7 @@
                     null,
                     null,
                     corbaGBeanObjectName,
-                    RefContext.derivedClientRefContext(earContext.getRefContext(), ejbReferenceBuilder, resourceReferenceBuilder, serviceReferenceBuilder));
+                    new RefContext(ejbReferenceBuilder, resourceReferenceBuilder, serviceReferenceBuilder));
             appClientModule.setEarContext(appClientDeploymentContext);
         } catch (DeploymentException e) {
             DeploymentUtil.recursiveDelete(appClientDir);
@@ -418,7 +416,7 @@
                                 }
                             }
                             XmlObject connectorPlan = resource.getConnector();
-                            Module connectorModule = connectorModuleBuilder.createModule(connectorPlan, connectorFile, path, null, null, null, appClientDeploymentContext.getModuleName());
+                            Module connectorModule = connectorModuleBuilder.createModule(connectorPlan, connectorFile, path, null, null, null, appClientDeploymentContext.getModuleName(), earContext.getNaming());
                             resourceModules.add(connectorModule);
                             //TODO configStore == null is fishy, consider moving these stages for connectors into the corresponding stages for this module.
                             connectorModuleBuilder.installModule(connectorFile, appClientDeploymentContext, connectorModule, null, repository);
@@ -443,7 +441,7 @@
                 }
 
                 // add the app client static jndi provider
-                AbstractName jndiContextName = Naming.createChildName(appClientDeploymentContext.getModuleName(), "StaticJndiContext", "StaticJndiContext");
+                AbstractName jndiContextName = earContext.getNaming().createChildName(appClientDeploymentContext.getModuleName(), "StaticJndiContext", "StaticJndiContext");
                 GBeanData jndiContextGBeanData = new GBeanData(jndiContextName, StaticJndiContextPlugin.GBEAN_INFO);
                 try {
                     componentContext = buildComponentContext(appClientDeploymentContext, earContext, appClientModule, appClient, geronimoAppClient, appClientClassLoader);
@@ -456,7 +454,7 @@
                 appClientDeploymentContext.addGBean(jndiContextGBeanData);
 
                 // finally add the app client container
-                AbstractName appClientContainerName = Naming.createChildName(appClientDeploymentContext.getModuleName(), "ClientContainer", "ClientContainer");
+                AbstractName appClientContainerName = earContext.getNaming().createChildName(appClientDeploymentContext.getModuleName(), "ClientContainer", "ClientContainer");
                 GBeanData appClientContainerGBeanData = new GBeanData(appClientContainerName, AppClientContainer.GBEAN_INFO);
                 try {
                     appClientContainerGBeanData.setAttribute("mainClassName", mainClasss);
@@ -617,8 +615,6 @@
         infoBuilder.addReference("ResourceReferenceBuilder", ResourceReferenceBuilder.class, NameFactory.MODULE_BUILDER);
         infoBuilder.addReference("ServiceReferenceBuilder", ServiceReferenceBuilder.class, NameFactory.MODULE_BUILDER);
 
-        infoBuilder.addAttribute("kernel", Kernel.class, false);
-
         infoBuilder.addInterface(ModuleBuilder.class);
 
         infoBuilder.setConstructor(new String[]{"defaultClientEnvironment",
@@ -629,8 +625,8 @@
                 "EJBReferenceBuilder",
                 "ConnectorModuleBuilder",
                 "ResourceReferenceBuilder",
-                "ServiceReferenceBuilder",
-                "kernel"});
+                "ServiceReferenceBuilder"});
+
         GBEAN_INFO = infoBuilder.getBeanInfo();
     }
 

Modified: geronimo/branches/1.1/modules/client-builder/src/test/org/apache/geronimo/client/builder/PlanParsingTest.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/client-builder/src/test/org/apache/geronimo/client/builder/PlanParsingTest.java?rev=386276&r1=386275&r2=386276&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/client-builder/src/test/org/apache/geronimo/client/builder/PlanParsingTest.java (original)
+++ geronimo/branches/1.1/modules/client-builder/src/test/org/apache/geronimo/client/builder/PlanParsingTest.java Wed Mar 15 22:49:33 2006
@@ -19,7 +19,7 @@
     File basedir = new File(System.getProperty("basedir", "."));
 
     protected void setUp() throws Exception {
-        builder = new AppClientModuleBuilder(new Environment(), null, null, null, null, null, null, null, null, null);
+        builder = new AppClientModuleBuilder(new Environment(), null, null, null, null, null, null, null, null);
     }
 
     public void testResourceRef() throws Exception {

Modified: geronimo/branches/1.1/modules/connector-builder/src/java/org/apache/geronimo/connector/deployment/ConnectorModuleBuilder.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/connector-builder/src/java/org/apache/geronimo/connector/deployment/ConnectorModuleBuilder.java?rev=386276&r1=386275&r2=386276&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/connector-builder/src/java/org/apache/geronimo/connector/deployment/ConnectorModuleBuilder.java (original)
+++ geronimo/branches/1.1/modules/connector-builder/src/java/org/apache/geronimo/connector/deployment/ConnectorModuleBuilder.java Wed Mar 15 22:49:33 2006
@@ -145,15 +145,15 @@
         this.defaultXAThreadCaching = defaultXAThreadCaching;
     }
 
-    public Module createModule(File plan, JarFile moduleFile) throws DeploymentException {
-        return createModule(plan, moduleFile, "rar", null, true, null);
+    public Module createModule(File plan, JarFile moduleFile, Naming naming) throws DeploymentException {
+        return createModule(plan, moduleFile, "rar", null, true, null, naming);
     }
 
-    public Module createModule(Object plan, JarFile moduleFile, String targetPath, URL specDDUrl, Environment environment, Object moduleContextInfo, AbstractName earName) throws DeploymentException {
-        return createModule(plan, moduleFile, targetPath, specDDUrl, false, earName);
+    public Module createModule(Object plan, JarFile moduleFile, String targetPath, URL specDDUrl, Environment environment, Object moduleContextInfo, AbstractName earName, Naming naming) throws DeploymentException {
+        return createModule(plan, moduleFile, targetPath, specDDUrl, false, earName, naming);
     }
 
-    private Module createModule(Object plan, JarFile moduleFile, String targetPath, URL specDDUrl, boolean standAlone, AbstractName earName) throws DeploymentException {
+    private Module createModule(Object plan, JarFile moduleFile, String targetPath, URL specDDUrl, boolean standAlone, AbstractName earName, Naming naming) throws DeploymentException {
         assert moduleFile != null: "moduleFile is null";
         assert targetPath != null: "targetPath is null";
         assert !targetPath.endsWith("/"): "targetPath must not end with a '/'";
@@ -238,7 +238,7 @@
                 throw new DeploymentException("Could not construct standalone connector module name", e);
             }
         } else {
-            moduleName = Naming.createChildName(earName, NameFactory.RESOURCE_ADAPTER_MODULE, targetPath);
+            moduleName = naming.createChildName(earName, targetPath, NameFactory.RESOURCE_ADAPTER_MODULE);
         }
 
         return new ConnectorModule(standAlone, moduleName, environment, moduleFile, targetPath, connector, gerConnector, specDD);
@@ -274,7 +274,7 @@
         ConnectorModule resourceModule = (ConnectorModule) module;
         AbstractName resourceAdapterModuleName = resourceModule.getModuleName();
 
-        AbstractName resourceName = Naming.createChildName(resourceAdapterModuleName, NameFactory.JCA_RESOURCE, module.getName());
+        AbstractName resourceName = earContext.getNaming().createChildName(resourceAdapterModuleName, module.getName(), NameFactory.JCA_RESOURCE);
 
         final ConnectorType connector = (ConnectorType) module.getSpecDD();
 
@@ -332,7 +332,7 @@
                 if (resourceadapter.isSetInboundResourceadapter() && resourceadapter.getInboundResourceadapter().isSetMessageadapter())
                 {
                     String resourceAdapterNameString = geronimoResourceAdapter.getResourceadapterInstance().getResourceadapterName();
-                    AbstractName resourceAdapterName = Naming.createChildName(resourceName, NameFactory.JCA_RESOURCE_ADAPTER, resourceAdapterNameString);
+                    AbstractName resourceAdapterName = earContext.getNaming().createChildName(resourceName, resourceAdapterNameString, NameFactory.JCA_RESOURCE_ADAPTER);
                     GBeanData resourceAdapterData = new GBeanData(resourceAdapterName, null);
                     try {
                         earContext.addGBean(resourceAdapterData);
@@ -348,7 +348,7 @@
                     GerConnectiondefinitionInstanceType[] connectionDefinitionInstances = connectionDefinition.getConnectiondefinitionInstanceArray();
                     for (int j = 0; j < connectionDefinitionInstances.length; j++) {
                         GerConnectiondefinitionInstanceType connectionDefinitionInstance = connectionDefinitionInstances[j];
-                        AbstractName connectionFactoryObjectName = Naming.createChildName(resourceName, NameFactory.JCA_MANAGED_CONNECTION_FACTORY, connectionDefinitionInstance.getName());
+                        AbstractName connectionFactoryObjectName = earContext.getNaming().createChildName(resourceName, connectionDefinitionInstance.getName(), NameFactory.JCA_MANAGED_CONNECTION_FACTORY);
                         GBeanData connectionFactoryData = new GBeanData(connectionFactoryObjectName, null);
                         try {
                             earContext.addGBean(connectionFactoryData);
@@ -364,7 +364,7 @@
             for (int j = 0; j < gerAdminObject.getAdminobjectInstanceArray().length; j++) {
                 GerAdminobjectInstanceType gerAdminObjectInstance = gerAdminObject.getAdminobjectInstanceArray()[j];
 
-                AbstractName adminObjectObjectName = Naming.createChildName(resourceName, NameFactory.JCA_ADMIN_OBJECT, gerAdminObjectInstance.getMessageDestinationName());
+                AbstractName adminObjectObjectName = earContext.getNaming().createChildName(resourceName, gerAdminObjectInstance.getMessageDestinationName(), NameFactory.JCA_ADMIN_OBJECT);
                 GBeanData adminObjectData = new GBeanData(adminObjectObjectName, null);
                 try {
                     earContext.addGBean(adminObjectData);
@@ -383,7 +383,7 @@
             resourceAdapterModuleName = earContext.getModuleName();
         } else {
             AbstractName applicationName = earContext.getModuleName();
-            resourceAdapterModuleName = Naming.createChildName(applicationName, NameFactory.RESOURCE_ADAPTER_MODULE, module.getName());
+            resourceAdapterModuleName = earContext.getNaming().createChildName(applicationName, module.getName(), NameFactory.RESOURCE_ADAPTER_MODULE);
         }
         /*
         The chain of idiotic jsr-77 meaningless objects is:
@@ -395,7 +395,7 @@
         We also include:
         JCAResourceAdapter (n)  (from JCAResource) (actual instance of ResourceAdapter)
         */
-        AbstractName resourceAdapterjsr77Name = Naming.createChildName(resourceAdapterModuleName, NameFactory.RESOURCE_ADAPTER, module.getName());
+        AbstractName resourceAdapterjsr77Name = earContext.getNaming().createChildName(resourceAdapterModuleName, module.getName(), NameFactory.RESOURCE_ADAPTER);
 
         XmlObject specDD = module.getSpecDD();
 
@@ -419,7 +419,7 @@
 
         //construct the bogus resource adapter and jca resource placeholders
         GBeanData resourceAdapterData = new GBeanData(resourceAdapterjsr77Name, ResourceAdapterImplGBean.GBEAN_INFO);
-        AbstractName jcaResourcejsr77Name = Naming.createChildName(resourceAdapterjsr77Name, NameFactory.JCA_RESOURCE, module.getName());
+        AbstractName jcaResourcejsr77Name = earContext.getNaming().createChildName(resourceAdapterjsr77Name, module.getName(), NameFactory.JCA_RESOURCE);
         resourceAdapterData.setReferencePattern("JCAResource", jcaResourcejsr77Name);
         try {
             earContext.addGBean(resourceAdapterData);
@@ -468,7 +468,7 @@
                 resourceAdapterInstanceGBeanData.setReferencePattern("WorkManager", workManagerName);
 
                 String resourceAdapterName = geronimoResourceAdapter.getResourceadapterInstance().getResourceadapterName();
-                resourceAdapterAbstractName = Naming.createChildName(jcaResourceName, NameFactory.JCA_RESOURCE_ADAPTER, resourceAdapterName);
+                resourceAdapterAbstractName = earContext.getNaming().createChildName(jcaResourceName, resourceAdapterName, NameFactory.JCA_RESOURCE_ADAPTER);
                 resourceAdapterInstanceGBeanData.setAbstractName(resourceAdapterAbstractName);
                 try {
                     earContext.addGBean(resourceAdapterInstanceGBeanData);
@@ -524,7 +524,7 @@
                 GerAdminobjectInstanceType gerAdminObjectInstance = gerAdminObject.getAdminobjectInstanceArray()[j];
                 setDynamicGBeanDataAttributes(adminObjectInstanceGBeanData, gerAdminObjectInstance.getConfigPropertySettingArray(), cl);
                 // add it
-                AbstractName adminObjectAbstractName = Naming.createChildName(jcaResourceName, NameFactory.JCA_ADMIN_OBJECT, gerAdminObjectInstance.getMessageDestinationName().trim());
+                AbstractName adminObjectAbstractName = earContext.getNaming().createChildName(jcaResourceName, gerAdminObjectInstance.getMessageDestinationName().trim(), NameFactory.JCA_ADMIN_OBJECT);
                 adminObjectInstanceGBeanData.setAbstractName(adminObjectAbstractName);
                 try {
                     earContext.addGBean(adminObjectInstanceGBeanData);
@@ -698,7 +698,7 @@
 //        }
 
         // create the object name for our connection manager
-        AbstractName connectionManagerAbstractName = Naming.createChildName(jcaResourceName, NameFactory.JCA_CONNECTION_MANAGER, connectionfactoryInstance.getName().trim());
+        AbstractName connectionManagerAbstractName = earContext.getNaming().createChildName(jcaResourceName, connectionfactoryInstance.getName().trim(), NameFactory.JCA_CONNECTION_MANAGER);
 
         // create the data holder for our connection manager
         GBeanInfo gbeanInfo;
@@ -803,7 +803,7 @@
             throw new DeploymentException(e);
         }
 
-        AbstractName managedConnectionFactoryAbstractName = Naming.createChildName(jcaResourceName, NameFactory.JCA_MANAGED_CONNECTION_FACTORY, connectiondefinitionInstance.getName().trim());
+        AbstractName managedConnectionFactoryAbstractName = earContext.getNaming().createChildName(jcaResourceName, connectiondefinitionInstance.getName().trim(), NameFactory.JCA_MANAGED_CONNECTION_FACTORY);
         managedConnectionFactoryInstanceGBeanData.setAbstractName(managedConnectionFactoryAbstractName);
         try {
             earContext.addGBean(managedConnectionFactoryInstanceGBeanData);
@@ -812,7 +812,7 @@
         }
 
         // ConnectionFactory
-        AbstractName connectionFactoryAbstractName = Naming.createChildName(jcaResourceName, NameFactory.JCA_CONNECTION_FACTORY, connectiondefinitionInstance.getName().trim());
+        AbstractName connectionFactoryAbstractName = earContext.getNaming().createChildName(jcaResourceName, connectiondefinitionInstance.getName().trim(), NameFactory.JCA_CONNECTION_FACTORY);
         GBeanData connectionFactoryGBeanData = new GBeanData(connectionFactoryAbstractName, JCAConnectionFactoryImplGBean.GBEAN_INFO);
         connectionFactoryGBeanData.setReferencePattern("JCAManagedConnectionFactory", managedConnectionFactoryAbstractName);
 
@@ -906,8 +906,7 @@
         GBEAN_INFO = infoBuilder.getBeanInfo();
     }
 
-    public static GBeanInfo getGBeanInfo
-            () {
+    public static GBeanInfo getGBeanInfo() {
         return GBEAN_INFO;
     }
 }

Modified: geronimo/branches/1.1/modules/connector-builder/src/test/org/apache/geronimo/connector/deployment/ConnectorModuleBuilderTest.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/connector-builder/src/test/org/apache/geronimo/connector/deployment/ConnectorModuleBuilderTest.java?rev=386276&r1=386275&r2=386276&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/connector-builder/src/test/org/apache/geronimo/connector/deployment/ConnectorModuleBuilderTest.java (original)
+++ geronimo/branches/1.1/modules/connector-builder/src/test/org/apache/geronimo/connector/deployment/ConnectorModuleBuilderTest.java Wed Mar 15 22:49:33 2006
@@ -43,7 +43,7 @@
 import org.apache.geronimo.kernel.config.Configuration;
 import org.apache.geronimo.kernel.config.ConfigurationData;
 import org.apache.geronimo.kernel.config.ConfigurationManager;
-import org.apache.geronimo.kernel.config.ConfigurationManagerImpl;
+import org.apache.geronimo.kernel.config.KernelConfigurationManager;
 import org.apache.geronimo.kernel.config.ConfigurationStore;
 import org.apache.geronimo.kernel.config.InvalidConfigException;
 import org.apache.geronimo.kernel.config.NoSuchConfigException;
@@ -179,13 +179,13 @@
             kernel.loadGBean(store, this.getClass().getClassLoader());
             kernel.startGBean(store.getName());
 
-            GBeanData configurationManagerData = new GBeanData(configurationManagerName, ConfigurationManagerImpl.GBEAN_INFO);
+            GBeanData configurationManagerData = new GBeanData(configurationManagerName, KernelConfigurationManager.GBEAN_INFO);
             configurationManagerData.setReferencePatterns("Stores", Collections.singleton(store.getName()));
             kernel.loadGBean(configurationManagerData, getClass().getClassLoader());
             kernel.startGBean(configurationManagerName);
 
             rarFile = DeploymentUtil.createJarFile(new File(basedir, "target/test-ear-noger.ear"));
-            EARConfigBuilder configBuilder = new EARConfigBuilder(defaultEnvironment, null, connectionTrackerName, null, null, null, null, null, ejbReferenceBuilder, null, new ConnectorModuleBuilder(defaultEnvironment, defaultMaxSize, defaultMinSize, defaultBlockingTimeoutMilliseconds, defaultidleTimeoutMinutes, defaultXATransactionCaching, defaultXAThreadCaching, kernel), resourceReferenceBuilder, null, serviceReferenceBuilder, kernel);
+            EARConfigBuilder configBuilder = new EARConfigBuilder(defaultEnvironment, null, connectionTrackerName, null, null, null, null, null, ejbReferenceBuilder, null, new ConnectorModuleBuilder(defaultEnvironment, defaultMaxSize, defaultMinSize, defaultBlockingTimeoutMilliseconds, defaultidleTimeoutMinutes, defaultXATransactionCaching, defaultXAThreadCaching), resourceReferenceBuilder, null, serviceReferenceBuilder);
             ConfigurationData configData = null;
             try {
                 File planFile = new File(basedir, "src/test-data/data/external-application-plan.xml");
@@ -323,12 +323,12 @@
             kernel.loadGBean(store, this.getClass().getClassLoader());
             kernel.startGBean(store.getName());
 
-            GBeanData configurationManagerData = new GBeanData(configurationManagerName, ConfigurationManagerImpl.GBEAN_INFO);
+            GBeanData configurationManagerData = new GBeanData(configurationManagerName, KernelConfigurationManager.GBEAN_INFO);
             configurationManagerData.setReferencePatterns("Stores", Collections.singleton(store.getName()));
             kernel.loadGBean(configurationManagerData, getClass().getClassLoader());
             kernel.startGBean(configurationManagerName);
 
-            ConnectorModuleBuilder moduleBuilder = new ConnectorModuleBuilder(defaultEnvironment, defaultMaxSize, defaultMinSize, defaultBlockingTimeoutMilliseconds, defaultidleTimeoutMinutes, defaultXATransactionCaching, defaultXAThreadCaching, kernel);
+            ConnectorModuleBuilder moduleBuilder = new ConnectorModuleBuilder(defaultEnvironment, defaultMaxSize, defaultMinSize, defaultBlockingTimeoutMilliseconds, defaultidleTimeoutMinutes, defaultXATransactionCaching, defaultXAThreadCaching);
             File rarFile = action.getRARFile();
 
             ClassLoader oldCl = Thread.currentThread().getContextClassLoader();
@@ -337,7 +337,7 @@
             Thread.currentThread().setContextClassLoader(cl);
 
             JarFile rarJarFile = DeploymentUtil.createJarFile(rarFile);
-            Module module = moduleBuilder.createModule(action.getVendorDD(), rarJarFile, j2eeContext.getJ2eeModuleName(), action.getSpecDD(), null, null, earName);
+            Module module = moduleBuilder.createModule(action.getVendorDD(), rarJarFile, j2eeContext.getJ2eeModuleName(), action.getSpecDD(), null, null, earName, naming);
             if (module == null) {
                 throw new DeploymentException("Was not a connector module");
             }
@@ -349,15 +349,14 @@
                 EARContext earContext = new EARContext(tempDir,
                         module.getEnvironment(),
                         module.getType(),
-                        kernel,
-                        serverName, j2eeContext.getJ2eeApplicationName(),
+                        serverName,
+                        j2eeContext.getJ2eeApplicationName(),
                         null,
                         connectionTrackerName,
                         null,
                         null,
-                        null, new RefContext(ejbReferenceBuilder,
-                        moduleBuilder,
-                        serviceReferenceBuilder));
+                        null,
+                        new RefContext(ejbReferenceBuilder, moduleBuilder, serviceReferenceBuilder));
 
                 action.install(moduleBuilder, earContext, module, configurationStore);
                 earContext.getClassLoader();
@@ -395,7 +394,7 @@
             kernel.loadGBean(artifactResolver, this.getClass().getClassLoader());
             kernel.startGBean(artifactResolver.getName());
 
-            GBeanData configurationManagerData = new GBeanData(configurationManagerName, ConfigurationManagerImpl.GBEAN_INFO);
+            GBeanData configurationManagerData = new GBeanData(configurationManagerName, KernelConfigurationManager.GBEAN_INFO);
             configurationManagerData.setReferencePattern("Stores", store.getName());
             configurationManagerData.setReferencePattern("ArtifactManager", artifactManager.getName());
             configurationManagerData.setReferencePattern("ArtifactResolver", artifactResolver.getName());

Modified: geronimo/branches/1.1/modules/deploy-tool/src/java/org/apache/geronimo/deployment/PluginBootstrap.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/deploy-tool/src/java/org/apache/geronimo/deployment/PluginBootstrap.java?rev=386276&r1=386275&r2=386276&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/deploy-tool/src/java/org/apache/geronimo/deployment/PluginBootstrap.java (original)
+++ geronimo/branches/1.1/modules/deploy-tool/src/java/org/apache/geronimo/deployment/PluginBootstrap.java Wed Mar 15 22:49:33 2006
@@ -30,11 +30,12 @@
 import org.apache.geronimo.kernel.config.ConfigurationData;
 import org.apache.geronimo.kernel.config.ConfigurationStore;
 import org.apache.geronimo.kernel.repository.Artifact;
+import org.apache.geronimo.kernel.Jsr77Naming;
 import org.apache.geronimo.system.configuration.ExecutableConfigurationUtil;
 import org.apache.geronimo.system.repository.Maven1Repository;
 
 /**
- * @version $Rev$ $Date$
+ * @version $Rev: 383067 $ $Date$
  */
 public class PluginBootstrap {
     private File localRepo;
@@ -66,7 +67,7 @@
         ConfigurationType config = ConfigurationDocument.Factory.parse(plan).getConfiguration();
 
         Maven1Repository repository = new Maven1Repository(localRepo);
-        ServiceConfigBuilder builder = new ServiceConfigBuilder(null, repository);
+        ServiceConfigBuilder builder = new ServiceConfigBuilder(null, repository, new Jsr77Naming());
         ConfigurationData configurationData = builder.buildConfiguration(config, null, new ConfigurationStore() {
             public void install(ConfigurationData configurationData) {
             }

Modified: geronimo/branches/1.1/modules/deployment/src/java/org/apache/geronimo/deployment/DeploymentContext.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/deployment/src/java/org/apache/geronimo/deployment/DeploymentContext.java?rev=386276&r1=386275&r2=386276&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/deployment/src/java/org/apache/geronimo/deployment/DeploymentContext.java (original)
+++ geronimo/branches/1.1/modules/deployment/src/java/org/apache/geronimo/deployment/DeploymentContext.java Wed Mar 15 22:49:33 2006
@@ -24,17 +24,19 @@
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.OutputStream;
-import java.net.MalformedURLException;
 import java.net.URI;
 import java.net.URISyntaxException;
 import java.net.URL;
 import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
 import java.util.HashSet;
+import java.util.Iterator;
 import java.util.LinkedHashSet;
 import java.util.List;
+import java.util.Map;
 import java.util.Set;
 import java.util.StringTokenizer;
-import java.util.Map;
 import java.util.jar.Attributes;
 import java.util.jar.JarFile;
 import java.util.jar.Manifest;
@@ -46,25 +48,31 @@
 import org.apache.geronimo.gbean.AbstractName;
 import org.apache.geronimo.gbean.AbstractNameQuery;
 import org.apache.geronimo.gbean.GBeanData;
-import org.apache.geronimo.kernel.GBeanNotFoundException;
-import org.apache.geronimo.kernel.Kernel;
+import org.apache.geronimo.gbean.GBeanInfo;
 import org.apache.geronimo.kernel.GBeanAlreadyExistsException;
+import org.apache.geronimo.kernel.GBeanNotFoundException;
+import org.apache.geronimo.kernel.Naming;
 import org.apache.geronimo.kernel.config.Configuration;
 import org.apache.geronimo.kernel.config.ConfigurationData;
 import org.apache.geronimo.kernel.config.ConfigurationManager;
 import org.apache.geronimo.kernel.config.ConfigurationModuleType;
 import org.apache.geronimo.kernel.config.ConfigurationStore;
-import org.apache.geronimo.kernel.config.ConfigurationUtil;
 import org.apache.geronimo.kernel.config.NoSuchConfigException;
+import org.apache.geronimo.kernel.config.SimpleConfigurationManager;
 import org.apache.geronimo.kernel.repository.Artifact;
+import org.apache.geronimo.kernel.repository.ArtifactManager;
+import org.apache.geronimo.kernel.repository.ArtifactResolver;
+import org.apache.geronimo.kernel.repository.DefaultArtifactManager;
+import org.apache.geronimo.kernel.repository.DefaultArtifactResolver;
 import org.apache.geronimo.kernel.repository.Environment;
+import org.apache.geronimo.kernel.repository.Repository;
+import org.apache.geronimo.kernel.repository.WritableListableRepository;
+import org.apache.geronimo.system.configuration.RepositoryConfigurationStore;
 
 /**
  * @version $Rev:385232 $ $Date$
  */
 public class DeploymentContext {
-    private static int deploymentCount = 42;
-
     private final File baseDir;
     private final URI baseUri;
     private final byte[] buffer = new byte[4096];
@@ -72,35 +80,50 @@
     private final ConfigurationManager configurationManager;
     private final Configuration configuration;
     private final Environment environment;
+    private final Naming naming;
 
-    public DeploymentContext(File baseDir, Environment environment, ConfigurationModuleType moduleType, Kernel kernel) throws DeploymentException {
+    public DeploymentContext(File baseDir, Environment environment, ConfigurationModuleType moduleType, Naming naming) throws DeploymentException {
         this(baseDir,
                 environment,
                 moduleType,
-                ConfigurationUtil.getConfigurationManager(kernel));
+                naming,
+                Collections.EMPTY_SET);
     }
 
-    public DeploymentContext(File baseDir, Environment environment, ConfigurationModuleType moduleType, ConfigurationManager configurationManager) throws DeploymentException {
-        this(createTempConfiguration(environment, moduleType, baseDir, configurationManager),
-                baseDir,
+    public DeploymentContext(File baseDir, Environment environment, ConfigurationModuleType moduleType, Naming naming, Repository repository) throws DeploymentException {
+        this(baseDir,
                 environment,
                 moduleType,
-                configurationManager);
+                naming,
+                repository == null ? Collections.EMPTY_SET : Collections.singleton(repository));
     }
 
-    public DeploymentContext(Configuration configuration, File baseDir) throws DeploymentException {
-        this(configuration,
-                baseDir,
-                configuration.getEnvironment(),
-                configuration.getModuleType(),
-                null);
+    public DeploymentContext(File baseDir, Environment environment, ConfigurationModuleType moduleType, Naming naming, Collection repositories) throws DeploymentException {
+        this(baseDir,
+                environment,
+                moduleType,
+                naming,
+                repositories,
+                createRepositoryConfigurationStore(repositories));
     }
 
-    private DeploymentContext(Configuration configuration, File baseDir, Environment environment, ConfigurationModuleType moduleType, ConfigurationManager configurationManager) throws DeploymentException {
+    private static Collection createRepositoryConfigurationStore(Collection repositories) {
+        List stores = new ArrayList(repositories.size());
+        for (Iterator iterator = repositories.iterator(); iterator.hasNext();) {
+            Repository repository = (Repository) iterator.next();
+            if (repository instanceof WritableListableRepository) {
+                WritableListableRepository writableListableRepository = (WritableListableRepository) repository;
+                ConfigurationStore store = new RepositoryConfigurationStore(writableListableRepository);
+                stores.add(store);
+            }
+        }
+        return stores;
+    }
+
+    public DeploymentContext(File baseDir, Environment environment, ConfigurationModuleType moduleType, Naming naming, Collection repositories, Collection stores) throws DeploymentException {
         if (baseDir == null) throw new NullPointerException("baseDir is null");
         if (environment == null) throw new NullPointerException("environment is null");
         if (moduleType == null) throw new NullPointerException("type is null");
-        if (configuration == null) throw new NullPointerException("configuration is null");
 
         if (!baseDir.exists()) {
             baseDir.mkdirs();
@@ -112,29 +135,20 @@
         this.baseUri = baseDir.toURI();
 
         this.environment = environment;
-        this.configurationManager = configurationManager;
-        this.configuration = configuration;
-    }
+        this.naming = naming;
 
-    private static Configuration createTempConfiguration(Environment environment, ConfigurationModuleType moduleType, File baseDir, ConfigurationManager configurationManager) throws DeploymentException {
-        // create a new environment object for use in our temporary configuration
-        // NOTE: the configuration class will resolve all dependencies and set them
-        // back into this environment object, so don't use this environment for the
-        // final configuration data
-        Environment deploymentEnvironment = new Environment(environment);
-
-        // use a modified configuration id for the configuration object in case this
-        // configuation is already running in the server
-        Artifact id = environment.getConfigId();
-        synchronized (DeploymentContext.class) {
-            id = new Artifact("geronimo-deployment", id.getArtifactId(), "" + deploymentCount++, id.getType());
-        }
-        deploymentEnvironment.setConfigId(id);
+        ArtifactManager artifactManager = new DefaultArtifactManager();
+        ArtifactResolver artifactResolver = new DefaultArtifactResolver(artifactManager, repositories);
+        this.configurationManager = new SimpleConfigurationManager(stores, artifactResolver, naming, repositories);
+        this.configuration = createTempConfiguration(environment, moduleType, baseDir, configurationManager, naming);
+    }
 
-        // Add a new temporary configuration to hold our data
-        ConfigurationData configurationData = new ConfigurationData(moduleType, null, null, null, deploymentEnvironment, baseDir);
+    private static Configuration createTempConfiguration(Environment environment, ConfigurationModuleType moduleType, File baseDir, ConfigurationManager configurationManager, Naming naming) throws DeploymentException {
         try {
-            return configurationManager.loadConfiguration(configurationData, new DeploymentContextConfigurationStore(baseDir));
+            // NOTE: the configuration class will resolve all dependencies and set them
+            // back into the environment object, so don't use this environment for the
+            // final configuration data
+            return configurationManager.loadConfiguration(new ConfigurationData(moduleType, null, null, null, new Environment(environment), baseDir, naming));
         } catch (Exception e) {
             throw new DeploymentException("Unable to create configuration for deployment", e);
         }
@@ -148,9 +162,21 @@
         return baseDir;
     }
 
+    public Naming getNaming() {
+        return naming;
+    }
+
+    public GBeanData addGBean(String name, GBeanInfo gbeanInfo) throws GBeanAlreadyExistsException {
+        if (name == null) throw new NullPointerException("name is null");
+        if (gbeanInfo == null) throw new NullPointerException("gbean is null");
+        GBeanData gbean = new GBeanData(gbeanInfo);
+        configuration.addGBean(name, gbean);
+        return gbean;
+    }
+
     public void addGBean(GBeanData gbean) throws GBeanAlreadyExistsException {
         if (gbean == null) throw new NullPointerException("gbean is null");
-        if (gbean.getName() == null) throw new NullPointerException("gbean.getName() is null");
+        if (gbean.getAbstractName() == null) throw new NullPointerException("gbean.getAbstractName() is null");
         configuration.addGBean(gbean);
     }
 
@@ -430,45 +456,8 @@
                 new ArrayList(configuration.getGBeans().values()),
                 childConfigurationDatas,
                 environment,
-                baseDir);
+                baseDir,
+                naming);
         return configurationData;
-    }
-
-    private static class DeploymentContextConfigurationStore implements ConfigurationStore {
-        private final File baseDir;
-
-        public DeploymentContextConfigurationStore(File baseDir) {
-            this.baseDir = baseDir;
-        }
-
-        public void install(ConfigurationData configurationData) {
-        }
-
-        public void uninstall(Artifact configID) {
-        }
-
-        public GBeanData loadConfiguration(Artifact configId) {
-            return null;
-        }
-
-        public boolean containsConfiguration(Artifact configID) {
-            return false;
-        }
-
-        public String getObjectName() {
-            return null;
-        }
-
-        public List listConfigurations() {
-            return null;
-        }
-
-        public File createNewConfigurationDir(Artifact configId) {
-            return null;
-        }
-
-        public URL resolve(Artifact configId, URI uri) throws MalformedURLException {
-            return new File(baseDir, uri.toString()).toURL();
-        }
     }
 }

Modified: geronimo/branches/1.1/modules/deployment/src/test/org/apache/geronimo/deployment/DeploymentContextTest.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/deployment/src/test/org/apache/geronimo/deployment/DeploymentContextTest.java?rev=386276&r1=386275&r2=386276&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/deployment/src/test/org/apache/geronimo/deployment/DeploymentContextTest.java (original)
+++ geronimo/branches/1.1/modules/deployment/src/test/org/apache/geronimo/deployment/DeploymentContextTest.java Wed Mar 15 22:49:33 2006
@@ -16,37 +16,22 @@
  */
 package org.apache.geronimo.deployment;
 
+import java.io.File;
+import java.net.URI;
+import java.net.URL;
+import java.net.URLClassLoader;
+import java.util.HashMap;
+import java.util.Map;
+import javax.sql.DataSource;
+
 import junit.framework.TestCase;
 import net.sf.cglib.core.DefaultGeneratorStrategy;
 import net.sf.cglib.proxy.Enhancer;
 import net.sf.cglib.proxy.MethodInterceptor;
 import org.apache.geronimo.kernel.config.ConfigurationModuleType;
-import org.apache.geronimo.kernel.config.EditableConfigurationManagerImpl;
-import org.apache.geronimo.kernel.config.ConfigurationUtil;
-import org.apache.geronimo.kernel.config.ConfigurationManager;
-import org.apache.geronimo.kernel.config.Configuration;
-import org.apache.geronimo.kernel.config.ConfigurationResolver;
 import org.apache.geronimo.kernel.repository.Artifact;
 import org.apache.geronimo.kernel.repository.Environment;
-import org.apache.geronimo.kernel.repository.DefaultArtifactManager;
-import org.apache.geronimo.kernel.repository.DefaultArtifactResolver;
-import org.apache.geronimo.kernel.Kernel;
-import org.apache.geronimo.kernel.KernelFactory;
-import org.apache.geronimo.kernel.management.State;
-import org.apache.geronimo.gbean.GBeanData;
-import org.apache.geronimo.gbean.GBeanInfo;
-import org.apache.geronimo.gbean.AbstractName;
-
-import javax.sql.DataSource;
-import javax.management.MalformedObjectNameException;
-import javax.management.ObjectName;
-import java.io.File;
-import java.net.URI;
-import java.net.URL;
-import java.net.URLClassLoader;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Hashtable;
+import org.apache.geronimo.kernel.Jsr77Naming;
 
 /**
  * @version $Rev: 384686 $ $Date$
@@ -66,13 +51,7 @@
             Map nameKeys = new HashMap();
             nameKeys.put("domain", "d");
             environment.setProperties(nameKeys);
-            Configuration configuration = new Configuration(null,
-                    ConfigurationModuleType.CAR,
-                    environment,
-                    null,
-                    null,
-                    new ConfigurationResolver(configId, basedir));
-            DeploymentContext context = new DeploymentContext(configuration, basedir);
+            DeploymentContext context = new DeploymentContext(basedir, environment, ConfigurationModuleType.CAR, new Jsr77Naming());
             Enhancer enhancer = new Enhancer();
             enhancer.setInterfaces(new Class[]{DataSource.class});
             enhancer.setCallbackType(MethodInterceptor.class);

Modified: geronimo/branches/1.1/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder.java?rev=386276&r1=386275&r2=386276&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder.java (original)
+++ geronimo/branches/1.1/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder.java Wed Mar 15 22:49:33 2006
@@ -35,9 +35,9 @@
 import org.apache.geronimo.j2ee.ApplicationInfo;
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
 import org.apache.geronimo.j2ee.management.impl.J2EEApplicationImpl;
-import org.apache.geronimo.kernel.Kernel;
 import org.apache.geronimo.kernel.GBeanAlreadyExistsException;
 import org.apache.geronimo.kernel.Naming;
+import org.apache.geronimo.kernel.Kernel;
 import org.apache.geronimo.kernel.config.ConfigurationData;
 import org.apache.geronimo.kernel.config.ConfigurationModuleType;
 import org.apache.geronimo.kernel.config.ConfigurationStore;
@@ -79,10 +79,9 @@
  * @version $Rev:385232 $ $Date$
  */
 public class EARConfigBuilder implements ConfigurationBuilder {
-
     private final static QName APPLICATION_QNAME = GerApplicationDocument.type.getDocumentElementName();
+    private static final String DEFAULT_GROUPID = "defaultGroupId";
 
-    private final Kernel kernel;
     private final Repository repository;
     private final ModuleBuilder ejbConfigBuilder;
     private final ModuleBuilder webConfigBuilder;
@@ -100,7 +99,7 @@
     private final AbstractNameQuery transactionalTimerObjectName;
     private final AbstractNameQuery nonTransactionalTimerObjectName;
     private final AbstractNameQuery corbaGBeanObjectName;
-    private static final String DEFAULT_GROUPID = "defaultGroupId";
+    private final Naming naming;
 
 
     public EARConfigBuilder(Environment defaultEnvironment,
@@ -118,7 +117,38 @@
             ModuleBuilder appClientConfigBuilder,
             ServiceReferenceBuilder serviceReferenceBuilder,
             Kernel kernel) {
-        this.kernel = kernel;
+        this(defaultEnvironment,
+                transactionContextManagerAbstractName,
+                connectionTrackerAbstractName,
+                transactionalTimerAbstractName,
+                nonTransactionalTimerAbstractName,
+                corbaGBeanAbstractName,
+                repository,
+                ejbConfigBuilder,
+                ejbReferenceBuilder,
+                webConfigBuilder,
+                connectorConfigBuilder,
+                resourceReferenceBuilder,
+                appClientConfigBuilder,
+                serviceReferenceBuilder,
+                kernel.getNaming());
+    }
+
+    public EARConfigBuilder(Environment defaultEnvironment,
+            AbstractNameQuery transactionContextManagerAbstractName,
+            AbstractNameQuery connectionTrackerAbstractName,
+            AbstractNameQuery transactionalTimerAbstractName,
+            AbstractNameQuery nonTransactionalTimerAbstractName,
+            AbstractNameQuery corbaGBeanAbstractName,
+            Repository repository,
+            ModuleBuilder ejbConfigBuilder,
+            EJBReferenceBuilder ejbReferenceBuilder,
+            ModuleBuilder webConfigBuilder,
+            ModuleBuilder connectorConfigBuilder,
+            ResourceReferenceBuilder resourceReferenceBuilder,
+            ModuleBuilder appClientConfigBuilder,
+            ServiceReferenceBuilder serviceReferenceBuilder,
+            Naming naming) {
         this.repository = repository;
         this.defaultEnvironment = defaultEnvironment;
 
@@ -134,6 +164,7 @@
         this.transactionalTimerObjectName = transactionalTimerAbstractName;
         this.nonTransactionalTimerObjectName = nonTransactionalTimerAbstractName;
         this.corbaGBeanObjectName = corbaGBeanAbstractName;
+        this.naming = naming;
     }
 
     public Object getDeploymentPlan(File planFile, JarFile jarFile) throws DeploymentException {
@@ -152,16 +183,16 @@
         // get the modules either the application plan or for a stand alone module from the specific deployer
         Module module = null;
         if (webConfigBuilder != null) {
-            module = webConfigBuilder.createModule(planFile, jarFile);
+            module = webConfigBuilder.createModule(planFile, jarFile, naming);
         }
         if (module == null && ejbConfigBuilder != null) {
-            module = ejbConfigBuilder.createModule(planFile, jarFile);
+            module = ejbConfigBuilder.createModule(planFile, jarFile, naming);
         }
         if (module == null && connectorConfigBuilder != null) {
-            module = connectorConfigBuilder.createModule(planFile, jarFile);
+            module = connectorConfigBuilder.createModule(planFile, jarFile, naming);
         }
         if (module == null && appClientConfigBuilder != null) {
-            module = appClientConfigBuilder.createModule(planFile, jarFile);
+            module = appClientConfigBuilder.createModule(planFile, jarFile, naming);
         }
         if (module == null) {
             return null;
@@ -229,7 +260,7 @@
         Environment environment = EnvironmentBuilder.buildEnvironment(environmentType, defaultEnvironment);
 
         Artifact artifact = environment.getConfigId();
-        AbstractName earName = Naming.createRootName(artifact, artifact.toString(), NameFactory.J2EE_APPLICATION);
+        AbstractName earName = naming.createRootName(artifact, artifact.toString(), NameFactory.J2EE_APPLICATION);
 
         // get the modules either the application plan or for a stand alone module from the specific deployer
         // todo change module so you can extract the real module path back out.. then we can eliminate
@@ -316,7 +347,9 @@
             earContext = new EARContext(configurationDir,
                     applicationInfo.getEnvironment(),
                     applicationType,
-                    kernel,
+                    naming,
+                    repository,
+                    configurationStore,
                     serverName,
                     applicationInfo.getBaseName(),
                     transactionContextManagerObjectName,
@@ -390,7 +423,7 @@
             //add the JACC gbean if there is a principal-role mapping
             //TODO configid verify that the jaccManagerName is not needed before this.  cf. how this is handled in 1.2 branch.
             if (earContext.getSecurityConfiguration() != null) {
-                GBeanData jaccBeanData = SecurityBuilder.configureApplicationPolicyManager(earContext.getModuleName(), earContext.getContextIDToPermissionsMap(), earContext.getSecurityConfiguration());
+                GBeanData jaccBeanData = SecurityBuilder.configureApplicationPolicyManager(naming, earContext.getModuleName(), earContext.getContextIDToPermissionsMap(), earContext.getSecurityConfiguration());
                 earContext.addGBean(jaccBeanData);
                 earContext.setJaccManagerName(jaccBeanData.getAbstractName());
             }
@@ -528,7 +561,7 @@
                             altSpecDD,
                             environment,
                             moduleContextInfo,
-                            earName);
+                            earName, naming);
 
                     if (module == null) {
                         throw new DeploymentException("Module was not " + moduleTypeName + ": " + modulePath);
@@ -628,7 +661,7 @@
                         moduleName,
                         altSpecDD,
                         environment,
-                        moduleContextInfo, earName);
+                        moduleContextInfo, earName, naming);
 
                 if (module == null) {
                     throw new DeploymentException("Module was not " + moduleTypeName + ": " + moduleName);
@@ -694,8 +727,6 @@
         infoFactory.addReference("AppClientConfigBuilder", ModuleBuilder.class, NameFactory.MODULE_BUILDER);
         infoFactory.addReference("ServiceReferenceBuilder", ServiceReferenceBuilder.class, NameFactory.MODULE_BUILDER);
 
-        infoFactory.addAttribute("kernel", Kernel.class, false);
-
         infoFactory.addInterface(ConfigurationBuilder.class);
 
         infoFactory.setConstructor(new String[]{
@@ -712,8 +743,7 @@
                 "ConnectorConfigBuilder",
                 "ResourceReferenceBuilder",
                 "AppClientConfigBuilder",
-                "ServiceReferenceBuilder",
-                "kernel"
+                "ServiceReferenceBuilder"
         });
 
         GBEAN_INFO = infoFactory.getBeanInfo();

Modified: geronimo/branches/1.1/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/EARContext.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/EARContext.java?rev=386276&r1=386275&r2=386276&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/EARContext.java (original)
+++ geronimo/branches/1.1/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/EARContext.java Wed Mar 15 22:49:33 2006
@@ -16,21 +16,25 @@
  */
 package org.apache.geronimo.j2ee.deployment;
 
+import java.io.File;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Collections;
+
 import org.apache.geronimo.common.DeploymentException;
 import org.apache.geronimo.deployment.DeploymentContext;
 import org.apache.geronimo.gbean.AbstractName;
 import org.apache.geronimo.gbean.AbstractNameQuery;
-import org.apache.geronimo.kernel.Kernel;
 import org.apache.geronimo.kernel.config.ConfigurationModuleType;
+import org.apache.geronimo.kernel.config.ConfigurationStore;
 import org.apache.geronimo.kernel.repository.Environment;
+import org.apache.geronimo.kernel.repository.Repository;
+import org.apache.geronimo.kernel.Naming;
 import org.apache.geronimo.security.deployment.SecurityConfiguration;
 
-import java.io.File;
-import java.util.HashMap;
-import java.util.Map;
-
 /**
- * @version $Rev$ $Date$
+ * @version $Rev: 386000 $ $Date$
  */
 public class EARContext extends DeploymentContext {
 
@@ -50,8 +54,25 @@
     private AbstractName jaccManagerName;
     private SecurityConfiguration securityConfiguration;
 
-    public EARContext(File baseDir, Environment environment, ConfigurationModuleType moduleType, Kernel kernel, AbstractNameQuery serverName, AbstractName baseName, AbstractNameQuery transactionContextManagerObjectName, AbstractNameQuery connectionTrackerObjectName, AbstractNameQuery transactedTimerName, AbstractNameQuery nonTransactedTimerName, AbstractNameQuery corbaGBeanObjectName, RefContext refContext) throws DeploymentException {
-        super(baseDir, environment, moduleType, kernel);
+    public EARContext(File baseDir, Environment environment, ConfigurationModuleType moduleType, Naming naming, Repository repository, ConfigurationStore configurationStore, AbstractNameQuery serverName, AbstractName baseName, AbstractNameQuery transactionContextManagerObjectName, AbstractNameQuery connectionTrackerObjectName, AbstractNameQuery transactedTimerName, AbstractNameQuery nonTransactedTimerName, AbstractNameQuery corbaGBeanObjectName, RefContext refContext) throws DeploymentException {
+        this(baseDir,
+                environment,
+                moduleType,
+                naming,
+                repository == null ? Collections.EMPTY_SET : Collections.singleton(repository),
+                configurationStore == null ? Collections.EMPTY_SET : Collections.singleton(configurationStore), 
+                serverName,
+                baseName,
+                transactionContextManagerObjectName,
+                connectionTrackerObjectName,
+                transactedTimerName,
+                nonTransactedTimerName,
+                corbaGBeanObjectName,
+                refContext);
+    }
+
+    public EARContext(File baseDir, Environment environment, ConfigurationModuleType moduleType, Naming naming, Collection repositories, Collection configurationStores, AbstractNameQuery serverName, AbstractName baseName, AbstractNameQuery transactionContextManagerObjectName, AbstractNameQuery connectionTrackerObjectName, AbstractNameQuery transactedTimerName, AbstractNameQuery nonTransactedTimerName, AbstractNameQuery corbaGBeanObjectName, RefContext refContext) throws DeploymentException {
+        super(baseDir, environment, moduleType, naming, repositories, configurationStores);
         moduleName = baseName;
         this.serverName = serverName;
 

Modified: geronimo/branches/1.1/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/ModuleBuilder.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/ModuleBuilder.java?rev=386276&r1=386275&r2=386276&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/ModuleBuilder.java (original)
+++ geronimo/branches/1.1/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/ModuleBuilder.java Wed Mar 15 22:49:33 2006
@@ -20,6 +20,7 @@
 import org.apache.geronimo.kernel.config.ConfigurationStore;
 import org.apache.geronimo.kernel.repository.Environment;
 import org.apache.geronimo.kernel.repository.Repository;
+import org.apache.geronimo.kernel.Naming;
 import org.apache.geronimo.gbean.AbstractName;
 
 import java.io.File;
@@ -27,12 +28,12 @@
 import java.util.jar.JarFile;
 
 /**
- * @version $Rev$ $Date$
+ * @version $Rev: 385487 $ $Date$
  */
 public interface ModuleBuilder {
-    Module createModule(File plan, JarFile moduleFile) throws DeploymentException;
+    Module createModule(File plan, JarFile moduleFile, Naming naming) throws DeploymentException;
 
-    Module createModule(Object plan, JarFile moduleFile, String targetPath, URL specDDUrl, Environment environment, Object moduleContextInfo, AbstractName earName) throws DeploymentException;
+    Module createModule(Object plan, JarFile moduleFile, String targetPath, URL specDDUrl, Environment environment, Object moduleContextInfo, AbstractName earName, Naming naming) throws DeploymentException;
 
     void installModule(JarFile earFile, EARContext earContext, Module module, ConfigurationStore configurationStore, Repository repository) throws DeploymentException;
 

Modified: geronimo/branches/1.1/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/RefContext.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/RefContext.java?rev=386276&r1=386275&r2=386276&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/RefContext.java (original)
+++ geronimo/branches/1.1/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/RefContext.java Wed Mar 15 22:49:33 2006
@@ -36,10 +36,9 @@
 
 
 /**
- * @version $Rev$ $Date$
+ * @version $Rev: 386000 $ $Date$
  */
 public class RefContext {
-
     private final EJBReferenceBuilder ejbReferenceBuilder;
     private final ResourceReferenceBuilder resourceReferenceBuilder;
     private final ServiceReferenceBuilder serviceReferenceBuilder;
@@ -56,29 +55,12 @@
         this.serviceReferenceBuilder = serviceReferenceBuilder;
     }
 
-    public static RefContext derivedClientRefContext(RefContext refContext, EJBReferenceBuilder ejbReferenceBuilder, ResourceReferenceBuilder resourceReferenceBuilder, ServiceReferenceBuilder serviceReferenceBuilder) {
-        return new RefContext(refContext, ejbReferenceBuilder, resourceReferenceBuilder, serviceReferenceBuilder);
-    }
-
-    private RefContext(RefContext refContext, EJBReferenceBuilder ejbReferenceBuilder, ResourceReferenceBuilder resourceReferenceBuilder, ServiceReferenceBuilder serviceReferenceBuilder) {
-        assert ejbReferenceBuilder != null: "ejbReferenceBuilder is null";
-        assert resourceReferenceBuilder != null: "resourceReferenceBuilder is null";
-        assert refContext != null: "ejbRefContext is null";
-
-        this.ejbReferenceBuilder = ejbReferenceBuilder;
-        this.resourceReferenceBuilder = resourceReferenceBuilder;
-        this.serviceReferenceBuilder = serviceReferenceBuilder;
-    }
-
     //registration methods
-
     public void registerMessageDestionations(String moduleName, Map nameMap) throws DeploymentException {
         messageDestinations.put(moduleName, nameMap);
     }
 
-
     //lookup methods
-
     public Reference getCORBARemoteRef(Configuration configuration, AbstractNameQuery cssNameQuery, URI nsCorbaloc, String objectName, String home) throws DeploymentException {
         return ejbReferenceBuilder.createCORBAReference(configuration, cssNameQuery, nsCorbaloc, objectName, home);
     }
@@ -151,5 +133,4 @@
             throw new DeploymentException("Could not locate a MEJB in the configuration ancestors");
         }
     }
-
 }

Modified: geronimo/branches/1.1/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/SwitchingModuleBuilder.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/SwitchingModuleBuilder.java?rev=386276&r1=386275&r2=386276&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/SwitchingModuleBuilder.java (original)
+++ geronimo/branches/1.1/modules/j2ee-builder/src/java/org/apache/geronimo/j2ee/deployment/SwitchingModuleBuilder.java Wed Mar 15 22:49:33 2006
@@ -28,6 +28,7 @@
 import org.apache.geronimo.kernel.config.ConfigurationStore;
 import org.apache.geronimo.kernel.repository.Environment;
 import org.apache.geronimo.kernel.repository.Repository;
+import org.apache.geronimo.kernel.Naming;
 import org.apache.xmlbeans.XmlCursor;
 import org.apache.xmlbeans.XmlException;
 import org.apache.xmlbeans.XmlObject;
@@ -42,18 +43,17 @@
 import java.util.jar.JarFile;
 
 /**
- * @version $Rev$ $Date$
+ * @version $Rev: 385487 $ $Date$
  */
 public class SwitchingModuleBuilder implements ModuleBuilder {
 
-    private final ReferenceCollection builders;
     private final Map namespaceToBuilderMap = new HashMap();
 
     private String defaultNamespace;
 
     public SwitchingModuleBuilder(Collection builders) {
-        this.builders = (ReferenceCollection) builders;
-        this.builders.addReferenceCollectionListener(new ReferenceCollectionListener() {
+        ReferenceCollection buildersCollection = (ReferenceCollection) builders;
+        buildersCollection.addReferenceCollectionListener(new ReferenceCollectionListener() {
             public void memberAdded(ReferenceCollectionEvent event) {
                 ModuleBuilder builder = (ModuleBuilder) event.getMember();
                 String namespace = builder.getSchemaNamespace();
@@ -82,7 +82,7 @@
         this.defaultNamespace = defaultNamespace;
     }
 
-    public Module createModule(File plan, JarFile moduleFile) throws DeploymentException {
+    public Module createModule(File plan, JarFile moduleFile, Naming naming) throws DeploymentException {
         String namespace;
         if (plan == null) {
             namespace = defaultNamespace;
@@ -91,7 +91,7 @@
         }
         ModuleBuilder builder = getBuilderFromNamespace(namespace);
         if (builder != null) {
-            return builder.createModule(plan, moduleFile);
+            return builder.createModule(plan, moduleFile, naming);
         } else {
             return null;
         }
@@ -135,11 +135,11 @@
         return builder;
     }
 
-    public Module createModule(Object plan, JarFile moduleFile, String targetPath, URL specDDUrl, Environment environment, Object moduleContextInfo, AbstractName earName) throws DeploymentException {
+    public Module createModule(Object plan, JarFile moduleFile, String targetPath, URL specDDUrl, Environment environment, Object moduleContextInfo, AbstractName earName, Naming naming) throws DeploymentException {
         String namespace = getNamespaceFromPlan(plan);
         ModuleBuilder builder = getBuilderFromNamespace(namespace);
         if (builder != null) {
-            return builder.createModule(plan, moduleFile, targetPath, specDDUrl, environment, moduleContextInfo, earName);
+            return builder.createModule(plan, moduleFile, targetPath, specDDUrl, environment, moduleContextInfo, earName, naming);
         } else {
             return null;
         }

Modified: geronimo/branches/1.1/modules/j2ee-builder/src/test/org/apache/geronimo/j2ee/deployment/EARConfigBuilderTest.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/j2ee-builder/src/test/org/apache/geronimo/j2ee/deployment/EARConfigBuilderTest.java?rev=386276&r1=386275&r2=386276&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/j2ee-builder/src/test/org/apache/geronimo/j2ee/deployment/EARConfigBuilderTest.java (original)
+++ geronimo/branches/1.1/modules/j2ee-builder/src/test/org/apache/geronimo/j2ee/deployment/EARConfigBuilderTest.java Wed Mar 15 22:49:33 2006
@@ -17,10 +17,8 @@
 
 package org.apache.geronimo.j2ee.deployment;
 
-import java.io.ByteArrayOutputStream;
 import java.io.File;
 import java.io.IOException;
-import java.io.ObjectOutputStream;
 import java.net.MalformedURLException;
 import java.net.URI;
 import java.net.URL;
@@ -38,25 +36,20 @@
 import org.apache.geronimo.deployment.DeploymentContext;
 import org.apache.geronimo.deployment.util.DeploymentUtil;
 import org.apache.geronimo.gbean.AbstractName;
-import org.apache.geronimo.gbean.GBeanData;
-import org.apache.geronimo.gbean.GBeanInfo;
-import org.apache.geronimo.gbean.GBeanInfoBuilder;
 import org.apache.geronimo.gbean.AbstractNameQuery;
+import org.apache.geronimo.gbean.GBeanData;
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
 import org.apache.geronimo.kernel.config.Configuration;
 import org.apache.geronimo.kernel.config.ConfigurationData;
+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.ConfigurationManagerImpl;
-import org.apache.geronimo.kernel.config.ConfigurationModuleType;
-import org.apache.geronimo.kernel.config.ConfigurationUtil;
 import org.apache.geronimo.kernel.repository.Artifact;
 import org.apache.geronimo.kernel.repository.Environment;
 import org.apache.geronimo.kernel.repository.ImportType;
 import org.apache.geronimo.kernel.Naming;
-import org.apache.geronimo.kernel.Kernel;
-import org.apache.geronimo.kernel.KernelFactory;
+import org.apache.geronimo.kernel.Jsr77Naming;
 
 /**
  * @version $Rev: 385487 $ $Date$
@@ -80,16 +73,17 @@
         }
     };
 
-    private static final AbstractName rootConfig = Naming.createRootName(new Artifact("test", "stuff", "", "car"), "test", "test") ;
-    private static final AbstractName transactionManagerObjectName = Naming.createChildName(rootConfig, "TransactionManager", "TransactionManager");
-    private static final AbstractName connectionTrackerObjectName = Naming.createChildName(rootConfig, "ConnectionTracker", "ConnectionTracker");
-    private static final AbstractName transactionalTimerObjectName = Naming.createChildName(rootConfig, "ThreadPooledTimer", "TransactionalThreaPooledTimer");
-    private static final AbstractName nonTransactionalTimerObjectName = Naming.createChildName(rootConfig, "ThreadPooledTimer", "NonTransactionalThreaPooledTimer");
-
-    private static final AbstractName earName = Naming.createRootName(new Artifact("test", "test-ear", "", "ear"), "test", NameFactory.J2EE_APPLICATION) ;
-    private static final AbstractName ejbModuleName = Naming.createChildName(earName, NameFactory.EJB_MODULE, "ejb-jar");
-    private static final AbstractName webModuleName = Naming.createChildName(earName, NameFactory.WEB_MODULE, "war");
-    private static final AbstractName raModuleName = Naming.createChildName(earName, NameFactory.RESOURCE_ADAPTER_MODULE, "rar");
+    private static final Naming naming = new Jsr77Naming();
+    private static final AbstractName rootConfig = naming.createRootName(new Artifact("test", "stuff", "", "car"), "test", "test") ;
+    private static final AbstractName transactionManagerObjectName = naming.createChildName(rootConfig, "TransactionManager", "TransactionManager");
+    private static final AbstractName connectionTrackerObjectName = naming.createChildName(rootConfig, "ConnectionTracker", "ConnectionTracker");
+    private static final AbstractName transactionalTimerObjectName = naming.createChildName(rootConfig, "TransactionalThreaPooledTimer", "ThreadPooledTimer");
+    private static final AbstractName nonTransactionalTimerObjectName = naming.createChildName(rootConfig, "NonTransactionalThreaPooledTimer", "ThreadPooledTimer");
+
+    private static final AbstractName earName = naming.createRootName(new Artifact("test", "test-ear", "", "ear"), "test", NameFactory.J2EE_APPLICATION) ;
+    private static final AbstractName ejbModuleName = naming.createChildName(earName, "ejb-jar", NameFactory.EJB_MODULE);
+    private static final AbstractName webModuleName = naming.createChildName(earName, "war", NameFactory.WEB_MODULE);
+    private static final AbstractName raModuleName = naming.createChildName(earName, "rar", NameFactory.RESOURCE_ADAPTER_MODULE);
 
     private Environment defaultParentId;
     private static String contextRoot = "test";
@@ -246,21 +240,8 @@
     }
 
     public void testBuildConfiguration() throws Exception {
-        Kernel kernel = KernelFactory.newInstance().createKernel("foo");
-        kernel.boot();
-
         ConfigurationData configurationData = null;
         try {
-            ConfigurationData testConfig = new ConfigurationData(new Artifact("test", "test", "", "car"));
-            GBeanData storeData = new GBeanData(testConfig.getId(), "ConfigStore", MockConfigStore.GBEAN_INFO);
-            testConfig.addGBean(storeData);
-
-            GBeanData configurationManagerData = new GBeanData(testConfig.getId(), "ConfigurationManager", ConfigurationManagerImpl.GBEAN_INFO);
-            configurationManagerData.setReferencePattern("Stores", new AbstractNameQuery(storeData.getAbstractName()));
-            testConfig.addGBean(configurationManagerData);
-
-            ConfigurationUtil.loadBootstrapConfiguration(kernel, testConfig, getClass().getClassLoader());
-
             EARConfigBuilder configBuilder = new EARConfigBuilder(defaultParentId,
                     new AbstractNameQuery(transactionManagerObjectName),
                     new AbstractNameQuery(connectionTrackerObjectName),
@@ -275,7 +256,7 @@
                     resourceReferenceBuilder,
                     appClientConfigBuilder,
                     serviceReferenceBuilder,
-                    kernel);
+                    naming);
 
             Object plan = configBuilder.getDeploymentPlan(null, earFile);
             configurationData = configBuilder.buildConfiguration(plan, earFile, configStore);
@@ -283,7 +264,6 @@
             if (configurationData != null) {
                 DeploymentUtil.recursiveDelete(configurationData.getConfigurationDir());
             }
-            kernel.shutdown();
         }
     }
 
@@ -302,7 +282,7 @@
                 resourceReferenceBuilder,
                 appClientConfigBuilder,
                 serviceReferenceBuilder,
-                null);
+                naming);
 
         ConfigurationData configurationData = null;
         try {
@@ -335,7 +315,7 @@
                 resourceReferenceBuilder,
                 appClientConfigBuilder,
                 serviceReferenceBuilder,
-                null);
+                naming);
 
         ConfigurationData configurationData = null;
         try {
@@ -368,7 +348,7 @@
                 resourceReferenceBuilder,
                 appClientConfigBuilder,
                 serviceReferenceBuilder,
-                null);
+                naming);
 
         ConfigurationData configurationData = null;
         try {
@@ -401,7 +381,7 @@
                 resourceReferenceBuilder,
                 appClientConfigBuilder,
                 serviceReferenceBuilder,
-                null);
+                naming);
 
         ConfigurationData configurationData = null;
         try {
@@ -434,7 +414,7 @@
                 resourceReferenceBuilder,
                 appClientConfigBuilder,
                 serviceReferenceBuilder,
-                null);
+                naming);
 
 
         ConfigurationData configurationData = null;
@@ -466,7 +446,7 @@
                 resourceReferenceBuilder,
                 appClientConfigBuilder,
                 serviceReferenceBuilder,
-                null);
+                naming);
 
         ConfigurationData configurationData = null;
         try {
@@ -497,7 +477,7 @@
                 resourceReferenceBuilder,
                 appClientConfigBuilder,
                 serviceReferenceBuilder,
-                null);
+                naming);
 
         ConfigurationData configurationData = null;
         try {
@@ -534,7 +514,6 @@
             environment.setConfigId(configId);
             environment.getProperties().put(NameFactory.JSR77_BASE_NAME_PROPERTY, "geronimo.test:J2EEServer=geronimo");
             configData.setAttribute("environment", environment);
-            configData.setAttribute("gBeanState", NO_OBJECTS_OS);
             configData.setAttribute("moduleType", ConfigurationModuleType.CAR);
 
             return configData;
@@ -569,25 +548,5 @@
             }
             return new URL(file.toURL(), uri.toString());
         }
-
-        public final static GBeanInfo GBEAN_INFO;
-
-        private static final byte[] NO_OBJECTS_OS;
-
-        static {
-            GBeanInfoBuilder infoBuilder = GBeanInfoBuilder.createStatic(MockConfigStore.class, NameFactory.CONFIGURATION_STORE);
-            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);
-            }
-        }
     }
-
 }



Mime
View raw message