geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject svn commit: r386276 [4/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
Modified: geronimo/branches/1.1/modules/security-builder/src/java/org/apache/geronimo/security/deployment/LoginConfigBuilder.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/security-builder/src/java/org/apache/geronimo/security/deployment/LoginConfigBuilder.java?rev=386276&r1=386275&r2=386276&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/security-builder/src/java/org/apache/geronimo/security/deployment/LoginConfigBuilder.java
(original)
+++ geronimo/branches/1.1/modules/security-builder/src/java/org/apache/geronimo/security/deployment/LoginConfigBuilder.java
Wed Mar 15 22:49:33 2006
@@ -39,6 +39,7 @@
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
 import org.apache.geronimo.kernel.GBeanAlreadyExistsException;
 import org.apache.geronimo.kernel.Naming;
+import org.apache.geronimo.kernel.Kernel;
 import org.apache.geronimo.security.jaas.JaasLoginModuleUse;
 import org.apache.geronimo.security.jaas.LoginModuleGBean;
 import org.apache.geronimo.xbeans.geronimo.loginconfig.GerAbstractLoginModuleType;
@@ -57,6 +58,16 @@
 public class LoginConfigBuilder implements XmlReferenceBuilder {
     public static final String LOGIN_CONFIG_NAMESPACE = "http://geronimo.apache.org/xml/ns/loginconfig-1.0";
 
+    private final Naming naming;
+
+    public LoginConfigBuilder(Kernel kernel) {
+        this.naming = kernel.getNaming();
+    }
+
+    public LoginConfigBuilder(Naming naming) {
+        this.naming = naming;
+    }
+
     public String getNamespace() {
         return LOGIN_CONFIG_NAMESPACE;
     }
@@ -128,7 +139,7 @@
                         String value = trim(gerOptionType.getStringValue());
                         options.setProperty(key, value);
                     }
-                    loginModuleName = Naming.createChildName(parentName, NameFactory.LOGIN_MODULE,
name);
+                    loginModuleName = naming.createChildName(parentName, name, NameFactory.LOGIN_MODULE);
                     loginModuleReferencePatterns = new ReferencePatterns(loginModuleName);
                     GBeanData loginModuleGBeanData = new GBeanData(loginModuleName, LoginModuleGBean.GBEAN_INFO);
                     loginModuleGBeanData.setAttribute("loginDomainName", name);
@@ -142,7 +153,7 @@
                     throw new DeploymentException("Unknown abstract login module type: "
+ abstractLoginModule.getClass());
                 }
                 AbstractName thisName;
-                thisName = Naming.createChildName(parentName, "LoginModuleUse", name);
+                thisName = naming.createChildName(parentName, name, "LoginModuleUse");
                 GBeanData loginModuleUseGBeanData = new GBeanData(thisName, JaasLoginModuleUse.GBEAN_INFO);
                 loginModuleUseGBeanData.setAttribute("controlFlag", controlFlag);
                 loginModuleUseGBeanData.setReferencePatterns("LoginModule", loginModuleReferencePatterns);
@@ -174,6 +185,8 @@
 
     static {
         GBeanInfoBuilder infoBuilder = GBeanInfoBuilder.createStatic(LoginConfigBuilder.class,
"XmlReferenceBuilder");
+        infoBuilder.addAttribute("kernel", Kernel.class, false, false);
+        infoBuilder.setConstructor(new String[] {"kernel"});
         infoBuilder.addInterface(XmlReferenceBuilder.class);
         GBEAN_INFO = infoBuilder.getBeanInfo();
 

Modified: geronimo/branches/1.1/modules/security-builder/src/java/org/apache/geronimo/security/deployment/SecurityBuilder.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/security-builder/src/java/org/apache/geronimo/security/deployment/SecurityBuilder.java?rev=386276&r1=386275&r2=386276&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/security-builder/src/java/org/apache/geronimo/security/deployment/SecurityBuilder.java
(original)
+++ geronimo/branches/1.1/modules/security-builder/src/java/org/apache/geronimo/security/deployment/SecurityBuilder.java
Wed Mar 15 22:49:33 2006
@@ -227,8 +227,8 @@
         return new PrincipalInfo(principalType.getClass1(), principalType.getName(), principalType.isSetDesignatedRunAs());
     }
 
