geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject svn commit: r385659 [1/2] - in /geronimo/branches/1.1: modules/client-builder/src/java/org/apache/geronimo/client/builder/ modules/connector-builder/src/java/org/apache/geronimo/connector/deployment/ modules/j2ee-builder/src/java/org/apache/geronimo/j2...
Date Mon, 13 Mar 2006 21:07:32 GMT
Author: dain
Date: Mon Mar 13 13:07:27 2006
New Revision: 385659

URL: http://svn.apache.org/viewcvs?rev=385659&view=rev
Log:
Added Naming class to kernel to abstract name construction rules.
Updated kernel tests to use new Naming class

Added:
    geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/Naming.java
Removed:
    geronimo/branches/1.1/modules/j2ee/src/test/org/apache/geronimo/j2ee/j2eeobjectnames/NameFactoryTest.java
    geronimo/branches/1.1/modules/kernel/src/test/org/apache/geronimo/gbean/jmx/
Modified:
    geronimo/branches/1.1/modules/client-builder/src/java/org/apache/geronimo/client/builder/AppClientModuleBuilder.java
    geronimo/branches/1.1/modules/connector-builder/src/java/org/apache/geronimo/connector/deployment/ConnectorModuleBuilder.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/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/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/src/java/org/apache/geronimo/jetty/JettyManagerImpl.java
    geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/basic/BasicProxyManager.java
    geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/config/ConfigurationManager.java
    geronimo/branches/1.1/modules/kernel/src/test/org/apache/geronimo/gbean/GBeanInfoTest.java
    geronimo/branches/1.1/modules/kernel/src/test/org/apache/geronimo/gbean/GBeanNameTest.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/BootstrapTest.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/basic/BasicProxyMapTest.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/config/MultiParentClassLoaderTest.java
    geronimo/branches/1.1/modules/kernel/src/test/org/apache/geronimo/kernel/config/MyGBean.java
    geronimo/branches/1.1/modules/kernel/src/test/org/apache/geronimo/kernel/management/StateTest.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/system/src/java/org/apache/geronimo/system/main/Daemon.java
    geronimo/branches/1.1/modules/tomcat-builder/src/java/org/apache/geronimo/tomcat/deployment/TomcatModuleBuilder.java
    geronimo/branches/1.1/modules/tomcat/src/java/org/apache/geronimo/tomcat/TomcatManagerImpl.java
    geronimo/branches/1.1/plugins/geronimo-packaging-plugin/src/java/org/apache/geronimo/plugin/packaging/PackageBuilder.java

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=385659&r1=385658&r2=385659&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 Mon Mar 13 13:07:27 2006
@@ -45,6 +45,7 @@
 import org.apache.geronimo.j2ee.management.impl.J2EEAppClientModuleImpl;
 import org.apache.geronimo.kernel.Kernel;
 import org.apache.geronimo.kernel.GBeanAlreadyExistsException;
+import org.apache.geronimo.kernel.Naming;
 import org.apache.geronimo.kernel.config.ConfigurationAlreadyExistsException;
 import org.apache.geronimo.kernel.config.ConfigurationData;
 import org.apache.geronimo.kernel.config.ConfigurationModuleType;
@@ -180,7 +181,7 @@
                 throw new DeploymentException("Could not construct standalone app client module name", e);
             }
         } else {
-            moduleName = NameFactory.getChildName(earName, NameFactory.APP_CLIENT_MODULE, targetPath, null);
+            moduleName = Naming.createChildName(earName, NameFactory.APP_CLIENT_MODULE, targetPath);
         }
 
         return new AppClientModule(standAlone, moduleName, serverEnvironment, clientEnvironment, moduleFile, targetPath, appClient, gerAppClient, specDD);
@@ -443,7 +444,7 @@
                 }
 
                 // add the app client static jndi provider