-    public static GBeanData configureApplicationPolicyManager(AbstractName moduleName, Map
contextIDToPermissionsMap, SecurityConfiguration securityConfiguration) {
-        AbstractName jaccBeanName = Naming.createChildName(moduleName, NameFactory.JACC_MANAGER,
NameFactory.JACC_MANAGER);
+    public static GBeanData configureApplicationPolicyManager(Naming naming, AbstractName
moduleName, Map contextIDToPermissionsMap, SecurityConfiguration securityConfiguration) {
+        AbstractName jaccBeanName = naming.createChildName(moduleName, NameFactory.JACC_MANAGER,
NameFactory.JACC_MANAGER);
         GBeanData jaccBeanData = new GBeanData(jaccBeanName, ApplicationPolicyConfigurationManager.GBEAN_INFO);
         jaccBeanData.setAttribute("contextIdToPermissionsMap", contextIDToPermissionsMap);
         jaccBeanData.setAttribute("principalRoleMap", securityConfiguration.getPrincipalRoleMap());

Modified: geronimo/branches/1.1/modules/service-builder/src/java/org/apache/geronimo/deployment/service/ServiceConfigBuilder.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/service-builder/src/java/org/apache/geronimo/deployment/service/ServiceConfigBuilder.java?rev=386276&r1=386275&r2=386276&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/service-builder/src/java/org/apache/geronimo/deployment/service/ServiceConfigBuilder.java
(original)
+++ geronimo/branches/1.1/modules/service-builder/src/java/org/apache/geronimo/deployment/service/ServiceConfigBuilder.java
Wed Mar 15 22:49:33 2006
@@ -36,9 +36,9 @@
 import org.apache.geronimo.gbean.ReferenceMap;
 import org.apache.geronimo.gbean.AbstractName;
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
-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;
@@ -58,6 +58,7 @@
 import java.util.Collection;
 import java.util.HashMap;
 import java.util.Map;
+import java.util.Collections;
 import java.util.jar.JarFile;
 
 /**
@@ -66,7 +67,6 @@
 public class ServiceConfigBuilder implements ConfigurationBuilder {
     private final Environment defaultEnvironment;
     private final Repository repository;
-    private final Kernel kernel;
 
     //TODO this being static is a really good argument that all other builders should have
a reference to this gbean, not use static methods on it.
     private static final Map xmlAttributeBuilderMap = new HashMap();
@@ -74,19 +74,24 @@
     private Map attrRefMap;
     private Map refRefMap;
     private static final QName SERVICE_QNAME = ConfigurationDocument.type.getDocumentElementName();
+    private final Naming naming;
 
 
-    public ServiceConfigBuilder(Environment defaultEnvironment, Repository repository) {
-        this(defaultEnvironment, repository, null, null, null);
+    public ServiceConfigBuilder(Environment defaultEnvironment, Repository repository, Naming
naming) {
+        this(defaultEnvironment, repository, null, null, naming);
     }
 
     public ServiceConfigBuilder(Environment defaultEnvironment, Repository repository, Collection
xmlAttributeBuilders, Collection xmlReferenceBuilders, Kernel kernel) {
+        this(defaultEnvironment, repository, xmlAttributeBuilders, xmlReferenceBuilders,
kernel.getNaming());
+    }
+
+    public ServiceConfigBuilder(Environment defaultEnvironment, Repository repository, Collection
xmlAttributeBuilders, Collection xmlReferenceBuilders, Naming naming) {
+        this.naming = naming;
         EnvironmentBuilder environmentBuilder = new EnvironmentBuilder();
         xmlAttributeBuilderMap.put(environmentBuilder.getNamespace(), environmentBuilder);
         this.defaultEnvironment = defaultEnvironment;
 
         this.repository = repository;
-        this.kernel = kernel;
         if (xmlAttributeBuilders != null) {
             ReferenceMap.Key key = new ReferenceMap.Key() {
 
@@ -165,7 +170,7 @@
         } catch (ConfigurationAlreadyExistsException e) {
             throw new DeploymentException(e);
         }
-        DeploymentContext context = new DeploymentContext(outfile, environment, ConfigurationModuleType.SERVICE,
kernel);
+        DeploymentContext context = new DeploymentContext(outfile, environment, ConfigurationModuleType.SERVICE,
naming, Collections.singleton(repository), Collections.singleton(configurationStore));
         ClassLoader cl = context.getClassLoader();
 
 
@@ -191,7 +196,7 @@
         GBeanInfo gBeanInfo = GBeanInfo.getGBeanInfo(gbean.getClass1(), cl);
         String namePart = gbean.getName();
         String j2eeType = gBeanInfo.getJ2eeType();
-        AbstractName abstractName = Naming.createChildName(moduleName, j2eeType, namePart);
+        AbstractName abstractName = context.getNaming().createChildName(moduleName, namePart,
j2eeType);
         GBeanBuilder builder = new GBeanBuilder(abstractName, gBeanInfo, cl, context, moduleName,
xmlAttributeBuilderMap, xmlReferenceBuilderMap);
 
         // set up attributes
@@ -272,9 +277,9 @@
         infoFactory.addReference("Repository", Repository.class, NameFactory.GERONIMO_SERVICE);
         infoFactory.addReference("XmlAttributeBuilders", XmlAttributeBuilder.class, "XmlAttributeBuilder");
         infoFactory.addReference("XmlReferenceBuilders", XmlReferenceBuilder.class, "XmlReferenceBuilder");
-        infoFactory.addAttribute("kernel", Kernel.class, false);
+        infoFactory.addAttribute("kernel", Kernel.class, false, false);
 
-        infoFactory.setConstructor(new String[]{"defaultEnvironment", "Repository", "XmlAttributeBuilders",
"XmlReferenceBuilders", "kernel"});
+        infoFactory.setConstructor(new String[]{"defaultEnvironment", "Repository", "XmlAttributeBuilders",
"XmlReferenceBuilders"});
 
         GBEAN_INFO = infoFactory.getBeanInfo();
     }

Modified: geronimo/branches/1.1/modules/service-builder/src/test/org/apache/geronimo/deployment/service/ServiceConfigBuilderTest.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/service-builder/src/test/org/apache/geronimo/deployment/service/ServiceConfigBuilderTest.java?rev=386276&r1=386275&r2=386276&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/service-builder/src/test/org/apache/geronimo/deployment/service/ServiceConfigBuilderTest.java
(original)
+++ geronimo/branches/1.1/modules/service-builder/src/test/org/apache/geronimo/deployment/service/ServiceConfigBuilderTest.java
Wed Mar 15 22:49:33 2006
@@ -27,11 +27,10 @@
 import org.apache.geronimo.gbean.ReferenceCollection;
 import org.apache.geronimo.gbean.ReferenceCollectionListener;
 import org.apache.geronimo.kernel.config.ConfigurationModuleType;
-import org.apache.geronimo.kernel.config.Configuration;
-import org.apache.geronimo.kernel.config.ConfigurationResolver;
 import org.apache.geronimo.kernel.repository.Environment;
 import org.apache.geronimo.kernel.repository.Repository;
 import org.apache.geronimo.kernel.repository.Artifact;
+import org.apache.geronimo.kernel.Jsr77Naming;
 import org.apache.geronimo.kernel.Naming;
 
 import javax.management.ObjectName;
@@ -40,7 +39,6 @@
 import java.util.ArrayList;
 import java.util.Set;
 import java.util.LinkedHashSet;
-import java.util.Collections;
 
 /**
  * @version $Rev: 384933 $ $Date$
@@ -54,7 +52,8 @@
         JavaBeanXmlAttributeBuilder javaBeanXmlAttributeBuilder = new JavaBeanXmlAttributeBuilder();
         //this is kind of cheating, we rely on the builder to iterate through existing members
of the collection.
         referenceCollection.add(javaBeanXmlAttributeBuilder);
-        new ServiceConfigBuilder(parentEnvironment, null, referenceCollection, null, null);
+        Naming naming = new Jsr77Naming();
+        new ServiceConfigBuilder(parentEnvironment, null, referenceCollection, null, naming);
         ClassLoader cl = Thread.currentThread().getContextClassLoader();
         final URL plan1 = cl.getResource("services/plan1.xml");
         ConfigurationDocument doc = ConfigurationDocument.Factory.parse(plan1);
@@ -67,14 +66,8 @@
         try {
 
             Environment environment = EnvironmentBuilder.buildEnvironment(plan.getEnvironment());
-            Configuration configuration = new Configuration(null,
-                    ConfigurationModuleType.CAR,
-                    environment,
-                    null,
-                    null,
-                    new ConfigurationResolver(environment.getConfigId(), outFile, Collections.singleton(new
MockRepository())));
-            DeploymentContext context = new DeploymentContext(configuration, outFile);
-            AbstractName j2eeContext = Naming.createRootName(environment.getConfigId(), environment.getConfigId().toString(),
"Configuration");
+            DeploymentContext context = new DeploymentContext(outFile, environment, ConfigurationModuleType.CAR,
naming, new MockRepository());
+            AbstractName j2eeContext = naming.createRootName(environment.getConfigId(), environment.getConfigId().toString(),
"Configuration");
 
             GbeanType[] gbeans = plan.getGbeanArray();
             ServiceConfigBuilder.addGBeans(gbeans, cl, j2eeContext, context);

Modified: geronimo/branches/1.1/modules/tomcat-builder/src/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilder.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/tomcat-builder/src/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilder.java?rev=386276&r1=386275&r2=386276&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/tomcat-builder/src/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilder.java
(original)
+++ geronimo/branches/1.1/modules/tomcat-builder/src/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilder.java
Wed Mar 15 22:49:33 2006
@@ -119,7 +119,7 @@
         this.webServiceBuilder = webServiceBuilder;
     }
 
-    protected Module createModule(Object plan, JarFile moduleFile, String targetPath, URL
specDDUrl, boolean standAlone, String contextRoot, AbstractName earName) throws DeploymentException
{
+    protected Module createModule(Object plan, JarFile moduleFile, String targetPath, URL
specDDUrl, boolean standAlone, String contextRoot, 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 '/'";
@@ -192,7 +192,7 @@
                 throw new DeploymentException("Could not construct standalone web module
name", e);
             }
         } else {
-            moduleName = Naming.createChildName(earName, NameFactory.WEB_MODULE, targetPath);
+            moduleName = naming.createChildName(earName, targetPath, NameFactory.WEB_MODULE);
         }
 
         return new WebModule(standAlone, moduleName, environment, moduleFile, targetPath,
webApp, tomcatWebApp, specDD, contextRoot, portMap, TOMCAT_NAMESPACE);
@@ -334,24 +334,24 @@
             }
             if (tomcatWebApp.isSetTomcatRealm()) {
                 String tomcatRealm = tomcatWebApp.getTomcatRealm().trim();
-                AbstractName realmName = Naming.createChildName(moduleName, RealmGBean.GBEAN_INFO.getJ2eeType(),
tomcatRealm);
+                AbstractName realmName = earContext.getNaming().createChildName(moduleName,
tomcatRealm, RealmGBean.GBEAN_INFO.getJ2eeType());
                 webModuleData.setReferencePattern("TomcatRealm", realmName);
             }
             if (tomcatWebApp.isSetValveChain()) {
                 String valveChain = tomcatWebApp.getValveChain().trim();
-                AbstractName valveName = Naming.createChildName(moduleName, ValveGBean.J2EE_TYPE,
valveChain);
+                AbstractName valveName = earContext.getNaming().createChildName(moduleName,
valveChain, ValveGBean.J2EE_TYPE);
                 webModuleData.setReferencePattern("TomcatValveChain", valveName);
             }
 
             if (tomcatWebApp.isSetCluster()) {
                 String cluster = tomcatWebApp.getCluster().trim();
-                AbstractName clusterName =Naming.createChildName(moduleName, CatalinaClusterGBean.J2EE_TYPE,
cluster);
+                AbstractName clusterName =earContext.getNaming().createChildName(moduleName,
cluster, CatalinaClusterGBean.J2EE_TYPE);
                 webModuleData.setReferencePattern("Cluster", clusterName);
             }
 
             if (tomcatWebApp.isSetManager()) {
                 String manager = tomcatWebApp.getManager().trim();
-                AbstractName managerName = Naming.createChildName(moduleName, ManagerGBean.J2EE_TYPE,
manager);
+                AbstractName managerName = earContext.getNaming().createChildName(moduleName,
manager, ManagerGBean.J2EE_TYPE);
                 webModuleData.setReferencePattern("Manager", managerName);
             }
             Map portMap = webModule.getPortMap();

Modified: geronimo/branches/1.1/modules/tomcat-builder/src/test/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilderTest.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/tomcat-builder/src/test/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilderTest.java?rev=386276&r1=386275&r2=386276&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/tomcat-builder/src/test/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilderTest.java
(original)
+++ geronimo/branches/1.1/modules/tomcat-builder/src/test/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilderTest.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.ConfigurationModuleType;
 import org.apache.geronimo.kernel.config.ConfigurationStore;
 import org.apache.geronimo.kernel.config.InvalidConfigException;
@@ -170,7 +170,7 @@
         File dest = new File(basedir, "target/test-resources/deployables/" + warName + "/war");
         recursiveCopy(path, dest);
         UnpackedJarFile jarFile = new UnpackedJarFile(path);
-        Module module = builder.createModule(null, jarFile);
+        Module module = builder.createModule(null, jarFile, kernel.getNaming());
 
         ObjectName jaccBeanName = NameFactory.getComponentName(null, null, null, null, "foo",
NameFactory.JACC_MANAGER, moduleContext);
         GBeanData jaccBeanData = new GBeanData(jaccBeanName, ApplicationPolicyConfigurationManager.GBEAN_INFO);
@@ -227,7 +227,6 @@
                 outputPath,
                 environment,
                 ConfigurationModuleType.WAR,
-                kernel,
                 serverName, moduleContext.getJ2eeApplicationName(),
                 tcmName,
                 ctcName,
@@ -373,7 +372,7 @@
         kernel.startGBean(artifactResolver.getName());
 
         ObjectName configurationManagerName = new ObjectName(":j2eeType=ConfigurationManager,name=Basic");
-        GBeanData configurationManagerData = new GBeanData(configurationManagerName, ConfigurationManagerImpl.GBEAN_INFO);
+        GBeanData configurationManagerData = new GBeanData(configurationManagerName, KernelConfigurationManager.GBEAN_INFO);
         configurationManagerData.setReferencePatterns("Stores", Collections.singleton(store.getName()));
         configurationManagerData.setReferencePattern("ArtifactManager", artifactManager.getName());
         configurationManagerData.setReferencePattern("ArtifactResolver", artifactResolver.getName());

Modified: geronimo/branches/1.1/modules/tomcat/src/java/org/apache/geronimo/tomcat/TomcatManagerImpl.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/tomcat/src/java/org/apache/geronimo/tomcat/TomcatManagerImpl.java?rev=386276&r1=386275&r2=386276&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/tomcat/src/java/org/apache/geronimo/tomcat/TomcatManagerImpl.java
(original)
+++ geronimo/branches/1.1/modules/tomcat/src/java/org/apache/geronimo/tomcat/TomcatManagerImpl.java
Wed Mar 15 22:49:33 2006
@@ -26,7 +26,6 @@
 import org.apache.geronimo.gbean.ReferencePatterns;
 import org.apache.geronimo.kernel.GBeanNotFoundException;
 import org.apache.geronimo.kernel.Kernel;
-import org.apache.geronimo.kernel.Naming;
 import org.apache.geronimo.kernel.config.ConfigurationUtil;
 import org.apache.geronimo.kernel.config.EditableConfigurationManager;
 import org.apache.geronimo.kernel.config.InvalidConfigException;
@@ -70,7 +69,7 @@
      * @return The ObjectName of the new connector.
      */
     public AbstractName addConnector(AbstractName containerName, String uniqueName, String
protocol, String host, int port) {
-        AbstractName name = Naming.createChildName(containerName, NameFactory.GERONIMO_SERVICE,
"TomcatWebConnector-" + protocol + "-" + uniqueName);
+        AbstractName name = kernel.getNaming().createChildName(containerName, "TomcatWebConnector-"
+ protocol + "-" + uniqueName, NameFactory.GERONIMO_SERVICE);
         GBeanData connector;
         if(protocol.equals(PROTOCOL_HTTP)) {
             connector = new GBeanData(name, ConnectorGBean.GBEAN_INFO);

Modified: geronimo/branches/1.1/modules/web-builder/src/java/org/apache/geronimo/web/deployment/AbstractWebModuleBuilder.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/web-builder/src/java/org/apache/geronimo/web/deployment/AbstractWebModuleBuilder.java?rev=386276&r1=386275&r2=386276&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/web-builder/src/java/org/apache/geronimo/web/deployment/AbstractWebModuleBuilder.java
(original)
+++ geronimo/branches/1.1/modules/web-builder/src/java/org/apache/geronimo/web/deployment/AbstractWebModuleBuilder.java
Wed Mar 15 22:49:33 2006
@@ -25,6 +25,7 @@
 import org.apache.geronimo.j2ee.deployment.ModuleBuilder;
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
 import org.apache.geronimo.kernel.Kernel;
+import org.apache.geronimo.kernel.Naming;
 import org.apache.geronimo.kernel.config.ConfigurationAlreadyExistsException;
 import org.apache.geronimo.kernel.config.ConfigurationModuleType;
 import org.apache.geronimo.kernel.config.ConfigurationStore;
@@ -102,15 +103,15 @@
         return dependencies;
     }
 
-    public Module createModule(File plan, JarFile moduleFile) throws DeploymentException
{
-        return createModule(plan, moduleFile, "war", null, true, null, null);
+    public Module createModule(File plan, JarFile moduleFile, Naming naming) throws DeploymentException
{
+        return createModule(plan, moduleFile, "war", null, true, null, 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, (String) moduleContextInfo,
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, (String) moduleContextInfo,
earName, naming);
     }
 
-    protected abstract Module createModule(Object plan, JarFile moduleFile, String targetPath,
URL specDDUrl, boolean standAlone, String contextRoot, AbstractName earName) throws DeploymentException;
+    protected abstract Module createModule(Object plan, JarFile moduleFile, String targetPath,
URL specDDUrl, boolean standAlone, String contextRoot, AbstractName earName, Naming naming)
throws DeploymentException;
 
     /**
      * Some servlets will have multiple url patterns.  However, webservice servlets
@@ -185,7 +186,9 @@
                 moduleContext = new EARContext(configurationDir,
                         environment,
                         ConfigurationModuleType.WAR,
-                        kernel,
+                        earContext.getNaming(),
+                        repository,
+                        configurationStore,
                         earContext.getServerName(),
                         module.getModuleName(),
                         earContext.getTransactionContextManagerObjectName(),

Modified: geronimo/branches/1.1/plugins/geronimo-packaging-plugin/src/java/org/apache/geronimo/plugin/packaging/PackageBuilder.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/plugins/geronimo-packaging-plugin/src/java/org/apache/geronimo/plugin/packaging/PackageBuilder.java?rev=386276&r1=386275&r2=386276&view=diff
==============================================================================
--- geronimo/branches/1.1/plugins/geronimo-packaging-plugin/src/java/org/apache/geronimo/plugin/packaging/PackageBuilder.java
(original)
+++ geronimo/branches/1.1/plugins/geronimo-packaging-plugin/src/java/org/apache/geronimo/plugin/packaging/PackageBuilder.java
Wed Mar 15 22:49:33 2006
@@ -25,9 +25,8 @@
 import org.apache.geronimo.kernel.Kernel;
 import org.apache.geronimo.kernel.KernelFactory;
 import org.apache.geronimo.kernel.KernelRegistry;
-import org.apache.geronimo.kernel.Naming;
 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.ConfigurationUtil;
 import org.apache.geronimo.kernel.repository.Artifact;
 import org.apache.geronimo.kernel.repository.DefaultArtifactManager;
@@ -55,26 +54,6 @@
     private static Log log = LogFactory.getLog(PackageBuilder.class);
 
     private static final String KERNEL_NAME = "geronimo.maven";
-    /**
-     * The name of the GBean that will load dependencies from the Maven repository.
-     */
-    private static final AbstractName REPOSITORY_NAME;
-    private static final AbstractName ARTIFACT_MANAGER_NAME;
-    private static final AbstractName ARTIFACT_RESOLVER_NAME;
-    /**
-     * The name of the GBean that will load Configurations from the Maven repository.
-     */
-    private static final AbstractName CONFIGSTORE_NAME;
-
-    /**
-     * The name of the GBean that will manage Configurations.
-     */
-    private static final AbstractName CONFIGMANAGER_NAME;
-
-    /**
-     * The name of the GBean that will provide values for managed attributes.
-     */
-    private static final AbstractName ATTRIBUTESTORE_NAME;
 
     /**
      * Reference to the kernel that will last the lifetime of this classloader.
@@ -93,26 +72,6 @@
             String.class.getName(),
     };
 
-    static {
-        Artifact artifact = new Artifact("geronimo", "packaging", "fixed", "car");
-        Map nameMap = new HashMap();
-        nameMap.put("type", "plugin");
-        nameMap.put("name", "packaging");
-        ObjectName objectName;
-        try {
-            objectName = ObjectName.getInstance(KERNEL_NAME + "j2eeType=plugin,name=packaging");
-        } catch (MalformedObjectNameException e) {
-            throw (IllegalArgumentException)new IllegalArgumentException("Could not construct
a fixed object name").initCause(e);
-        }
-        AbstractName rootName = new AbstractName(artifact, nameMap, objectName);
-        REPOSITORY_NAME = Naming.createChildName(rootName, "Repository", "Repository");
-        ARTIFACT_MANAGER_NAME = Naming.createChildName(rootName, "ArtifactManager", "ArtifactManager");
-        ARTIFACT_RESOLVER_NAME = Naming.createChildName(rootName, "ArtifactResolver", "ArtifactResolver");
-        CONFIGSTORE_NAME = Naming.createChildName(rootName, "ConfigurationStore", "PackageBuilderConfigStore");
-        CONFIGMANAGER_NAME = Naming.createChildName(rootName, "ConfigurationManager", "ConfigurationManager");
-        ATTRIBUTESTORE_NAME = Naming.createChildName(rootName, "ManagedAttributeStore", "ManagedAttributeStore");
-    }
-
     private String repositoryClass;
     private String configurationStoreClass;
 
@@ -332,49 +291,67 @@
      * the local maven installation.
      */
     private static void bootDeployerSystem(Kernel kernel, File repository, String repoClass,
String configStoreClass) throws Exception {
+        Artifact artifact = new Artifact("geronimo", "packaging", "fixed", "car");
+        Map nameMap = new HashMap();
+        nameMap.put("type", "plugin");
+        nameMap.put("name", "packaging");
+        ObjectName objectName;
+        try {
+            objectName = ObjectName.getInstance(KERNEL_NAME + "j2eeType=plugin,name=packaging");
+        } catch (MalformedObjectNameException e) {
+            throw (IllegalArgumentException)new IllegalArgumentException("Could not construct
a fixed object name").initCause(e);
+        }
+        AbstractName rootName = new AbstractName(artifact, nameMap, objectName);
+        AbstractName repositoryName = kernel.getNaming().createChildName(rootName, "Repository",
"Repository");
+        AbstractName artifactManagerName = kernel.getNaming().createChildName(rootName, "ArtifactManager",
"ArtifactManager");
+        AbstractName artifactResolverName = kernel.getNaming().createChildName(rootName,
"ArtifactResolver", "ArtifactResolver");
+        AbstractName configStoreName = kernel.getNaming().createChildName(rootName, "PackageBuilderConfigStore",
"ConfigurationStore");
+        AbstractName configManagerName = kernel.getNaming().createChildName(rootName, "ConfigurationManager",
"ConfigurationManager");
+        AbstractName attributeStoreName = kernel.getNaming().createChildName(rootName, "ManagedAttributeStore",
"ManagedAttributeStore");
+
         ClassLoader cl = PackageBuilder.class.getClassLoader();
         GBeanInfo repoInfo = GBeanInfo.getGBeanInfo(repoClass, cl);
-        GBeanData repoGBean = new GBeanData(REPOSITORY_NAME, repoInfo);
+        GBeanData repoGBean = new GBeanData(repositoryName, repoInfo);
         URI repositoryURI = repository.toURI();
         repoGBean.setAttribute("root", repositoryURI);
         kernel.loadGBean(repoGBean, cl);
-        kernel.startGBean(REPOSITORY_NAME);
+        kernel.startGBean(repositoryName);
 
         //TODO parameterize these?
-        GBeanData artifactManagerGBean = new GBeanData(ARTIFACT_MANAGER_NAME, DefaultArtifactManager.GBEAN_INFO);
+        GBeanData artifactManagerGBean = new GBeanData(artifactManagerName, DefaultArtifactManager.GBEAN_INFO);
         kernel.loadGBean(artifactManagerGBean, cl);
-        kernel.startGBean(ARTIFACT_MANAGER_NAME);
+        kernel.startGBean(artifactManagerName);
 
-        GBeanData artifactResolverGBean = new GBeanData(ARTIFACT_RESOLVER_NAME, DefaultArtifactResolver.GBEAN_INFO);
-        artifactResolverGBean.setReferencePattern("Repositories", REPOSITORY_NAME);
-        artifactResolverGBean.setReferencePattern("ArtifactManager", ARTIFACT_MANAGER_NAME);
+        GBeanData artifactResolverGBean = new GBeanData(artifactResolverName, DefaultArtifactResolver.GBEAN_INFO);
+        artifactResolverGBean.setReferencePattern("Repositories", repositoryName);
+        artifactResolverGBean.setReferencePattern("ArtifactManager", artifactManagerName);
         kernel.loadGBean(artifactResolverGBean, cl);
-        kernel.startGBean(ARTIFACT_RESOLVER_NAME);
+        kernel.startGBean(artifactResolverName);
 
         GBeanInfo configStoreInfo = GBeanInfo.getGBeanInfo(configStoreClass, cl);
-        GBeanData storeGBean = new GBeanData(CONFIGSTORE_NAME, configStoreInfo);
+        GBeanData storeGBean = new GBeanData(configStoreName, configStoreInfo);
         Set refs = configStoreInfo.getReferences();
         for (Iterator iterator = refs.iterator(); iterator.hasNext();) {
             GReferenceInfo refInfo = (GReferenceInfo) iterator.next();
             if ("Repository".equals(refInfo.getName())) {
-                storeGBean.setReferencePattern("Repository", REPOSITORY_NAME);
+                storeGBean.setReferencePattern("Repository", repositoryName);
                 break;
             }
         }
         kernel.loadGBean(storeGBean, cl);
-        kernel.startGBean(CONFIGSTORE_NAME);
+        kernel.startGBean(configStoreName);
 
-        GBeanData configManagerGBean = new GBeanData(CONFIGMANAGER_NAME, ConfigurationManagerImpl.GBEAN_INFO);
-        configManagerGBean.setReferencePattern("Stores", CONFIGSTORE_NAME);
-        configManagerGBean.setReferencePattern("AttributeStore", ATTRIBUTESTORE_NAME);
-        configManagerGBean.setReferencePattern("ArtifactManager", ARTIFACT_MANAGER_NAME);
-        configManagerGBean.setReferencePattern("ArtifactResolver", ARTIFACT_RESOLVER_NAME);
+        GBeanData configManagerGBean = new GBeanData(configManagerName, KernelConfigurationManager.GBEAN_INFO);
+        configManagerGBean.setReferencePattern("Stores", configStoreName);
+        configManagerGBean.setReferencePattern("AttributeStore", attributeStoreName);
+        configManagerGBean.setReferencePattern("ArtifactManager", artifactManagerName);
+        configManagerGBean.setReferencePattern("ArtifactResolver", artifactResolverName);
         kernel.loadGBean(configManagerGBean, cl);
-        kernel.startGBean(CONFIGMANAGER_NAME);
+        kernel.startGBean(configManagerName);
 
-        GBeanData attrManagerGBean = new GBeanData(ATTRIBUTESTORE_NAME, MavenAttributeStore.GBEAN_INFO);
+        GBeanData attrManagerGBean = new GBeanData(attributeStoreName, MavenAttributeStore.GBEAN_INFO);
         kernel.loadGBean(attrManagerGBean, cl);
-        kernel.startGBean(ATTRIBUTESTORE_NAME);
+        kernel.startGBean(attributeStoreName);
     }
 
     /**



Mime
View raw message