-                AbstractName jndiContextName = NameFactory.getChildName(appClientDeploymentContext.getModuleName(), "StaticJndiContext", "StaticJndiContext", null);
+                AbstractName jndiContextName = Naming.createChildName(appClientDeploymentContext.getModuleName(), "StaticJndiContext", "StaticJndiContext");
                 GBeanData jndiContextGBeanData = new GBeanData(jndiContextName, StaticJndiContextPlugin.GBEAN_INFO);
                 try {
                     componentContext = buildComponentContext(appClientDeploymentContext, earContext, appClientModule, appClient, geronimoAppClient, appClientClassLoader);
@@ -456,7 +457,7 @@
                 appClientDeploymentContext.addGBean(jndiContextGBeanData);
 
                 // finally add the app client container
-                AbstractName appClientContainerName = NameFactory.getChildName(appClientDeploymentContext.getModuleName(), "ClientContainer", "ClientContainer", null);
+                AbstractName appClientContainerName = Naming.createChildName(appClientDeploymentContext.getModuleName(), "ClientContainer", "ClientContainer");
                 GBeanData appClientContainerGBeanData = new GBeanData(appClientContainerName, AppClientContainer.GBEAN_INFO);
                 try {
                     appClientContainerGBeanData.setAttribute("mainClassName", mainClasss);

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=385659&r1=385658&r2=385659&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 Mon Mar 13 13:07:27 2006
@@ -59,6 +59,7 @@
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
 import org.apache.geronimo.kernel.GBeanNotFoundException;
 import org.apache.geronimo.kernel.GBeanAlreadyExistsException;
+import org.apache.geronimo.kernel.Naming;
 import org.apache.geronimo.kernel.config.ConfigurationStore;
 import org.apache.geronimo.kernel.config.Configuration;
 import org.apache.geronimo.kernel.config.ConfigurationModuleType;
@@ -112,7 +113,7 @@
 import java.util.zip.ZipEntry;
 
 /**
- * @version $Rev$ $Date$
+ * @version $Rev: 385372 $ $Date$
  */
 public class ConnectorModuleBuilder implements ModuleBuilder, ResourceReferenceBuilder {
 
@@ -236,7 +237,7 @@
                 throw new DeploymentException("Could not construct standalone connector module name", e);
             }
         } else {
-            moduleName = NameFactory.getChildName(earName, NameFactory.RESOURCE_ADAPTER_MODULE, targetPath, null);
+            moduleName = Naming.createChildName(earName, NameFactory.RESOURCE_ADAPTER_MODULE, targetPath);
         }
 
         return new ConnectorModule(standAlone, moduleName, environment, moduleFile, targetPath, connector, gerConnector, specDD);
@@ -272,7 +273,7 @@
         ConnectorModule resourceModule = (ConnectorModule) module;
         AbstractName resourceAdapterModuleName = resourceModule.getModuleName();
 
-        AbstractName resourceName = NameFactory.getChildName(resourceAdapterModuleName, NameFactory.JCA_RESOURCE, module.getName(), null);
+        AbstractName resourceName = Naming.createChildName(resourceAdapterModuleName, NameFactory.JCA_RESOURCE, module.getName());
 
         final ConnectorType connector = (ConnectorType) module.getSpecDD();
 
@@ -331,7 +332,7 @@
                 if (resourceadapter.isSetInboundResourceadapter() && resourceadapter.getInboundResourceadapter().isSetMessageadapter())
                 {
                     String resourceAdapterNameString = geronimoResourceAdapter.getResourceadapterInstance().getResourceadapterName();
-                    AbstractName resourceAdapterName = NameFactory.getChildName(resourceName, NameFactory.JCA_RESOURCE_ADAPTER, resourceAdapterNameString, null);
+                    AbstractName resourceAdapterName = Naming.createChildName(resourceName, NameFactory.JCA_RESOURCE_ADAPTER, resourceAdapterNameString);
                     GBeanData resourceAdapterData = new GBeanData(resourceAdapterName, null);
                     try {
                         earContext.addGBean(resourceAdapterData);
@@ -347,7 +348,7 @@
                     GerConnectiondefinitionInstanceType[] connectionDefinitionInstances = connectionDefinition.getConnectiondefinitionInstanceArray();
                     for (int j = 0; j < connectionDefinitionInstances.length; j++) {
                         GerConnectiondefinitionInstanceType connectionDefinitionInstance = connectionDefinitionInstances[j];
-                        AbstractName connectionFactoryObjectName = NameFactory.getChildName(resourceName, NameFactory.JCA_MANAGED_CONNECTION_FACTORY, connectionDefinitionInstance.getName(), null);
+                        AbstractName connectionFactoryObjectName = Naming.createChildName(resourceName, NameFactory.JCA_MANAGED_CONNECTION_FACTORY, connectionDefinitionInstance.getName());
                         GBeanData connectionFactoryData = new GBeanData(connectionFactoryObjectName, null);
                         try {
                             earContext.addGBean(connectionFactoryData);
@@ -363,7 +364,7 @@
             for (int j = 0; j < gerAdminObject.getAdminobjectInstanceArray().length; j++) {
                 GerAdminobjectInstanceType gerAdminObjectInstance = gerAdminObject.getAdminobjectInstanceArray()[j];
 
-                AbstractName adminObjectObjectName = NameFactory.getChildName(resourceName, NameFactory.JCA_ADMIN_OBJECT, gerAdminObjectInstance.getMessageDestinationName(), null);
+                AbstractName adminObjectObjectName = Naming.createChildName(resourceName, NameFactory.JCA_ADMIN_OBJECT, gerAdminObjectInstance.getMessageDestinationName());
                 GBeanData adminObjectData = new GBeanData(adminObjectObjectName, null);
                 try {
                     earContext.addGBean(adminObjectData);
@@ -382,9 +383,9 @@
             resourceAdapterModuleName = earContext.getModuleName();
         } else {
             AbstractName applicationName = earContext.getModuleName();
-            resourceAdapterModuleName = NameFactory.getChildName(applicationName, NameFactory.RESOURCE_ADAPTER_MODULE, module.getName(), null);
+            resourceAdapterModuleName = Naming.createChildName(applicationName, NameFactory.RESOURCE_ADAPTER_MODULE, module.getName());
         }
-        AbstractName resourceAdapterjsr77Name = NameFactory.getChildName(resourceAdapterModuleName, NameFactory.RESOURCE_ADAPTER, module.getName(), null);
+        AbstractName resourceAdapterjsr77Name = Naming.createChildName(resourceAdapterModuleName, NameFactory.RESOURCE_ADAPTER, module.getName());
 
         XmlObject specDD = module.getSpecDD();
 
@@ -408,7 +409,7 @@
 
         //construct the bogus resource adapter and jca resource placeholders
         GBeanData resourceAdapterData = new GBeanData(resourceAdapterjsr77Name, ResourceAdapterImplGBean.GBEAN_INFO);
-        AbstractName jcaResourcejsr77Name = NameFactory.getChildName(resourceAdapterjsr77Name, NameFactory.JCA_RESOURCE, module.getName(),  null);
+        AbstractName jcaResourcejsr77Name = Naming.createChildName(resourceAdapterjsr77Name, NameFactory.JCA_RESOURCE, module.getName());
         resourceAdapterData.setAttribute("JCAResource", jcaResourcejsr77Name.getObjectName().getCanonicalName());
         try {
             earContext.addGBean(resourceAdapterData);
@@ -455,7 +456,7 @@
                 resourceAdapterInstanceGBeanData.setReferencePattern("WorkManager", workManagerName);
 
                 String resourceAdapterName = geronimoResourceAdapter.getResourceadapterInstance().getResourceadapterName();
-                    resourceAdapterAbstractName = NameFactory.getChildName(jcaResourceName, NameFactory.JCA_RESOURCE_ADAPTER, resourceAdapterName, null);
+                resourceAdapterAbstractName = Naming.createChildName(jcaResourceName, NameFactory.JCA_RESOURCE_ADAPTER, resourceAdapterName);
                 resourceAdapterInstanceGBeanData.setAbstractName(resourceAdapterAbstractName);
                 try {
                     earContext.addGBean(resourceAdapterInstanceGBeanData);
@@ -511,7 +512,7 @@
                 GerAdminobjectInstanceType gerAdminObjectInstance = gerAdminObject.getAdminobjectInstanceArray()[j];
                 setDynamicGBeanDataAttributes(adminObjectInstanceGBeanData, gerAdminObjectInstance.getConfigPropertySettingArray(), cl);
                 // add it
-                AbstractName adminObjectAbstractName = NameFactory.getChildName(jcaResourceName, NameFactory.JCA_ADMIN_OBJECT, gerAdminObjectInstance.getMessageDestinationName().trim(), null);
+                AbstractName adminObjectAbstractName = Naming.createChildName(jcaResourceName, NameFactory.JCA_ADMIN_OBJECT, gerAdminObjectInstance.getMessageDestinationName().trim());
                 adminObjectInstanceGBeanData.setAbstractName(adminObjectAbstractName);
                 try {
                     earContext.addGBean(adminObjectInstanceGBeanData);
@@ -685,7 +686,7 @@
 //        }
 
         // create the object name for our connection manager
-        AbstractName connectionManagerAbstractName = NameFactory.getChildName(jcaResourceName, NameFactory.JCA_CONNECTION_MANAGER, connectionfactoryInstance.getName().trim(), null);
+        AbstractName connectionManagerAbstractName = Naming.createChildName(jcaResourceName, NameFactory.JCA_CONNECTION_MANAGER, connectionfactoryInstance.getName().trim());
 
         // create the data holder for our connection manager
         GBeanInfo gbeanInfo;
@@ -790,7 +791,7 @@
             throw new DeploymentException(e);
         }
 
-        AbstractName managedConnectionFactoryAbstractName = NameFactory.getChildName(jcaResourceName, NameFactory.JCA_MANAGED_CONNECTION_FACTORY, connectiondefinitionInstance.getName().trim(), null);
+        AbstractName managedConnectionFactoryAbstractName = Naming.createChildName(jcaResourceName, NameFactory.JCA_MANAGED_CONNECTION_FACTORY, connectiondefinitionInstance.getName().trim());
         managedConnectionFactoryInstanceGBeanData.setAbstractName(managedConnectionFactoryAbstractName);
         try {
             earContext.addGBean(managedConnectionFactoryInstanceGBeanData);
@@ -799,7 +800,7 @@
         }
 
         // ConnectionFactory
-        AbstractName connectionFactoryAbstractName = NameFactory.getChildName(jcaResourceName, NameFactory.JCA_CONNECTION_FACTORY, connectiondefinitionInstance.getName().trim(), null);
+        AbstractName connectionFactoryAbstractName = Naming.createChildName(jcaResourceName, NameFactory.JCA_CONNECTION_FACTORY, connectiondefinitionInstance.getName().trim());
         GBeanData connectionFactoryGBeanData = new GBeanData(connectionFactoryAbstractName, JCAConnectionFactoryImplGBean.GBEAN_INFO);
         connectionFactoryGBeanData.setReferencePattern("J2EEServer", earContext.getServerName());
         connectionFactoryGBeanData.setAttribute("managedConnectionFactory", managedConnectionFactoryAbstractName.getObjectName().getCanonicalName());

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=385659&r1=385658&r2=385659&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 Mon Mar 13 13:07:27 2006
@@ -55,8 +55,8 @@
 import org.apache.xmlbeans.XmlException;
 import org.apache.xmlbeans.XmlObject;
 
-import javax.management.MalformedObjectNameException;
 import javax.xml.namespace.QName;
+import javax.management.MalformedObjectNameException;
 import java.io.File;
 import java.io.IOException;
 import java.net.MalformedURLException;
@@ -378,12 +378,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;
-                try {
-                    jaccBeanData = SecurityBuilder.configureApplicationPolicyManager(earContext.getModuleName(), earContext.getContextIDToPermissionsMap(), earContext.getSecurityConfiguration());
-                } catch (MalformedObjectNameException e) {
-                    throw new DeploymentException("Could not construct name for JACCBean", e);
-                }
+                GBeanData jaccBeanData = SecurityBuilder.configureApplicationPolicyManager(earContext.getModuleName(), earContext.getContextIDToPermissionsMap(), earContext.getSecurityConfiguration());
                 earContext.addGBean(jaccBeanData);
                 earContext.setJaccManagerName(jaccBeanData.getAbstractName());
             }

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=385659&r1=385658&r2=385659&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 Mon Mar 13 13:07:27 2006
@@ -50,9 +50,10 @@
 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;
 
 /**
- * @version $Rev$ $Date$
+ * @version $Rev: 385487 $ $Date$
  */
 public class EARConfigBuilderTest extends TestCase {
     private static final File basedir = new File(System.getProperty("basedir", System.getProperty("user.dir")));
@@ -73,11 +74,11 @@
         }
     };
 
-    private static final AbstractName rootConfig = NameFactory.getRootName(new Artifact("test", "stuff", "", "ear"), "app", NameFactory.J2EE_APPLICATION) ;
-    private static final AbstractName transactionManagerObjectName = NameFactory.getChildName(rootConfig, "TransactionManager", "TransactionManager", null);
-    private static final AbstractName connectionTrackerObjectName = NameFactory.getChildName(rootConfig, "ConnectionTracker", "ConnectionTracker", null);
-    private static final AbstractName transactionalTimerObjectName = NameFactory.getChildName(rootConfig, "ThreadPooledTimer", "TransactionalThreaPooledTimer", null);
-    private static final AbstractName nonTransactionalTimerObjectName = NameFactory.getChildName(rootConfig, "ThreadPooledTimer", "NonTransactionalThreaPooledTimer", null);
+    private static final AbstractName rootConfig = Naming.createRootName(new Artifact("test", "stuff", "", "ear"), "app", NameFactory.J2EE_APPLICATION) ;
+    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 Environment defaultParentId;
     private static String contextRoot = "test";
     private static final Map portMap = null;

Modified: geronimo/branches/1.1/modules/j2ee-builder/src/test/org/apache/geronimo/j2ee/deployment/EJBRefContextTest.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/j2ee-builder/src/test/org/apache/geronimo/j2ee/deployment/EJBRefContextTest.java?rev=385659&r1=385658&r2=385659&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/j2ee-builder/src/test/org/apache/geronimo/j2ee/deployment/EJBRefContextTest.java (original)
+++ geronimo/branches/1.1/modules/j2ee-builder/src/test/org/apache/geronimo/j2ee/deployment/EJBRefContextTest.java Mon Mar 13 13:07:27 2006
@@ -33,9 +33,10 @@
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
 import org.apache.geronimo.kernel.repository.Artifact;
 import org.apache.geronimo.kernel.config.Configuration;
+import org.apache.geronimo.kernel.Naming;
 
 /**
- * @version $Rev$ $Date$
+ * @version $Rev: 385372 $ $Date$
  */
 public class EJBRefContextTest extends TestCase {
     private final URI coffee = URI.create("some/path/coffee.jar");
@@ -163,20 +164,20 @@
 
         refContext = new RefContext(new MockEjbReferenceBuilder(), new MockResourceReferenceBuilder(), new MockServiceReferenceBuilder(), null);
 
-        AbstractName applicationName = NameFactory.getRootName(new Artifact("test", "stuff", "", "ear"), "app", NameFactory.J2EE_APPLICATION) ;
+        AbstractName applicationName = Naming.createRootName(new Artifact("test", "stuff", "", "ear"), "app", NameFactory.J2EE_APPLICATION) ;
         namingContext = new MockNamingContext(applicationName);
 
-        AbstractName coffeeName = NameFactory.getChildName(applicationName, NameFactory.EJB_MODULE, coffee.getPath(), null);
-        coffee_peaberry = NameFactory.getChildName(coffeeName, NameFactory.STATELESS_SESSION_BEAN, "peaberry", null);
-        coffee_java = NameFactory.getChildName(coffeeName, NameFactory.STATELESS_SESSION_BEAN, "java", null);
-
-        AbstractName languageName = NameFactory.getChildName(applicationName, NameFactory.EJB_MODULE, language.getPath(), null);
-        language_lisp = NameFactory.getChildName(languageName, NameFactory.STATELESS_SESSION_BEAN, "lisp", null);
-        language_java = NameFactory.getChildName(languageName, NameFactory.STATELESS_SESSION_BEAN, "java", null);
-
-        AbstractName carName = NameFactory.getChildName(applicationName, NameFactory.EJB_MODULE, car.getPath(), null);
-        AbstractName car_gt = NameFactory.getChildName(carName, NameFactory.STATELESS_SESSION_BEAN, "gt", null);
-        car_enzo = NameFactory.getChildName(carName, NameFactory.STATELESS_SESSION_BEAN, "enzo", null);
+        AbstractName coffeeName = Naming.createChildName(applicationName, NameFactory.EJB_MODULE, coffee.getPath());
+        coffee_peaberry = Naming.createChildName(coffeeName, NameFactory.STATELESS_SESSION_BEAN, "peaberry");
+        coffee_java = Naming.createChildName(coffeeName, NameFactory.STATELESS_SESSION_BEAN, "java");
+
+        AbstractName languageName = Naming.createChildName(applicationName, NameFactory.EJB_MODULE, language.getPath());
+        language_lisp = Naming.createChildName(languageName, NameFactory.STATELESS_SESSION_BEAN, "lisp");
+        language_java = Naming.createChildName(languageName, NameFactory.STATELESS_SESSION_BEAN, "java");
+
+        AbstractName carName = Naming.createChildName(applicationName, NameFactory.EJB_MODULE, car.getPath());
+        AbstractName car_gt = Naming.createChildName(carName, NameFactory.STATELESS_SESSION_BEAN, "gt");
+        car_enzo = Naming.createChildName(carName, NameFactory.STATELESS_SESSION_BEAN, "enzo");
 
         namingContext.addGBean(new GBeanData(coffee_peaberry, null));
         namingContext.addGBean(new GBeanData(coffee_java, null));

Modified: geronimo/branches/1.1/modules/j2ee/src/java/org/apache/geronimo/j2ee/j2eeobjectnames/NameFactory.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/j2ee/src/java/org/apache/geronimo/j2ee/j2eeobjectnames/NameFactory.java?rev=385659&r1=385658&r2=385659&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/j2ee/src/java/org/apache/geronimo/j2ee/j2eeobjectnames/NameFactory.java (original)
+++ geronimo/branches/1.1/modules/j2ee/src/java/org/apache/geronimo/j2ee/j2eeobjectnames/NameFactory.java Mon Mar 13 13:07:27 2006
@@ -25,13 +25,12 @@
 import java.util.Map;
 import java.util.Hashtable;
 import java.util.HashMap;
-import java.util.Set;
 import java.util.Collections;
 import javax.management.MalformedObjectNameException;
 import javax.management.ObjectName;
 
 /**
- * @version $Rev$ $Date$
+ * @version $Rev: 385487 $ $Date$
  */
 public class NameFactory {
 
@@ -131,8 +130,6 @@
             J2EE_MODULE,  //this is a bad name here
             J2EE_MODULE   //should be SpringModule?
     };
-    private static final String DEFAULT_DOMAIN_NAME = "geronimo";
-    private static final String DEFAULT_SERVER_NAME = "geronimo";
 
     public static AbstractName buildApplicationName(Map properties, Artifact artifact) throws MalformedObjectNameException {
         String baseNameString = (String) properties.get(JSR77_BASE_NAME_PROPERTY);
@@ -210,9 +207,9 @@
         return getComponentName(j2eeDomainName, j2eeServerName, j2eeApplicationName, EJB_MODULE, j2eeModuleName, j2eeName, j2eeType, context);
     }
 
-    public static String getEjbComponentNameString(String j2eeDomainName, String j2eeServerName, String j2eeApplicationName, String j2eeModuleName, String j2eeName, String j2eeType, J2eeContext context) throws MalformedObjectNameException {
-        return getEjbComponentName(j2eeDomainName, j2eeServerName, j2eeApplicationName, j2eeModuleName, j2eeName, j2eeType, context).getCanonicalName();
-    }
+//    public static String getEjbComponentNameString(String j2eeDomainName, String j2eeServerName, String j2eeApplicationName, String j2eeModuleName, String j2eeName, String j2eeType, J2eeContext context) throws MalformedObjectNameException {
+//        return getEjbComponentName(j2eeDomainName, j2eeServerName, j2eeApplicationName, j2eeModuleName, j2eeName, j2eeType, context).getCanonicalName();
+//    }
 
 
     public static AbstractNameQuery getComponentNameQuery(String name, String type, AbstractName context) {
@@ -296,29 +293,28 @@
         }
     }
 
-    public static ObjectName getComponentNameQuery(String domainName, String serverName, String applicationName, String name, String type, J2eeContext context) throws MalformedObjectNameException {
-        return getComponentNameQuery(domainName, serverName, applicationName, null, "*", name, type, context);
-    }
+//    public static ObjectName getComponentNameQuery(String domainName, String serverName, String applicationName, String name, String type, J2eeContext context) throws MalformedObjectNameException {
+//        return getComponentNameQuery(domainName, serverName, applicationName, null, "*", name, type, context);
+//    }
 
     public static ObjectName getComponentInModuleQuery(String domainName, String serverName, String applicationName, String moduleType, String moduleName, String type, J2eeContext context) throws MalformedObjectNameException {
         return getComponentNameQuery(domainName, serverName, applicationName, moduleType, moduleName, "*", type, context);
     }
 
-    /**
-     * Creates a query for components that are in no application with given name.
-     *
-     * @param domainName
-     * @param serverName
-     * @param name
-     * @param type
-     * @param context
-     * @return
-     * @throws MalformedObjectNameException
-     */
-
-    public static ObjectName getComponentRestrictedQueryName(String domainName, String serverName, String name, String type, J2eeContext context) throws MalformedObjectNameException {
-        return getComponentNameQuery(domainName, serverName, NULL, null, "*", name, type, context);
-    }
+//    /**
+//     * Creates a query for components that are in no application with given name.
+//     *
+//     * @param domainName
+//     * @param serverName
+//     * @param name
+//     * @param type
+//     * @param context
+//     * @return
+//     * @throws MalformedObjectNameException
+//     */
+//    public static ObjectName getComponentRestrictedQueryName(String domainName, String serverName, String name, String type, J2eeContext context) throws MalformedObjectNameException {
+//        return getComponentNameQuery(domainName, serverName, NULL, null, "*", name, type, context);
+//    }
 
     public static ObjectName getWebComponentName(String j2eeDomainName, String j2eeServerName, String j2eeApplicationName, String j2eeModuleName, String j2eeName, String j2eeType, J2eeContext context) throws MalformedObjectNameException {
         return getComponentName(j2eeDomainName, j2eeServerName, j2eeApplicationName, WEB_MODULE, j2eeModuleName, j2eeName, j2eeType, context);
@@ -354,49 +350,14 @@
         return ObjectName.getInstance(context.getJ2eeDomainName(j2eeDomainName), props);
     }
 
-    public static ObjectName getChildName(ObjectName parentObjectName, String type, String name) throws MalformedObjectNameException {
-        String domain = parentObjectName.getDomain();
-        Hashtable parentKeys = parentObjectName.getKeyPropertyList();
-        String parentType = (String) parentKeys.remove(J2EE_TYPE);
-        String parentName = (String) parentKeys.remove(J2EE_NAME);
-        parentKeys.put(parentType, parentName);
-        parentKeys.put(J2EE_TYPE, type);
-        parentKeys.put(J2EE_NAME, name);
-        return ObjectName.getInstance(domain, parentKeys);
-    }
-
-    public static AbstractName getRootName(Artifact artifact, String name, String type) {
-        Hashtable nameMap = new Hashtable();
-        nameMap.put(J2EE_SERVER, DEFAULT_SERVER_NAME);
-        nameMap.put(J2EE_TYPE, type);
-        nameMap.put(J2EE_NAME, name);
-
-        ObjectName moduleObjectName = null;
-        try {
-            moduleObjectName = ObjectName.getInstance(DEFAULT_DOMAIN_NAME, nameMap);
-        } catch (MalformedObjectNameException e) {
-            throw new AssertionError(e);
-        }
-
-        return new AbstractName(artifact, nameMap, Collections.EMPTY_SET, moduleObjectName);
-    }
-
-
-    public static AbstractName getChildName(AbstractName parentAbstractName, String type, String name, Set interfaceTypes) {
-        Artifact artifact = parentAbstractName.getArtifact();
-        Map nameMap = new HashMap(parentAbstractName.getName());
-        ObjectName childObjectName = null;
-        try {
-            ObjectName parentObjectName = parentAbstractName.getObjectName();
-            childObjectName = getChildName(parentObjectName, type, name);
-        } catch (MalformedObjectNameException e) {
-            throw new AssertionError(e);
-        }
-        String parentType = (String) nameMap.remove(J2EE_TYPE);
-        String parentName = (String) nameMap.remove(J2EE_NAME);
-        nameMap.put(parentType, parentName);
-        nameMap.put(J2EE_TYPE, type);
-        nameMap.put(J2EE_NAME, name);
-        return new AbstractName(artifact, nameMap, interfaceTypes, childObjectName);
-    }
+//    public static ObjectName getChildName(ObjectName parentObjectName, String type, String name) throws MalformedObjectNameException {
+//        String domain = parentObjectName.getDomain();
+//        Hashtable parentKeys = parentObjectName.getKeyPropertyList();
+//        String parentType = (String) parentKeys.remove(J2EE_TYPE);
+//        String parentName = (String) parentKeys.remove(J2EE_NAME);
+//        parentKeys.put(parentType, parentName);
+//        parentKeys.put(J2EE_TYPE, type);
+//        parentKeys.put(J2EE_NAME, name);
+//        return ObjectName.getInstance(domain, parentKeys);
+//    }
 }

Modified: geronimo/branches/1.1/modules/jetty-builder/src/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/jetty-builder/src/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java?rev=385659&r1=385658&r2=385659&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/jetty-builder/src/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java (original)
+++ geronimo/branches/1.1/modules/jetty-builder/src/java/org/apache/geronimo/jetty/deployment/JettyModuleBuilder.java Mon Mar 13 13:07:27 2006
@@ -43,6 +43,7 @@
 import org.apache.geronimo.kernel.GBeanAlreadyExistsException;
 import org.apache.geronimo.kernel.GBeanNotFoundException;
 import org.apache.geronimo.kernel.Kernel;
+import org.apache.geronimo.kernel.Naming;
 import org.apache.geronimo.kernel.config.ConfigurationData;
 import org.apache.geronimo.kernel.config.ConfigurationModuleType;
 import org.apache.geronimo.kernel.repository.Artifact;
@@ -116,7 +117,7 @@
 
 
 /**
- * @version $Rev$ $Date$
+ * @version $Rev: 385487 $ $Date$
  */
 public class JettyModuleBuilder extends AbstractWebModuleBuilder {
     private final static Log log = LogFactory.getLog(JettyModuleBuilder.class);
@@ -242,7 +243,7 @@
                 throw new DeploymentException("Could not construct standalone web module name", e);
             }
         } else {
-            moduleName = NameFactory.getChildName(earName, NameFactory.WEB_MODULE, targetPath, null);
+            moduleName = Naming.createChildName(earName, NameFactory.WEB_MODULE, targetPath);
         }
 
         return new WebModule(standAlone, moduleName, environment, moduleFile, targetPath, webApp, jettyWebApp, specDD, contextRoot, portMap, JETTY_NAMESPACE);
@@ -540,7 +541,7 @@
                     Object defaultFilter = iterator.next();
                     GBeanData filterGBeanData = getGBeanData(kernel, defaultFilter);
                     String filterName = (String) filterGBeanData.getAttribute("filterName");
-                    AbstractName defaultFilterAbstractName = NameFactory.getChildName(moduleName, NameFactory.WEB_FILTER, filterName, null);
+                    AbstractName defaultFilterAbstractName = Naming.createChildName(moduleName, NameFactory.WEB_FILTER, filterName);
                     filterGBeanData.setAbstractName(defaultFilterAbstractName);
                     filterGBeanData.setReferencePattern("JettyServletRegistration", moduleName);
                     moduleContext.addGBean(filterGBeanData);
@@ -551,7 +552,7 @@
                     filterMappingGBeanData.setReferencePattern("JettyServletRegistration", moduleName);
                     String urlPattern = "/*";
                     filterMappingGBeanData.setAttribute("urlPattern", urlPattern);
-                    AbstractName filterMappingName = NameFactory.getChildName(defaultFilterAbstractName, NameFactory.URL_WEB_FILTER_MAPPING, urlPattern, null);
+                    AbstractName filterMappingName = Naming.createChildName(defaultFilterAbstractName, NameFactory.URL_WEB_FILTER_MAPPING, urlPattern);
                     filterMappingGBeanData.setAbstractName(filterMappingName);
                     previous = filterMappingName;
 
@@ -597,19 +598,19 @@
                 GBeanData filterMappingData = new GBeanData(JettyFilterMapping.GBEAN_INFO);
                 filterMappingData.setReferencePattern("Previous", previous);
                 filterMappingData.setReferencePattern("JettyServletRegistration", moduleName);
-                AbstractName filterAbstractName = NameFactory.getChildName(moduleName, NameFactory.WEB_FILTER, filterName, null);
+                AbstractName filterAbstractName = Naming.createChildName(moduleName, NameFactory.WEB_FILTER, filterName);
 
                 AbstractName filterMappingName = null;
                 if (filterMappingType.isSetUrlPattern()) {
                     String urlPattern = filterMappingType.getUrlPattern().getStringValue().trim();
                     filterMappingData.setAttribute("urlPattern", urlPattern);
-                    filterMappingName = NameFactory.getChildName(filterAbstractName, NameFactory.URL_WEB_FILTER_MAPPING, urlPattern, null);
+                    filterMappingName = Naming.createChildName(filterAbstractName, NameFactory.URL_WEB_FILTER_MAPPING, urlPattern);
                 }
                 if (filterMappingType.isSetServletName()) {
                     String servletName = filterMappingType.getServletName().getStringValue().trim();
-                    AbstractName servletAbstractName = NameFactory.getChildName(moduleName, NameFactory.SERVLET, servletName, null);
+                    AbstractName servletAbstractName = Naming.createChildName(moduleName, NameFactory.SERVLET, servletName);
                     filterMappingData.setReferencePattern("Servlet", servletAbstractName);
-                    filterMappingName = NameFactory.getChildName(filterAbstractName, NameFactory.SERVLET_WEB_FILTER_MAPPING, servletName, null);
+                    filterMappingName = Naming.createChildName(filterAbstractName, NameFactory.SERVLET_WEB_FILTER_MAPPING, servletName);
                 }
                 filterMappingData.setAbstractName(filterMappingName);
                 previous = filterMappingName;
@@ -642,7 +643,7 @@
             for (int i = 0; i < filterArray.length; i++) {
                 FilterType filterType = filterArray[i];
                 String filterName = filterType.getFilterName().getStringValue().trim();
-                AbstractName filterAbstractName = NameFactory.getChildName(moduleName, NameFactory.WEB_FILTER, filterName, null);
+                AbstractName filterAbstractName = Naming.createChildName(moduleName, NameFactory.WEB_FILTER, filterName);
                 GBeanData filterData = new GBeanData(filterAbstractName, JettyFilterHolder.GBEAN_INFO);
                 filterData.setAttribute("filterName", filterName);
                 filterData.setAttribute("filterClass", filterType.getFilterClass().getStringValue().trim());
@@ -662,7 +663,7 @@
                 for (Iterator iterator = defaultServlets.iterator(); iterator.hasNext();) {
                     Object defaultServlet = iterator.next();
                     GBeanData servletGBeanData = getGBeanData(kernel, defaultServlet);
-                    AbstractName defaultServletObjectName = NameFactory.getChildName(moduleName, NameFactory.SERVLET, (String) servletGBeanData.getAttribute("servletName"), null);
+                    AbstractName defaultServletObjectName = Naming.createChildName(moduleName, NameFactory.SERVLET, (String) servletGBeanData.getAttribute("servletName"));
                     servletGBeanData.setAbstractName(defaultServletObjectName);
                     servletGBeanData.setReferencePattern("JettyServletRegistration", moduleName);
                     Set defaultServletMappings = new HashSet((Collection) servletGBeanData.getAttribute("servletMappings"));
@@ -786,7 +787,7 @@
                             ClassLoader webClassLoader,
                             EARContext earContext) throws DeploymentException {
         String servletName = servletType.getServletName().getStringValue().trim();
-        AbstractName servletObjectName = NameFactory.getChildName(webModuleName, NameFactory.SERVLET, servletName, null);
+        AbstractName servletObjectName = Naming.createChildName(webModuleName, NameFactory.SERVLET, servletName);
         GBeanData servletData;
         if (servletType.isSetServletClass()) {
             String servletClassName = servletType.getServletClass().getStringValue().trim();
@@ -829,7 +830,7 @@
         // http://issues.apache.org/jira/browse/GERONIMO-645
         if (null != previousServlet) {
             String name = previousServlet.getServletName().getStringValue().trim();
-            AbstractName oName = NameFactory.getChildName(webModuleName, NameFactory.SERVLET, name, null);
+            AbstractName oName = Naming.createChildName(webModuleName, NameFactory.SERVLET, name);
             servletData.setReferencePattern("Previous", oName);
         }
 

Modified: geronimo/branches/1.1/modules/jetty/src/java/org/apache/geronimo/jetty/JettyManagerImpl.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/jetty/src/java/org/apache/geronimo/jetty/JettyManagerImpl.java?rev=385659&r1=385658&r2=385659&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/jetty/src/java/org/apache/geronimo/jetty/JettyManagerImpl.java (original)
+++ geronimo/branches/1.1/modules/jetty/src/java/org/apache/geronimo/jetty/JettyManagerImpl.java Mon Mar 13 13:07:27 2006
@@ -32,6 +32,7 @@
 import org.apache.geronimo.jetty.requestlog.JettyLogManager;
 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;
@@ -47,7 +48,7 @@
  * Jetty implementation of WebManager.  Knows how to manipulate
  * other Jetty objects for management purposes.
  *
- * @version $Rev$ $Date$
+ * @version $Rev: 385372 $ $Date$
  */
 public class JettyManagerImpl implements WebManager {
     private final static Log log = LogFactory.getLog(JettyManagerImpl.class);
@@ -67,7 +68,7 @@
      * functional (e.g. SSL settings for an HTTPS connector).
      */
     public AbstractName addConnector(AbstractName containerName, String uniqueName, String protocol, String host, int port) {
-        AbstractName name = NameFactory.getChildName(containerName, NameFactory.GERONIMO_SERVICE, "JettyWebConnector-" + protocol + "-" + uniqueName, null);
+        AbstractName name = Naming.createChildName(containerName, NameFactory.GERONIMO_SERVICE, "JettyWebConnector-" + protocol + "-" + uniqueName);
         GBeanData connector;
         if (protocol.equals(PROTOCOL_HTTP)) {
             connector = new GBeanData(name, HTTPConnector.GBEAN_INFO);

Added: geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/Naming.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/Naming.java?rev=385659&view=auto
==============================================================================
--- geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/Naming.java (added)
+++ geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/Naming.java Mon Mar 13 13:07:27 2006
@@ -0,0 +1,81 @@
+/**
+ *
+ * Copyright 2005 The Apache Software Foundation
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.apache.geronimo.kernel;
+
+import java.util.HashMap;
+import java.util.Hashtable;
+import java.util.Map;
+import javax.management.MalformedObjectNameException;
+import javax.management.ObjectName;
+
+import org.apache.geronimo.gbean.AbstractName;
+import org.apache.geronimo.kernel.repository.Artifact;
+
+/**
+ * @version $Rev$ $Date$
+ */
+public class Naming {
+    private static final String DEFAULT_DOMAIN_NAME = "geronimo";
+    private static final String DEFAULT_SERVER_NAME = "geronimo";
+    public static final String J2EE_TYPE = "j2eeType";
+    public static final String J2EE_NAME = "name";
+
+    public static AbstractName createRootName(Artifact artifact, String name, String type) {
+        Map nameMap = new HashMap();
+        nameMap.put(J2EE_TYPE, type);
+        nameMap.put(J2EE_NAME, name);
+
+        return new AbstractName(artifact,
+                nameMap,
+                createObjectName(nameMap));
+    }
+
+    public static AbstractName createChildName(AbstractName parentAbstractName, String type, String name) {
+        return createChildName(parentAbstractName, parentAbstractName.getArtifact(), type, name);
+    }
+
+    public static AbstractName createChildName(AbstractName parentAbstractName, Artifact artifact, String type, String name) {
+        Map nameMap = new HashMap(parentAbstractName.getName());
+
+        String parentType = (String) nameMap.remove(J2EE_TYPE);
+        String parentName = (String) nameMap.remove(J2EE_NAME);
+        nameMap.put(parentType, parentName);
+        nameMap.put(J2EE_TYPE, type);
+        nameMap.put(J2EE_NAME, name);
+
+        return new AbstractName(artifact,
+                nameMap,
+                createObjectName(nameMap));
+    }
+
+    /**
+     * @deprecated objectnames are being removed
+     */
+    private static ObjectName createObjectName(Map nameMap) {
+        Hashtable objectNameMap = new Hashtable(nameMap);
+        objectNameMap.put("J2EEServer", DEFAULT_SERVER_NAME);
+
+        ObjectName moduleObjectName = null;
+        try {
+            moduleObjectName = ObjectName.getInstance(DEFAULT_DOMAIN_NAME, objectNameMap);
+        } catch (MalformedObjectNameException e) {
+            throw new AssertionError(e);
+        }
+        return moduleObjectName;
+    }
+
+}

Modified: geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/basic/BasicProxyManager.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/basic/BasicProxyManager.java?rev=385659&r1=385658&r2=385659&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/basic/BasicProxyManager.java (original)
+++ geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/basic/BasicProxyManager.java Mon Mar 13 13:07:27 2006
@@ -44,7 +44,7 @@
  * Creates proxies that communicate directly with a Kernel located in the same
  * JVM as the client.
  *
- * @version $Rev$ $Date$
+ * @version $Rev: 385487 $ $Date$
  */
 public class BasicProxyManager implements ProxyManager {
     private final static String MANAGED_BEAN_NAME = "org.apache.geronimo.kernel.proxy.GeronimoManagedBean";
@@ -148,7 +148,9 @@
         if (target == null) throw new NullPointerException("target is null");
         if (classLoader == null) throw new NullPointerException("classLoader is null");
 
-            Set interfaces = target.getInterfaceTypes();
+        try {
+            GBeanInfo info = kernel.getGBeanInfo(target);
+            Set interfaces = info.getInterfaces();
             if(interfaces.size() == 0) {
                 log.warn("No interfaces found for " + target + " ("+target+")");
                 return null;
@@ -163,6 +165,9 @@
                 }
             }
             return createProxyFactory((Class[]) intfs.toArray(new Class[intfs.size()]), classLoader).createProxy(target);
+        } catch (GBeanNotFoundException e) {
+            throw new IllegalArgumentException("Could not get GBeanInfo for target object: " + target);
+        }
     }
 
     public Object[] createProxies(String[] objectNameStrings, ClassLoader classLoader) throws MalformedObjectNameException {

Modified: geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/config/ConfigurationManager.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/config/ConfigurationManager.java?rev=385659&r1=385658&r2=385659&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/config/ConfigurationManager.java (original)
+++ geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/config/ConfigurationManager.java Mon Mar 13 13:07:27 2006
@@ -25,7 +25,7 @@
 /**
  * Encapsulates logic for dealing with configurations.
  *
- * @version $Rev$ $Date$
+ * @version $Rev: 384686 $ $Date$
  */
 public interface ConfigurationManager {
     /**
@@ -37,7 +37,7 @@
 
     /**
      * Return a list of the stores this manager knows about.
-     * @return a List<ObjectName> of the stores this manager controls
+     * @return a List<AbstractName> of the stores this manager controls
      */
     List listStores();
 

Modified: geronimo/branches/1.1/modules/kernel/src/test/org/apache/geronimo/gbean/GBeanInfoTest.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/kernel/src/test/org/apache/geronimo/gbean/GBeanInfoTest.java?rev=385659&r1=385658&r2=385659&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/kernel/src/test/org/apache/geronimo/gbean/GBeanInfoTest.java (original)
+++ geronimo/branches/1.1/modules/kernel/src/test/org/apache/geronimo/gbean/GBeanInfoTest.java Mon Mar 13 13:07:27 2006
@@ -110,12 +110,14 @@
 
     final static GReferenceInfo refInfo = new GReferenceInfo("reference", String.class.getName(), String.class.getName(), "setReference", "Fooifier");
 
-    public void setUp() {
+    public void setUp() throws Exception {
+        super.setUp();
         gbeanInfo = MockGBean.getGBeanInfo();
     }
 
     protected void tearDown() throws Exception {
         gbeanInfo = null;
+        super.tearDown();
     }
 
     public static final class MockGBean {

Modified: geronimo/branches/1.1/modules/kernel/src/test/org/apache/geronimo/gbean/GBeanNameTest.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/kernel/src/test/org/apache/geronimo/gbean/GBeanNameTest.java?rev=385659&r1=385658&r2=385659&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/kernel/src/test/org/apache/geronimo/gbean/GBeanNameTest.java (original)
+++ geronimo/branches/1.1/modules/kernel/src/test/org/apache/geronimo/gbean/GBeanNameTest.java Mon Mar 13 13:07:27 2006
@@ -170,6 +170,7 @@
     }
 
     protected void setUp() throws Exception {
+        super.setUp();
         props = new Properties();
     }
 }

Modified: geronimo/branches/1.1/modules/kernel/src/test/org/apache/geronimo/gbean/Speed.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/kernel/src/test/org/apache/geronimo/gbean/Speed.java?rev=385659&r1=385658&r2=385659&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/kernel/src/test/org/apache/geronimo/gbean/Speed.java (original)
+++ geronimo/branches/1.1/modules/kernel/src/test/org/apache/geronimo/gbean/Speed.java Mon Mar 13 13:07:27 2006
@@ -17,19 +17,17 @@
 package org.apache.geronimo.gbean;
 
 import java.lang.reflect.Method;
-import java.util.HashMap;
-import javax.management.ObjectName;
-import javax.management.MalformedObjectNameException;
 
 import net.sf.cglib.reflect.FastClass;
-import org.apache.geronimo.kernel.MockGBean;
-import org.apache.geronimo.kernel.KernelFactory;
+import org.apache.geronimo.gbean.runtime.RawInvoker;
 import org.apache.geronimo.kernel.Kernel;
+import org.apache.geronimo.kernel.KernelFactory;
+import org.apache.geronimo.kernel.MockGBean;
+import org.apache.geronimo.kernel.Naming;
 import org.apache.geronimo.kernel.repository.Artifact;
-import org.apache.geronimo.gbean.runtime.RawInvoker;
 
 /**
- * @version $Rev$ $Date$
+ * @version $Rev: 384141 $ $Date$
  */
 public class Speed {
     private static final Object[] NO_ARGS = new Object[0];
@@ -174,15 +172,14 @@
 //        printResults("CGLibProxy", end, start, iterations);
     }
 
-    private static GBeanData buildGBeanData() throws MalformedObjectNameException {
-        ObjectName objectName = new ObjectName("speed:type=MockGBean");
-        AbstractName abstractName = new AbstractName(new Artifact("foo", "bar", "1", "car"), new HashMap(), MockGBean.getGBeanInfo().getInterfaces(), objectName);
+    private static GBeanData buildGBeanData() {
+        AbstractName abstractName = Naming.createRootName(new Artifact("test", "foo", "1", "car"), "test", "test");
         GBeanData mockGBean = new GBeanData(abstractName, MockGBean.getGBeanInfo());
         return mockGBean;
     }
 
 
-    private static void echoTimings() throws Exception {
+    public static void echoTimings() throws Exception {
         Method myMethod = MockGBean.class.getMethod("echo", new Class[]{String.class});
 
         FastClass myFastClass = FastClass.create(MockGBean.class);

Modified: geronimo/branches/1.1/modules/kernel/src/test/org/apache/geronimo/gbean/runtime/GBeanAttributeTest.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/kernel/src/test/org/apache/geronimo/gbean/runtime/GBeanAttributeTest.java?rev=385659&r1=385658&r2=385659&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/kernel/src/test/org/apache/geronimo/gbean/runtime/GBeanAttributeTest.java (original)
+++ geronimo/branches/1.1/modules/kernel/src/test/org/apache/geronimo/gbean/runtime/GBeanAttributeTest.java Mon Mar 13 13:07:27 2006
@@ -16,26 +16,19 @@
  */
 package org.apache.geronimo.gbean.runtime;
 
-import javax.management.ObjectName;
-import javax.management.MalformedObjectNameException;
-
 import junit.framework.TestCase;
+import org.apache.geronimo.gbean.AbstractName;
 import org.apache.geronimo.gbean.GAttributeInfo;
 import org.apache.geronimo.gbean.GBeanData;
 import org.apache.geronimo.gbean.InvalidConfigurationException;
-import org.apache.geronimo.gbean.GBeanInfo;
-import org.apache.geronimo.gbean.AbstractName;
-import org.apache.geronimo.kernel.MockDynamicGBean;
-import org.apache.geronimo.kernel.MockGBean;
-import org.apache.geronimo.kernel.KernelFactory;
 import org.apache.geronimo.kernel.Kernel;
+import org.apache.geronimo.kernel.KernelFactory;
+import org.apache.geronimo.kernel.MockGBean;
+import org.apache.geronimo.kernel.Naming;
 import org.apache.geronimo.kernel.repository.Artifact;
 
-import java.util.Map;
-import java.util.HashMap;
-
 /**
- * @version $Rev$ $Date$
+ * @version $Rev: 383682 $ $Date$
  */
 public class GBeanAttributeTest extends TestCase {
 
@@ -48,11 +41,6 @@
      */
     private GBeanInstance gbeanInstance = null;
 
-    /**
-     * Wraps DynamicGBean
-     */
-    private GBeanInstance dynamicGBeanInstance = null;
-
     private MethodInvoker getInvoker = null;
 
     private MethodInvoker setInvoker = null;
@@ -60,7 +48,6 @@
     private GAttributeInfo persistentPrimitiveAttributeInfo = null;
     private GAttributeInfo attributeInfo = null;
     private Kernel kernel;
-//    private GAttributeInfo throwingExceptionAttributeInfo = null;
 
     public final void testGBeanAttributStringClassMethodInvokerMethodInvoker() {
         try {
@@ -68,11 +55,7 @@
             fail("IllegalArgumentException expected");
         } catch (IllegalArgumentException expected) {
         }
-//        try {
-//            GBeanAttribute.createFrameworkAttribute(gbeanInstance, attributeName, String.class, null);
-//            fail("InvalidConfigurationException expected");
-//        } catch (InvalidConfigurationException expected) {
-//        }
+
         GBeanAttribute attribute;
         attribute = GBeanAttribute.createFrameworkAttribute(gbeanInstance, attributeName, String.class, getInvoker);
         assertEquals(String.class, attribute.getType());
@@ -133,16 +116,6 @@
             assertTrue(attribute.isWritable());
         }
 
-//        // todo recreate this in the info builder tests since the compariason now happens there
-//        {
-//            final GAttributeInfo attributeInfo = new GAttributeInfo("AnotherFinalInt", int.class.getName(), false, true, true, null, null);
-//            try {
-//                new GBeanAttribute(gbeanInstance, attributeInfo, false);
-//                fail("Getter and setter methods do not have the same types; InvalidConfigurationException expected");
-//            } catch (InvalidConfigurationException expected) {
-//            }
-//        }
-
         {
             // the attribute name and getter name are different, yet both
             // exist.
@@ -354,31 +327,29 @@
     }
 
     protected void setUp() throws Exception {
+        super.setUp();
         kernel = KernelFactory.newInstance().createKernel("test");
         kernel.boot();
 
-        gbeanInstance = new GBeanInstance(new GBeanData(buildAbstractName("normal", MockGBean.getGBeanInfo()), MockGBean.getGBeanInfo()),
-                kernel,
-                kernel.getDependencyManager(),
-                new MyLifecycleBroadcaster(),
-                MockGBean.class.getClassLoader());
-        dynamicGBeanInstance = new GBeanInstance(new GBeanData(buildAbstractName("dynamic", MockDynamicGBean.getGBeanInfo()), MockDynamicGBean.getGBeanInfo()),
+        AbstractName name = Naming.createRootName(new Artifact("test", "foo", "1", "car"), "test", "test");
+        gbeanInstance = new GBeanInstance(new GBeanData(name, MockGBean.getGBeanInfo()),
                 kernel,
                 kernel.getDependencyManager(),
                 new MyLifecycleBroadcaster(),
                 MockGBean.class.getClassLoader());
-        getInvoker = new MethodInvoker() {
 
+        getInvoker = new MethodInvoker() {
             public Object invoke(Object target, Object[] arguments) throws Exception {
                 throw new UnsupportedOperationException("Throws exception to rise test coverage");
             }
         };
-        setInvoker = new MethodInvoker() {
 
+        setInvoker = new MethodInvoker() {
             public Object invoke(Object target, Object[] arguments) throws Exception {
                 throw new UnsupportedOperationException("Throws exception to rise test coverage");
             }
         };
+
         attributeInfo = new GAttributeInfo(attributeName, String.class.getName(), false, false, "getName", "setName");
         persistentPrimitiveAttributeInfo = new GAttributeInfo(persistentPrimitiveAttributeName, int.class.getName(), true, false, "getMutableInt", "setMutableInt");
     }
@@ -386,12 +357,7 @@
     protected void tearDown() throws Exception {
         kernel.shutdown();
         gbeanInstance = null;
-    }
-
-    private AbstractName buildAbstractName(String name, GBeanInfo info) throws MalformedObjectNameException {
-        Map names = new HashMap();
-        names.put("name", name);
-        return new AbstractName(new Artifact("test", "foo", "1", "car"), names, info.getInterfaces(), new ObjectName("test:MockGBean=" + name));
+        super.tearDown();
     }
 
     private static class MyLifecycleBroadcaster implements LifecycleBroadcaster {

Modified: geronimo/branches/1.1/modules/kernel/src/test/org/apache/geronimo/gbean/runtime/GBeanDependencyTest.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/kernel/src/test/org/apache/geronimo/gbean/runtime/GBeanDependencyTest.java?rev=385659&r1=385658&r2=385659&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/kernel/src/test/org/apache/geronimo/gbean/runtime/GBeanDependencyTest.java (original)
+++ geronimo/branches/1.1/modules/kernel/src/test/org/apache/geronimo/gbean/runtime/GBeanDependencyTest.java Mon Mar 13 13:07:27 2006
@@ -19,30 +19,24 @@
 import junit.framework.TestCase;
 import org.apache.geronimo.gbean.AbstractName;
 import org.apache.geronimo.gbean.GBeanData;
-import org.apache.geronimo.gbean.GBeanInfo;
 import org.apache.geronimo.gbean.ReferencePatterns;
 import org.apache.geronimo.kernel.Kernel;
 import org.apache.geronimo.kernel.KernelFactory;
 import org.apache.geronimo.kernel.MockGBean;
+import org.apache.geronimo.kernel.Naming;
 import org.apache.geronimo.kernel.management.State;
 import org.apache.geronimo.kernel.repository.Artifact;
 
-import javax.management.MalformedObjectNameException;
-import javax.management.ObjectName;
-import java.util.HashMap;
-import java.util.Map;
-
 /**
- * @version $Rev$ $Date$
+ * @version $Rev: 384351 $ $Date$
  */
 public class GBeanDependencyTest extends TestCase {
-
     private Kernel kernel;
 
     public void testGBeanDependency() throws Exception {
-        AbstractName parentName = buildAbstractName("parent", MockGBean.getGBeanInfo());
+        AbstractName parentName = Naming.createRootName(new Artifact("test", "foo", "1", "car"), "parent", "parent");
         GBeanData gbeanDataParent = new GBeanData(parentName, MockGBean.getGBeanInfo());
-        GBeanData gbeanDataChild = new GBeanData(buildAbstractName("child", MockGBean.getGBeanInfo()), MockGBean.getGBeanInfo());
+        GBeanData gbeanDataChild = new GBeanData(Naming.createChildName(parentName, "child", "child"), MockGBean.getGBeanInfo());
         gbeanDataChild.addDependency(new ReferencePatterns(parentName));
         kernel.loadGBean(gbeanDataChild, MockGBean.class.getClassLoader());
         kernel.startGBean(gbeanDataChild.getName());
@@ -53,18 +47,14 @@
         assertEquals(State.RUNNING_INDEX, kernel.getGBeanState(gbeanDataChild.getName()));
     }
 
-    private AbstractName buildAbstractName(String name, GBeanInfo info) throws MalformedObjectNameException {
-        Map names = new HashMap();
-        names.put("name", name);
-        return new AbstractName(new Artifact("test", "foo", "1", "car"), names, info.getInterfaces(), new ObjectName("test:MockGBean=" + name));
-    }
     protected void setUp() throws Exception {
+        super.setUp();
         kernel = KernelFactory.newInstance().createKernel("test");
         kernel.boot();
     }
 
     protected void tearDown() throws Exception {
         kernel.shutdown();
+        super.tearDown();
     }
-
 }

Modified: geronimo/branches/1.1/modules/kernel/src/test/org/apache/geronimo/kernel/BootstrapTest.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/kernel/src/test/org/apache/geronimo/kernel/BootstrapTest.java?rev=385659&r1=385658&r2=385659&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/kernel/src/test/org/apache/geronimo/kernel/BootstrapTest.java (original)
+++ geronimo/branches/1.1/modules/kernel/src/test/org/apache/geronimo/kernel/BootstrapTest.java Mon Mar 13 13:07:27 2006
@@ -20,15 +20,11 @@
 import java.io.File;
 
 import junit.framework.TestCase;
-import org.apache.geronimo.kernel.Kernel;
 
 /**
- *
- *
  * @version $Rev$ $Date$
  */
 public class BootstrapTest extends TestCase {
-    private File tmpDir;
     private File kernelState;
 
     public void testCreate() throws Exception {
@@ -41,11 +37,13 @@
     }
 
     protected void setUp() throws Exception {
-        tmpDir = new File(System.getProperty("java.io.tmpdir"));
+        super.setUp();
+        File tmpDir = new File(System.getProperty("java.io.tmpdir"));
         kernelState = new File(tmpDir, "kernel.ser");
     }
 
     protected void tearDown() throws Exception {
         kernelState.delete();
+        super.tearDown();
     }
 }

Modified: geronimo/branches/1.1/modules/kernel/src/test/org/apache/geronimo/kernel/ConfigTest.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/kernel/src/test/org/apache/geronimo/kernel/ConfigTest.java?rev=385659&r1=385658&r2=385659&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/kernel/src/test/org/apache/geronimo/kernel/ConfigTest.java (original)
+++ geronimo/branches/1.1/modules/kernel/src/test/org/apache/geronimo/kernel/ConfigTest.java Mon Mar 13 13:07:27 2006
@@ -26,11 +26,8 @@
 import java.net.URL;
 import java.util.ArrayList;
 import java.util.HashMap;
-import java.util.Hashtable;
 import java.util.List;
 import java.util.Map;
-import javax.management.MalformedObjectNameException;
-import javax.management.ObjectName;
 
 import junit.framework.TestCase;
 import org.apache.geronimo.gbean.AbstractName;
@@ -44,9 +41,9 @@
 import org.apache.geronimo.kernel.config.ConfigurationStore;
 import org.apache.geronimo.kernel.config.ConfigurationUtil;
 import org.apache.geronimo.kernel.config.EditableConfigurationManager;
+import org.apache.geronimo.kernel.config.EditableConfigurationManagerImpl;
 import org.apache.geronimo.kernel.config.InvalidConfigException;
 import org.apache.geronimo.kernel.config.NoSuchConfigException;
-import org.apache.geronimo.kernel.config.EditableConfigurationManagerImpl;
 import org.apache.geronimo.kernel.management.State;
 import org.apache.geronimo.kernel.repository.Artifact;
 import org.apache.geronimo.kernel.repository.DefaultArtifactManager;
@@ -68,7 +65,7 @@
 
         // load -- config should be running and gbean registered but not started
         Configuration configuration = configurationManager.loadConfiguration(configurationData);
-        ObjectName configurationName = new ObjectName(configuration.getObjectName());
+        AbstractName configurationName = Configuration.getConfigurationAbstractName(configuration.getId());
 
         assertEquals(State.RUNNING_INDEX, kernel.getGBeanState(configurationName));
         assertNotNull(configuration.getConfigurationClassLoader());
@@ -125,7 +122,7 @@
     public void testConfigStartStopRestart() throws Exception {
         // load -- config should be running and gbean registered but not started
         Configuration configuration = configurationManager.loadConfiguration(configurationData);
-        ObjectName configurationName = new ObjectName(configuration.getObjectName());
+        AbstractName configurationName = Configuration.getConfigurationAbstractName(configuration.getId());
 
         assertEquals(State.RUNNING_INDEX, kernel.getGBeanState(configurationName));
         assertNotNull(configuration.getConfigurationClassLoader());
@@ -173,7 +170,7 @@
         Configuration configuration = configurationManager.loadConfiguration(configurationData);
         assertNotNull(configuration.getConfigurationClassLoader());
 
-        GBeanData mockBean3 = buildGBeanData(configuration.getId(), new String[] {"J2EEServer", "name"}, new String[] {"geronimo", "MyMockGMBean3"}, MockGBean.getGBeanInfo());
+        GBeanData mockBean3 = buildGBeanData(configuration.getId(), "MyMockGMBean3", "MockGBean", MockGBean.getGBeanInfo());
         try {
             kernel.getGBeanState(mockBean3.getAbstractName());
             fail("Gbean should not be found yet");
@@ -196,18 +193,18 @@
         kernel.boot();
 
         Artifact baseArtifact = new Artifact("test", "base", "1", "car");
-        GBeanData artifactManagerData = buildGBeanData(baseArtifact, new String[] {"module", "j2eeType"}, new String[] {"base", "ArtifactManager"}, DefaultArtifactManager.GBEAN_INFO);
+        GBeanData artifactManagerData = buildGBeanData(baseArtifact, "ArtifactManager", "ArtifactManager", DefaultArtifactManager.GBEAN_INFO);
         kernel.loadGBean(artifactManagerData, getClass().getClassLoader());
         kernel.startGBean(artifactManagerData.getAbstractName());
         assertEquals(State.RUNNING_INDEX, kernel.getGBeanState(artifactManagerData.getAbstractName()));
 
-        GBeanData artifactResolverData = buildGBeanData(baseArtifact, new String[] {"module", "j2eeType"}, new String[] {"base", "ArtifactResolver"}, DefaultArtifactResolver.GBEAN_INFO);
+        GBeanData artifactResolverData = buildGBeanData(baseArtifact, "ArtifactResolver", "ArtifactResolver", DefaultArtifactResolver.GBEAN_INFO);
         artifactResolverData.setReferencePattern("ArtifactManager", artifactManagerData.getAbstractName());
         kernel.loadGBean(artifactResolverData, getClass().getClassLoader());
         kernel.startGBean(artifactResolverData.getAbstractName());
         assertEquals(State.RUNNING_INDEX, kernel.getGBeanState(artifactResolverData.getAbstractName()));
 
-        GBeanData configurationManagerData = buildGBeanData(baseArtifact, new String[] {"module", "name"}, new String[] {"base", "BasicConfigurationManager"}, EditableConfigurationManagerImpl.GBEAN_INFO);
+        GBeanData configurationManagerData = buildGBeanData(baseArtifact, "ConfigurationManager", "ConfigurationManager", EditableConfigurationManagerImpl.GBEAN_INFO);
         configurationManagerData.setReferencePattern("ArtifactManager", artifactManagerData.getAbstractName());
         configurationManagerData.setReferencePattern("ArtifactResolver", artifactResolverData.getAbstractName());
 
@@ -223,14 +220,14 @@
 
         ArrayList gbeans = new ArrayList();
 
-        GBeanData mockBean1 = buildGBeanData(environment.getConfigId(), new String[] {"J2EEServer", "name"}, new String[] {"geronimo", "MyMockGMBean1"}, MockGBean.getGBeanInfo());
+        GBeanData mockBean1 = buildGBeanData(environment.getConfigId(),"MyMockGMBean1", "MockGBean", MockGBean.getGBeanInfo());
         gbeanName1 = mockBean1.getAbstractName();
         mockBean1.setAttribute("value", "1234");
         mockBean1.setAttribute("name", "child");
         mockBean1.setAttribute("finalInt", new Integer(1));
         gbeans.add(mockBean1);
 
-        GBeanData mockBean2 = buildGBeanData(environment.getConfigId(), new String[] {"J2EEServer", "name"}, new String[] {"geronimo", "MyMockGMBean2"}, MockGBean.getGBeanInfo());
+        GBeanData mockBean2 = buildGBeanData(environment.getConfigId(), "MyMockGMBean2", "MockGBean", MockGBean.getGBeanInfo());
         gbeanName2 = mockBean2.getAbstractName();
         mockBean2.setAttribute("value", "5678");
         mockBean2.setAttribute("name", "Parent");
@@ -243,19 +240,9 @@
         configurationData = new ConfigurationData(ConfigurationModuleType.CAR, null, gbeans, null, environment, new File("."));
     }
 
-    private GBeanData buildGBeanData(Artifact artifact, String[] key, String[] value, GBeanInfo info) throws MalformedObjectNameException {
-         AbstractName abstractName = buildAbstractName(artifact, key, value, info);
+    private GBeanData buildGBeanData(Artifact artifact, String name, String type, GBeanInfo info) {
+         AbstractName abstractName = Naming.createRootName(artifact, name, type);
          return new GBeanData(abstractName, info);
-     }
-
-     private AbstractName buildAbstractName(Artifact artifact, String[] key, String[] value, GBeanInfo info) throws MalformedObjectNameException {
-         Hashtable names = new Hashtable();
-         for (int i = 0; i < key.length; i++) {
-             String k = key[i];
-             String v = value[i];
-             names.put(k, v);
-         }
-         return new AbstractName(artifact, names, info.getInterfaces(), new ObjectName("test", names));
      }
 
     protected void tearDown() throws Exception {

Modified: geronimo/branches/1.1/modules/kernel/src/test/org/apache/geronimo/kernel/GBeanTest.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/kernel/src/test/org/apache/geronimo/kernel/GBeanTest.java?rev=385659&r1=385658&r2=385659&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/kernel/src/test/org/apache/geronimo/kernel/GBeanTest.java (original)
+++ geronimo/branches/1.1/modules/kernel/src/test/org/apache/geronimo/kernel/GBeanTest.java Mon Mar 13 13:07:27 2006
@@ -17,11 +17,15 @@
 
 package org.apache.geronimo.kernel;
 
+import java.net.URL;
+import java.net.URLClassLoader;
+import java.util.Set;
+
 import junit.framework.TestCase;
 import org.apache.geronimo.gbean.AbstractName;
+import org.apache.geronimo.gbean.AbstractNameQuery;
 import org.apache.geronimo.gbean.GBeanData;
 import org.apache.geronimo.gbean.GBeanInfo;
-import org.apache.geronimo.gbean.AbstractNameQuery;
 import org.apache.geronimo.kernel.management.State;
 import org.apache.geronimo.kernel.proxy.ProxyFactory;
 import org.apache.geronimo.kernel.proxy.ProxyManager;
@@ -31,16 +35,8 @@
 import org.apache.log4j.Logger;
 import org.apache.log4j.PatternLayout;
 
-import javax.management.MalformedObjectNameException;
-import javax.management.ObjectName;
-import java.net.URL;
-import java.net.URLClassLoader;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Set;
-
 /**
- * @version $Rev$ $Date$
+ * @version $Rev: 384141 $ $Date$
  */
 public class GBeanTest extends TestCase {
     private Kernel kernel;
@@ -206,6 +202,7 @@
     }
 
     protected void setUp() throws Exception {
+        super.setUp();
         Logger.getRootLogger().addAppender(new ConsoleAppender(new PatternLayout("%p [%t] %m %n")));
         Logger.getRootLogger().setLevel(Level.DEBUG);
         kernel = KernelFactory.newInstance().createKernel("test");
@@ -214,16 +211,11 @@
 
     protected void tearDown() throws Exception {
         kernel.shutdown();
-    }
-    private GBeanData buildGBeanData(String key, String value, GBeanInfo info) throws MalformedObjectNameException {
-        AbstractName abstractName = buildAbstractName(key, value, info);
-        return new GBeanData(abstractName, info);
+        super.tearDown();
     }
 
-    private AbstractName buildAbstractName(String key, String value, GBeanInfo info) throws MalformedObjectNameException {
-        Map names = new HashMap();
-        names.put(key, value);
-        return new AbstractName(new Artifact("test", "foo", "1", "car"), names, info.getInterfaces(), new ObjectName("test:" + key + "=" + value));
+    private GBeanData buildGBeanData(String name, String type, GBeanInfo info) {
+        AbstractName abstractName = Naming.createRootName(new Artifact("test", "foo", "1", "car"), name, type);
+        return new GBeanData(abstractName, info);
     }
-
 }

Modified: geronimo/branches/1.1/modules/kernel/src/test/org/apache/geronimo/kernel/basic/BasicProxyMapTest.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/kernel/src/test/org/apache/geronimo/kernel/basic/BasicProxyMapTest.java?rev=385659&r1=385658&r2=385659&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/kernel/src/test/org/apache/geronimo/kernel/basic/BasicProxyMapTest.java (original)
+++ geronimo/branches/1.1/modules/kernel/src/test/org/apache/geronimo/kernel/basic/BasicProxyMapTest.java Mon Mar 13 13:07:27 2006
@@ -152,6 +152,7 @@
     }
 
     protected void setUp() throws Exception {
+        super.setUp();
         map = new BasicProxyMap();
     }    
 }

Modified: geronimo/branches/1.1/modules/kernel/src/test/org/apache/geronimo/kernel/config/ConfigurationManagerTest.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/kernel/src/test/org/apache/geronimo/kernel/config/ConfigurationManagerTest.java?rev=385659&r1=385658&r2=385659&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/kernel/src/test/org/apache/geronimo/kernel/config/ConfigurationManagerTest.java (original)
+++ geronimo/branches/1.1/modules/kernel/src/test/org/apache/geronimo/kernel/config/ConfigurationManagerTest.java Mon Mar 13 13:07:27 2006
@@ -16,37 +16,36 @@
  */
 package org.apache.geronimo.kernel.config;
 
-import java.io.IOException;
 import java.io.File;
+import java.io.IOException;
+import java.net.MalformedURLException;
+import java.net.URI;
+import java.net.URL;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.LinkedHashSet;
 import java.util.List;
 import java.util.Map;
-import java.util.HashMap;
-import java.util.Collections;
 import java.util.SortedSet;
-import java.util.LinkedHashSet;
 import java.util.TreeSet;
-import java.util.Iterator;
-import java.net.URL;
-import java.net.URI;
-import java.net.MalformedURLException;
-import javax.management.ObjectName;
-import javax.management.MalformedObjectNameException;
 
 import junit.framework.TestCase;
-import org.apache.geronimo.kernel.repository.Environment;
+import org.apache.geronimo.gbean.AbstractName;
+import org.apache.geronimo.gbean.GBeanData;
+import org.apache.geronimo.gbean.GBeanInfo;
+import org.apache.geronimo.kernel.Kernel;
+import org.apache.geronimo.kernel.KernelFactory;
+import org.apache.geronimo.kernel.Naming;
+import org.apache.geronimo.kernel.management.State;
 import org.apache.geronimo.kernel.repository.Artifact;
+import org.apache.geronimo.kernel.repository.ArtifactManager;
 import org.apache.geronimo.kernel.repository.DefaultArtifactManager;
 import org.apache.geronimo.kernel.repository.DefaultArtifactResolver;
-import org.apache.geronimo.kernel.repository.ArtifactManager;
-import org.apache.geronimo.kernel.repository.Version;
-import org.apache.geronimo.kernel.repository.ListableRepository;
+import org.apache.geronimo.kernel.repository.Environment;
 import org.apache.geronimo.kernel.repository.ImportType;
-import org.apache.geronimo.kernel.KernelFactory;
-import org.apache.geronimo.kernel.Kernel;
-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 org.apache.geronimo.kernel.repository.ListableRepository;
+import org.apache.geronimo.kernel.repository.Version;
 
 /**
  * @version $Rev$ $Date$
@@ -158,15 +157,9 @@
         }
     }
 
-    private GBeanData buildGBeanData(String key, String value, GBeanInfo info) throws MalformedObjectNameException {
-        AbstractName abstractName = buildAbstractName(key, value, info);
+    private GBeanData buildGBeanData(String key, String value, GBeanInfo info) {
+        AbstractName abstractName = Naming.createRootName(new Artifact("test", "foo", "1", "car"), value, key);
         return new GBeanData(abstractName, info);
-    }
-
-    private AbstractName buildAbstractName(String key, String value, GBeanInfo info) throws MalformedObjectNameException {
-        Map names = new HashMap();
-        names.put(key, value);
-        return new AbstractName(new Artifact("test", "foo", "1", "car"), names, info.getInterfaces(), new ObjectName("test:" + key + "=" + value));
     }
 
     private class TestRepository implements ListableRepository {

Modified: geronimo/branches/1.1/modules/kernel/src/test/org/apache/geronimo/kernel/config/MultiParentClassLoaderTest.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/kernel/src/test/org/apache/geronimo/kernel/config/MultiParentClassLoaderTest.java?rev=385659&r1=385658&r2=385659&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/kernel/src/test/org/apache/geronimo/kernel/config/MultiParentClassLoaderTest.java (original)
+++ geronimo/branches/1.1/modules/kernel/src/test/org/apache/geronimo/kernel/config/MultiParentClassLoaderTest.java Mon Mar 13 13:07:27 2006
@@ -47,7 +47,6 @@
     private static final String NON_EXISTANT_RESOURCE = "non-existant-resource";
     private static final String NON_EXISTANT_CLASS = "NonExistant.class";
     private URLClassLoader[] parents;
-    private File myFile;
     private MultiParentClassLoader classLoader;
     private static final Artifact NAME = new Artifact("test", "fake", "1.0", "car");
 
@@ -293,11 +292,8 @@
         assertTrue("File should exist: " + file, file.canRead());
     }
 
-    private static void assertFileNotExists(File file) {
-        assertTrue("File should not exist: " + file, !file.canRead());
-    }
-
     protected void setUp() throws Exception {
+        super.setUp();
         files = new File[3];
         for (int i = 0; i < files.length; i++) {
             files[i] = createJarFile(i);
@@ -308,7 +304,7 @@
             parents[i] = new URLClassLoader(new URL[]{files[i].toURL()});
         }
 
-        myFile = createJarFile(33);
+        File myFile = createJarFile(33);
         classLoader = new MultiParentClassLoader(NAME, new URL[]{myFile.toURL()}, parents);
     }
 
@@ -365,6 +361,7 @@
             files[i].delete();
 //            assertFileNotExists(files[i]);
         }
+        super.tearDown();
     }
 
     private static class ByteCode extends DefaultGeneratorStrategy {

Modified: geronimo/branches/1.1/modules/kernel/src/test/org/apache/geronimo/kernel/config/MyGBean.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/kernel/src/test/org/apache/geronimo/kernel/config/MyGBean.java?rev=385659&r1=385658&r2=385659&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/kernel/src/test/org/apache/geronimo/kernel/config/MyGBean.java (original)
+++ geronimo/branches/1.1/modules/kernel/src/test/org/apache/geronimo/kernel/config/MyGBean.java Mon Mar 13 13:07:27 2006
@@ -21,8 +21,6 @@
 import org.apache.geronimo.gbean.GBeanInfoBuilder;
 
 /**
- * 
- * 
  * @version $Rev$ $Date$
  */
 public class MyGBean {
@@ -31,9 +29,10 @@
     }
 
     public static final GBeanInfo GBEAN_INFO;
+
     static {
         GBeanInfoBuilder infoFactory = GBeanInfoBuilder.createStatic(MyGBean.class);
-        infoFactory.addOperation("main", new Class[] {String[].class});
+        infoFactory.addOperation("main", new Class[]{String[].class});
         GBEAN_INFO = infoFactory.getBeanInfo();
     }
 }

Modified: geronimo/branches/1.1/modules/kernel/src/test/org/apache/geronimo/kernel/management/StateTest.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/kernel/src/test/org/apache/geronimo/kernel/management/StateTest.java?rev=385659&r1=385658&r2=385659&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/kernel/src/test/org/apache/geronimo/kernel/management/StateTest.java (original)
+++ geronimo/branches/1.1/modules/kernel/src/test/org/apache/geronimo/kernel/management/StateTest.java Mon Mar 13 13:07:27 2006
@@ -17,8 +17,6 @@
 
 package org.apache.geronimo.kernel.management;
 
-import org.apache.geronimo.kernel.management.State;
-
 import junit.framework.TestCase;
 
 /**

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=385659&r1=385658&r2=385659&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 Mon Mar 13 13:07:27 2006
@@ -38,6 +38,7 @@
 import org.apache.geronimo.gbean.ReferencePatterns;
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
 import org.apache.geronimo.kernel.GBeanAlreadyExistsException;
+import org.apache.geronimo.kernel.Naming;
 import org.apache.geronimo.security.jaas.JaasLoginModuleUse;
 import org.apache.geronimo.security.jaas.LoginModuleGBean;
 import org.apache.geronimo.xbeans.geronimo.loginconfig.GerAbstractLoginModuleType;
@@ -127,7 +128,7 @@
                         String value = trim(gerOptionType.getStringValue());
                         options.setProperty(key, value);
                     }
-                    loginModuleName = NameFactory.getChildName(parentName, NameFactory.LOGIN_MODULE, name, LoginModuleGBean.GBEAN_INFO.getInterfaces());
+                    loginModuleName = Naming.createChildName(parentName, NameFactory.LOGIN_MODULE, name);
                     loginModuleReferencePatterns = new ReferencePatterns(loginModuleName);
                     GBeanData loginModuleGBeanData = new GBeanData(loginModuleName, LoginModuleGBean.GBEAN_INFO);
                     loginModuleGBeanData.setAttribute("loginDomainName", name);
@@ -141,7 +142,7 @@
                     throw new DeploymentException("Unknown abstract login module type: " + abstractLoginModule.getClass());
                 }
                 AbstractName thisName;
-                thisName = NameFactory.getChildName(parentName, "LoginModuleUse", name, JaasLoginModuleUse.GBEAN_INFO.getInterfaces());
+                thisName = Naming.createChildName(parentName, "LoginModuleUse", name);
                 GBeanData loginModuleUseGBeanData = new GBeanData(thisName, JaasLoginModuleUse.GBEAN_INFO);
                 loginModuleUseGBeanData.setAttribute("controlFlag", controlFlag);
                 loginModuleUseGBeanData.setReferencePatterns("LoginModule", loginModuleReferencePatterns);

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=385659&r1=385658&r2=385659&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 Mon Mar 13 13:07:27 2006
@@ -23,7 +23,6 @@
 import java.util.Set;
 import javax.security.auth.Subject;
 import javax.security.auth.x500.X500Principal;
-import javax.management.MalformedObjectNameException;
 
 import org.apache.geronimo.gbean.GBeanData;
 import org.apache.geronimo.gbean.AbstractName;
@@ -47,10 +46,11 @@
 import org.apache.geronimo.xbeans.geronimo.security.GerRoleType;
 import org.apache.geronimo.xbeans.geronimo.security.GerSecurityType;
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
+import org.apache.geronimo.kernel.Naming;
 
 
 /**
- * @version $Rev$ $Date$
+ * @version $Rev: 384667 $ $Date$
  */
 public class SecurityBuilder {
 
@@ -227,8 +227,8 @@
         return new PrincipalInfo(principalType.getClass1(), principalType.getName(), principalType.isSetDesignatedRunAs());
     }
 
-    public static GBeanData configureApplicationPolicyManager(AbstractName moduleName, Map contextIDToPermissionsMap, SecurityConfiguration securityConfiguration) throws MalformedObjectNameException {
-        AbstractName jaccBeanName = NameFactory.getChildName(moduleName, NameFactory.JACC_MANAGER, NameFactory.JACC_MANAGER, ApplicationPolicyConfigurationManager.GBEAN_INFO.getInterfaces());
+    public static GBeanData configureApplicationPolicyManager(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());



Mime
View raw message