geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r384141 [2/2] - in /geronimo/branches/1.1: configs/j2ee-system/src/plan/ modules/kernel/src/java/org/apache/geronimo/gbean/ modules/kernel/src/java/org/apache/geronimo/gbean/runtime/ modules/kernel/src/java/org/apache/geronimo/kernel/ modul...
Date Wed, 08 Mar 2006 07:30:11 GMT
Modified: geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/config/ConfigurationManagerImpl.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/config/ConfigurationManagerImpl.java?rev=384141&r1=384140&r2=384141&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/config/ConfigurationManagerImpl.java (original)
+++ geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/config/ConfigurationManagerImpl.java Tue Mar  7 23:30:08 2006
@@ -79,12 +79,12 @@
     private final Map configurations = new LinkedHashMap();
 
     public ConfigurationManagerImpl(Kernel kernel,
-            Collection stores,
-            ManageableAttributeStore attributeStore,
-            PersistentConfigurationList configurationList,
-            ArtifactManager artifactManager,
-            ArtifactResolver artifactResolver,
-            ClassLoader classLoader) {
+                                    Collection stores,
+                                    ManageableAttributeStore attributeStore,
+                                    PersistentConfigurationList configurationList,
+                                    ArtifactManager artifactManager,
+                                    ArtifactResolver artifactResolver,
+                                    ClassLoader classLoader) {
 
         if (kernel == null) throw new NullPointerException("kernel is null");
         if (classLoader == null) throw new NullPointerException("classLoader is null");
@@ -93,7 +93,8 @@
         this.stores = stores;
         this.attributeStore = attributeStore;
         this.configurationList = configurationList;
-        if (artifactResolver == null) artifactResolver = new DefaultArtifactResolver(artifactManager, Collections.EMPTY_SET);
+        if (artifactResolver == null)
+            artifactResolver = new DefaultArtifactResolver(artifactManager, Collections.EMPTY_SET);
         this.artifactManager = artifactManager;
         this.artifactResolver = artifactResolver;
         this.classLoader = classLoader;
@@ -302,8 +303,8 @@
             if (store.containsConfiguration(configId)) {
                 GBeanData configurationGBean = store.loadConfiguration(configId);
 
-                ObjectName configurationName = Configuration.getConfigurationObjectName(configId);
-                configurationGBean.setName(configurationName);
+                AbstractName configurationName = Configuration.getConfigurationAbstractName(configId);
+                configurationGBean.setAbstractName(configurationName);
                 configurationGBean.setAttribute("configurationStore", store);
 
                 return configurationGBean;
@@ -316,9 +317,7 @@
         if (artifactManager != null) {
             gbeanData.setAttribute("artifactManager", artifactManager);
         }
-        if (artifactResolver != null) {
-            gbeanData.setAttribute("artifactResolver", artifactResolver);
-        }
+        gbeanData.setAttribute("artifactResolver", artifactResolver);
 
         Environment environment = (Environment) gbeanData.getAttribute("environment");
 
@@ -337,19 +336,15 @@
         for (Iterator iterator = imports.iterator(); iterator.hasNext();) {
             Artifact artifact = (Artifact) iterator.next();
             AbstractName importName = Configuration.getConfigurationAbstractName(artifact);
+            gbeanData.getDependencies().add(importName);
             importNames.add(new AbstractNameQuery(importName));
         }
-        LinkedHashSet referenceNames = new LinkedHashSet();
         for (Iterator iterator = references.iterator(); iterator.hasNext();) {
             Artifact artifact = (Artifact) iterator.next();
             AbstractName referenceName = Configuration.getConfigurationAbstractName(artifact);
-            referenceNames.add(new AbstractNameQuery(referenceName));
+            gbeanData.getDependencies().add(referenceName);
         }
 
-        // add dependencies on the imports and references
-        gbeanData.getDependencies().addAll(importNames);
-        gbeanData.getDependencies().addAll(referenceNames);
-
         // imports become the parents
         gbeanData.setReferencePatterns("Parents", importNames);
     }
@@ -382,13 +377,14 @@
 
     private void registerGBeans(Configuration configuration) throws InvalidConfigException, NoSuchConfigException, MalformedURLException {
         // load the attribute overrides from the attribute store
-        Collection gbeans = configuration.getGBeans().values();
+        Map gbeanMap = configuration.getGBeans();
+        Collection gbeans = gbeanMap.values();
         if (attributeStore != null) {
-            gbeans = attributeStore.setAttributes(getConfigurationId(configuration), gbeans, configuration.getConfigurationClassLoader());
+            gbeans = attributeStore.applyOverrides(getConfigurationId(configuration), gbeans, configuration.getConfigurationClassLoader());
         }
 
         // register all the GBeans
-        AbstractNameQuery configurationReferencePattern = new AbstractNameQuery(Configuration.getConfigurationAbstractName(configuration.getId()));
+        AbstractName configurationName = Configuration.getConfigurationAbstractName(configuration.getId());
         ConfigurationStore configurationStore = configuration.getConfigurationStore();
         for (Iterator iterator = gbeans.iterator(); iterator.hasNext();) {
             GBeanData gbeanData = (GBeanData) iterator.next();
@@ -405,7 +401,7 @@
             }
 
             // add a dependency from the gbean to the configuration
-            gbeanData.getDependencies().add(configurationReferencePattern);
+            gbeanData.getDependencies().add(configurationName);
 
             log.trace("Registering GBean " + gbeanData.getName());
 
@@ -420,6 +416,7 @@
     public void startConfiguration(Configuration configuration) throws InvalidConfigException {
         startConfiguration(getConfigurationId(configuration));
     }
+
     public void startConfiguration(Artifact id) throws InvalidConfigException {
         ConfigurationStatus configurationStatus = (ConfigurationStatus) configurations.get(id);
         if (configurationStatus == null) {
@@ -442,8 +439,8 @@
 
         try {
             // start the gbeans
-            Map gbeans = configuration.getGBeans();
-            for (Iterator iterator = gbeans.values().iterator(); iterator.hasNext();) {
+            Collection gbeans = configuration.getGBeans().values();
+            for (Iterator iterator = gbeans.iterator(); iterator.hasNext();) {
                 GBeanData gbeanData = (GBeanData) iterator.next();
                 AbstractName gbeanName = gbeanData.getAbstractName();
                 if (kernel.isGBeanEnabled(gbeanName)) {

Modified: geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/config/ConfigurationUtil.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/config/ConfigurationUtil.java?rev=384141&r1=384140&r2=384141&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/config/ConfigurationUtil.java (original)
+++ geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/config/ConfigurationUtil.java Tue Mar  7 23:30:08 2006
@@ -46,7 +46,7 @@
     private ConfigurationUtil() {
     }
 
-    public static ObjectName loadBootstrapConfiguration(Kernel kernel, InputStream in, ClassLoader classLoader) throws Exception {
+    public static AbstractName loadBootstrapConfiguration(Kernel kernel, InputStream in, ClassLoader classLoader) throws Exception {
         // load and start the configuration in this jar
         GBeanData configuration = new GBeanData();
         ObjectInputStream ois = new ObjectInputStream(in);
@@ -58,8 +58,8 @@
 
         Environment environment = (Environment) configuration.getAttribute("environment");
         Artifact configId = environment.getConfigId();
-        ObjectName configurationName = Configuration.getConfigurationObjectName(configId);
-        configuration.setName(configurationName);
+        AbstractName configurationName = Configuration.getConfigurationAbstractName(configId);
+        configuration.setAbstractName(configurationName);
 
         // for a bootstrap we should have an empty kernel, so clear the references and dependencies
         configuration.setAttribute("artifactManager", null);

Modified: geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/config/ManageableAttributeStore.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/config/ManageableAttributeStore.java?rev=384141&r1=384140&r2=384141&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/config/ManageableAttributeStore.java (original)
+++ geronimo/branches/1.1/modules/kernel/src/java/org/apache/geronimo/kernel/config/ManageableAttributeStore.java Tue Mar  7 23:30:08 2006
@@ -19,9 +19,10 @@
 import org.apache.geronimo.gbean.GAttributeInfo;
 import org.apache.geronimo.gbean.GBeanData;
 import org.apache.geronimo.gbean.GReferenceInfo;
+import org.apache.geronimo.gbean.AbstractName;
+import org.apache.geronimo.gbean.ReferencePatterns;
 import org.apache.geronimo.kernel.repository.Artifact;
 
-import javax.management.ObjectName;
 import java.io.IOException;
 import java.util.Collection;
 import java.util.Set;
@@ -38,8 +39,8 @@
     public static final String ATTRIBUTE_STORE = "AttributeStore";
 
     /**
-     * Given a conifguration name and a set of GBeanDatas, apply all the saved
-     * attribute values to those GBeans before the caller attempts to load
+     * Given a configuration name and a set of GBeanDatas, apply all the saved
+     * overrides to that set of GBeans before the caller attempts to load
      * them.
      *
      * @param configurationName The configuration in question
@@ -49,7 +50,7 @@
      * @return                  The modified GBeanData's
      * @throws InvalidConfigException If something bad happens
      */
-    public Collection setAttributes(Artifact configurationName, Collection datas, ClassLoader classLoader) throws InvalidConfigException;
+    public Collection applyOverrides(Artifact configurationName, Collection datas, ClassLoader classLoader) throws InvalidConfigException;
 
     /**
      * Sets the stored value for a particular attribute.  The attribute is
@@ -67,7 +68,7 @@
      * @param attribute The attribute in question
      * @param value The value to save, or null if no value should be saved
      */
-    public void setValue(String configurationName, ObjectName gbean, GAttributeInfo attribute, Object value);
+    public void setValue(String configurationName, AbstractName gbean, GAttributeInfo attribute, Object value);
 
     /**
      * Sets the pattern for a GBean reference. The reference is
@@ -79,9 +80,9 @@
      * @param configurationName the name of the configuration holding the GBean in question
      * @param gbean the ObjectName of the GBean
      * @param reference the attribute information
-     * @param pattern new object name pattern for this reference
+     * @param patterns
      */
-    public void setReferencePattern(String configurationName, ObjectName gbean, GReferenceInfo reference, ObjectName pattern);
+    public void setReferencePatterns(String configurationName, AbstractName gbean, GReferenceInfo reference, ReferencePatterns patterns);
 
     /**
      * Sets the patterns for a GBean reference. The reference is
@@ -93,7 +94,7 @@
      * @param reference the attribute information
      * @param patterns new object name patterns for this reference; must not be null
      */
-    public void setReferencePatterns(String configurationName, ObjectName gbean, GReferenceInfo reference, Set patterns);
+//    public void setReferencePatterns(String configurationName, AbstractName gbean, GReferenceInfo reference, Set patterns);
 
     /**
      * Sets whether a particular GBean should be loaded for this configuration.
@@ -105,7 +106,7 @@
      * @param gbean             The GBean in question
      * @param load              True if the GBean should load with the configuration
      */
-    public void setShouldLoad(String configurationName, ObjectName gbean, boolean load);
+    public void setShouldLoad(String configurationName, AbstractName gbean, boolean load);
 
 
     /**

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=384141&r1=384140&r2=384141&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 Tue Mar  7 23:30:08 2006
@@ -16,16 +16,16 @@
  */
 package org.apache.geronimo.gbean;
 
-/**
- * @version $Rev$ $Date$
- */
 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.kernel.Kernel;
+import org.apache.geronimo.kernel.repository.Artifact;
 import org.apache.geronimo.gbean.runtime.RawInvoker;
 
 /**
@@ -97,12 +97,11 @@
         // start a kernel
         Kernel kernel = KernelFactory.newInstance().createKernel("speed");
         kernel.boot();
-        ObjectName objectName = new ObjectName("speed:type=MockGBean");
-        GBeanData mockGBean = new GBeanData(objectName, MockGBean.getGBeanInfo());
+        GBeanData mockGBean = buildGBeanData();
         mockGBean.setAttribute("Name", "bar");
         mockGBean.setAttribute("FinalInt", new Integer(57));
         kernel.loadGBean(mockGBean, Speed.class.getClassLoader());
-        kernel.startGBean(objectName);
+        kernel.startGBean(mockGBean.getAbstractName());
 
         // reflect proxy
 //        ProxyFactory vmProxyFactory = new VMProxyFactory(MyInterface.class);
@@ -145,7 +144,7 @@
 */
 
         // Raw Invoker
-        RawInvoker rawInvoker = (RawInvoker) kernel.getAttribute(objectName, "$$RAW_INVOKER$$");
+        RawInvoker rawInvoker = (RawInvoker) kernel.getAttribute(mockGBean.getAbstractName(), "$$RAW_INVOKER$$");
         int rawIndex = ((Integer) rawInvoker.getOperationIndex().get(new GOperationSignature("doNothing", new String[0]))).intValue();
         iterations = 2000000;
         for (int i = 0; i < iterations; i++) {
@@ -175,6 +174,13 @@
 //        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);
+        GBeanData mockGBean = new GBeanData(abstractName, MockGBean.getGBeanInfo());
+        return mockGBean;
+    }
+
 
     private static void echoTimings() throws Exception {
         Method myMethod = MockGBean.class.getMethod("echo", new Class[]{String.class});
@@ -227,12 +233,11 @@
         // start a kernel
         Kernel kernel = KernelFactory.newInstance().createKernel("speed");
         kernel.boot();
-        ObjectName objectName = new ObjectName("speed:type=MockGBean");
-        GBeanData mockGBean = new GBeanData(objectName, MockGBean.getGBeanInfo());
+        GBeanData mockGBean = buildGBeanData();
         mockGBean.setAttribute("Name", "bar");
         mockGBean.setAttribute("FinalInt", new Integer(57));
         kernel.loadGBean(mockGBean, Speed.class.getClassLoader());
-        kernel.startGBean(objectName);
+        kernel.startGBean(mockGBean.getAbstractName());
 
         // reflect proxy
 //        ProxyFactory vmProxyFactory = new VMProxyFactory(MyInterface.class);

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=384141&r1=384140&r2=384141&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 Tue Mar  7 23:30:08 2006
@@ -16,22 +16,21 @@
  */
 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.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.Kernel;
-import org.apache.geronimo.kernel.repository.Artifact;
 import org.apache.geronimo.kernel.management.State;
-import org.apache.geronimo.gbean.GBeanData;
-import org.apache.geronimo.gbean.AbstractName;
-import org.apache.geronimo.gbean.GBeanInfo;
-import org.apache.geronimo.gbean.AbstractNameQuery;
+import org.apache.geronimo.kernel.repository.Artifact;
 
-import java.util.Map;
+import javax.management.MalformedObjectNameException;
+import javax.management.ObjectName;
 import java.util.HashMap;
+import java.util.Map;
 
 /**
  * @version $Rev$ $Date$
@@ -44,7 +43,7 @@
         AbstractName parentName = buildAbstractName("parent", MockGBean.getGBeanInfo());
         GBeanData gbeanDataParent = new GBeanData(parentName, MockGBean.getGBeanInfo());
         GBeanData gbeanDataChild = new GBeanData(buildAbstractName("child", MockGBean.getGBeanInfo()), MockGBean.getGBeanInfo());
-        gbeanDataChild.getDependencies().add(new AbstractNameQuery(parentName));
+        gbeanDataChild.getDependencies().add(parentName);
         kernel.loadGBean(gbeanDataChild, MockGBean.class.getClassLoader());
         kernel.startGBean(gbeanDataChild.getName());
         assertEquals(State.STARTING_INDEX, kernel.getGBeanState(gbeanDataChild.getName()));

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=384141&r1=384140&r2=384141&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 Tue Mar  7 23:30:08 2006
@@ -17,42 +17,41 @@
 
 package org.apache.geronimo.kernel;
 
-import java.io.ByteArrayOutputStream;
-import java.io.File;
-import java.io.IOException;
-import java.io.ObjectOutputStream;
-import java.net.MalformedURLException;
-import java.net.URI;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-import java.util.Map;
-import java.util.HashMap;
-import javax.management.ObjectName;
-import javax.management.MalformedObjectNameException;
-
 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.GBeanInfoBuilder;
-import org.apache.geronimo.gbean.AbstractName;
-import org.apache.geronimo.gbean.AbstractNameQuery;
 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.ConfigurationModuleType;
 import org.apache.geronimo.kernel.config.ConfigurationStore;
+import org.apache.geronimo.kernel.config.ConfigurationUtil;
 import org.apache.geronimo.kernel.config.InvalidConfigException;
 import org.apache.geronimo.kernel.config.NoSuchConfigException;
-import org.apache.geronimo.kernel.config.ConfigurationUtil;
-import org.apache.geronimo.kernel.config.ConfigurationManager;
 import org.apache.geronimo.kernel.management.State;
 import org.apache.geronimo.kernel.repository.Artifact;
 import org.apache.geronimo.kernel.repository.DefaultArtifactManager;
-import org.apache.geronimo.kernel.repository.Environment;
-import org.apache.geronimo.kernel.jmx.JMXUtil;
 import org.apache.geronimo.kernel.repository.DefaultArtifactResolver;
+import org.apache.geronimo.kernel.repository.Environment;
+
+import javax.management.MalformedObjectNameException;
+import javax.management.ObjectName;
+import java.io.ByteArrayOutputStream;
+import java.io.File;
+import java.io.IOException;
+import java.io.ObjectOutputStream;
+import java.net.MalformedURLException;
+import java.net.URI;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Hashtable;
+import java.util.List;
+import java.util.Map;
 
 /**
  * @version $Rev$ $Date$
@@ -180,8 +179,7 @@
         Configuration configuration = configurationManager.loadConfiguration(configurationData);
         assertNotNull(configuration.getConfigurationClassLoader());
 
-        GBeanData mockBean3 = buildGBeanData("name", "MyMockGMBean3", MockGBean.getGBeanInfo());
-        mockBean3.initializeName(configuration.getId(), JMXUtil.getObjectName(BASE_NAME));
+        GBeanData mockBean3 = buildGBeanData(configuration.getId(), new String[] {"J2EEServer", "name"}, new String[] {"geronimo", "MyMockGMBean3"}, MockGBean.getGBeanInfo());
         try {
             kernel.getGBeanState(mockBean3.getAbstractName());
             fail("Gbean should not be found yet");
@@ -203,23 +201,21 @@
         kernel = KernelFactory.newInstance().createKernel("test");
         kernel.boot();
 
-        GBeanData artifactManagerData = buildGBeanData("j2eeType", "ArtifactManager", DefaultArtifactManager.GBEAN_INFO);
-        artifactManagerData.initializeName(new Artifact("test", "base", "1", "car"), JMXUtil.getObjectName("test:module=base"));
+        Artifact baseArtifact = new Artifact("test", "base", "1", "car");
+        GBeanData artifactManagerData = buildGBeanData(baseArtifact, new String[] {"module", "j2eeType"}, new String[] {"base", "ArtifactManager"}, DefaultArtifactManager.GBEAN_INFO);
         kernel.loadGBean(artifactManagerData, getClass().getClassLoader());
         kernel.startGBean(artifactManagerData.getAbstractName());
         assertEquals(State.RUNNING_INDEX, kernel.getGBeanState(artifactManagerData.getAbstractName()));
 
-        GBeanData artifactResolverData = buildGBeanData("j2eeType", "ArtifactResolver", DefaultArtifactResolver.GBEAN_INFO);
-        artifactResolverData.initializeName(new Artifact("test", "base", "1", "car"), JMXUtil.getObjectName("test:module=base"));
-        artifactResolverData.setReferencePattern("ArtifactManager", new AbstractNameQuery(artifactManagerData.getAbstractName()));
+        GBeanData artifactResolverData = buildGBeanData(baseArtifact, new String[] {"module", "j2eeType"}, new String[] {"base", "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("name", "BasicConfigurationManager", ConfigurationManagerImpl.GBEAN_INFO);
-        configurationManagerData.initializeName(new Artifact("test", "base", "1", "car"), JMXUtil.getObjectName("test:module=base"));
-        configurationManagerData.setReferencePattern("ArtifactManager", new AbstractNameQuery(artifactManagerData.getAbstractName()));
-        configurationManagerData.setReferencePattern("ArtifactResolver", new AbstractNameQuery(artifactResolverData.getAbstractName()));
+        GBeanData configurationManagerData = buildGBeanData(baseArtifact, new String[] {"module", "name"}, new String[] {"base", "BasicConfigurationManager"}, ConfigurationManagerImpl.GBEAN_INFO);
+        configurationManagerData.setReferencePattern("ArtifactManager", artifactManagerData.getAbstractName());
+        configurationManagerData.setReferencePattern("ArtifactResolver", artifactResolverData.getAbstractName());
 
         kernel.loadGBean(configurationManagerData, getClass().getClassLoader());
         kernel.startGBean(configurationManagerData.getAbstractName());
@@ -233,33 +229,40 @@
 
         ArrayList gbeans = new ArrayList();
 
-        GBeanData mockBean1 = buildGBeanData("name", "MyMockGMBean1", MockGBean.getGBeanInfo());
-        mockBean1.initializeName(environment.getConfigId(), JMXUtil.getObjectName(BASE_NAME));
+        GBeanData mockBean1 = buildGBeanData(environment.getConfigId(), new String[] {"J2EEServer", "name"}, new String[] {"geronimo", "MyMockGMBean1"}, 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("name", "MyMockGMBean2", MockGBean.getGBeanInfo());
-        mockBean2.initializeName(environment.getConfigId(), JMXUtil.getObjectName(BASE_NAME));
+        GBeanData mockBean2 = buildGBeanData(environment.getConfigId(), new String[] {"J2EEServer", "name"}, new String[] {"geronimo", "MyMockGMBean2"}, MockGBean.getGBeanInfo());
         gbeanName2 = mockBean2.getAbstractName();
         mockBean2.setAttribute("value", "5678");
         mockBean2.setAttribute("name", "Parent");
         mockBean2.setAttribute("finalInt", new Integer(3));
-        mockBean2.setReferencePatterns("MockEndpoint", Collections.singleton(new AbstractNameQuery(gbeanName1)));
-        mockBean2.setReferencePatterns("EndpointCollection", Collections.singleton(new AbstractNameQuery(gbeanName1)));
+        mockBean2.setReferencePattern("MockEndpoint", gbeanName1);
+        mockBean2.setReferencePattern("EndpointCollection", new AbstractNameQuery(gbeanName1));
         gbeans.add(mockBean2);
 
 
         configurationData = new ConfigurationData(ConfigurationModuleType.CAR, null, gbeans, null, environment, null);
     }
 
-    private GBeanData buildGBeanData(String key, String value, GBeanInfo info) throws MalformedObjectNameException {
-        Map nameMap = new HashMap();
-        nameMap.put(key, value);
-        return new GBeanData(nameMap, Collections.EMPTY_SET, info);
-    }
+    private GBeanData buildGBeanData(Artifact artifact, String[] key, String[] value, GBeanInfo info) throws MalformedObjectNameException {
+         AbstractName abstractName = buildAbstractName(artifact, key, value, info);
+         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 {
         kernel.shutdown();
@@ -284,8 +287,8 @@
         }
 
         public GBeanData loadConfiguration(Artifact configId) throws NoSuchConfigException, IOException, InvalidConfigException {
-            ObjectName configurationObjectName = Configuration.getConfigurationObjectName(configId);
-            GBeanData configData = new GBeanData(configurationObjectName, Configuration.GBEAN_INFO);
+            AbstractName configurationName = Configuration.getConfigurationAbstractName(configId);
+            GBeanData configData = new GBeanData(configurationName, Configuration.GBEAN_INFO);
             Environment environment = new Environment();
             environment.setConfigId(configId);
             environment.getProperties().put("foo", "geronimo.test:J2EEServer=geronimo");

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=384141&r1=384140&r2=384141&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 Tue Mar  7 23:30:08 2006
@@ -93,7 +93,7 @@
 
         GBeanData gbean2 = buildGBeanData("name", "test2", MockGBean.getGBeanInfo());
         gbean2.setAttribute("finalInt", new Integer(123));
-        gbean2.setReferencePattern("MockEndpoint", new AbstractNameQuery(gbean1.getAbstractName()));
+        gbean2.setReferencePattern("MockEndpoint", gbean1.getAbstractName());
         kernel.loadGBean(gbean2, cl);
         kernel.startGBean(gbean2.getAbstractName());
 

Modified: geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/configuration/ConfigurationDump.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/configuration/ConfigurationDump.java?rev=384141&r1=384140&r2=384141&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/configuration/ConfigurationDump.java (original)
+++ geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/configuration/ConfigurationDump.java Tue Mar  7 23:30:08 2006
@@ -220,8 +220,8 @@
         }
 
         Configuration configuration = (Configuration) kernel.getProxyManager().createProxy(name, Configuration.class);
-        Map gbeans = configuration.getGBeans();
-        for (Iterator iterator = gbeans.values().iterator(); iterator.hasNext();) {
+        Collection gbeans = configuration.getGBeans().values();
+        for (Iterator iterator = gbeans.iterator(); iterator.hasNext();) {
             GBeanData gbeanData = (GBeanData) iterator.next();
             out.println();
             out.println();

Modified: geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/configuration/ConfigurationOverride.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/configuration/ConfigurationOverride.java?rev=384141&r1=384140&r2=384141&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/configuration/ConfigurationOverride.java (original)
+++ geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/configuration/ConfigurationOverride.java Tue Mar  7 23:30:08 2006
@@ -16,11 +16,12 @@
  */
 package org.apache.geronimo.system.configuration;
 
+import org.apache.geronimo.gbean.AbstractName;
+import org.apache.geronimo.kernel.InvalidGBeanException;
 import org.w3c.dom.Element;
 import org.w3c.dom.NodeList;
 
 import javax.management.MalformedObjectNameException;
-import javax.management.ObjectName;
 import java.io.PrintWriter;
 import java.util.Iterator;
 import java.util.LinkedHashMap;
@@ -39,7 +40,7 @@
         this.load = load;
     }
 
-    public ConfigurationOverride(Element element) throws MalformedObjectNameException {
+    public ConfigurationOverride(Element element) throws MalformedObjectNameException, InvalidGBeanException {
         name = element.getAttribute("name");
 
         String loadConfigString = element.getAttribute("load");
@@ -81,12 +82,12 @@
         return gbeans;
     }
 
-    public GBeanOverride getGBean(ObjectName gbeanName) {
-        return (GBeanOverride) gbeans.get(gbeanName);
+    public GBeanOverride getGBean(AbstractName gbeanName) {
+        return (GBeanOverride) gbeans.get(gbeanName.getObjectName());
     }
 
-    public void addGBean(ObjectName gbeanName, GBeanOverride gbean) {
-        gbeans.put(gbeanName, gbean);
+    public void addGBean(AbstractName gbeanName, GBeanOverride gbean) {
+        gbeans.put(gbeanName.getObjectName(), gbean);
     }
 
     public void writeXml(PrintWriter out) {

Modified: geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/configuration/GBeanOverride.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/configuration/GBeanOverride.java?rev=384141&r1=384140&r2=384141&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/configuration/GBeanOverride.java (original)
+++ geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/configuration/GBeanOverride.java Tue Mar  7 23:30:08 2006
@@ -20,7 +20,12 @@
 import org.apache.geronimo.gbean.GAttributeInfo;
 import org.apache.geronimo.gbean.GBeanData;
 import org.apache.geronimo.gbean.GBeanInfo;
+import org.apache.geronimo.gbean.AbstractName;
+import org.apache.geronimo.gbean.ReferencePatterns;
+import org.apache.geronimo.gbean.AbstractNameQuery;
 import org.apache.geronimo.util.EncryptionManager;
+import org.apache.geronimo.kernel.InvalidGBeanException;
+import org.apache.geronimo.kernel.repository.Artifact;
 import org.w3c.dom.Element;
 import org.w3c.dom.Node;
 import org.w3c.dom.NodeList;
@@ -35,6 +40,8 @@
 import java.util.LinkedHashSet;
 import java.util.Map;
 import java.util.Set;
+import java.util.HashMap;
+import java.util.List;
 
 /**
  * @version $Rev$ $Date$
@@ -52,7 +59,7 @@
         gbeanInfo = null;
     }
 
-    public GBeanOverride(ObjectName name, boolean load) {
+    public GBeanOverride(AbstractName name, boolean load) {
         this.name = name;
         this.load = load;
         gbeanInfo = null;
@@ -83,7 +90,7 @@
         references.putAll(gbeanData.getReferences());
     }
 
-    public GBeanOverride(Element gbean) throws MalformedObjectNameException {
+    public GBeanOverride(Element gbean) throws MalformedObjectNameException, InvalidGBeanException {
         String nameString = gbean.getAttribute("name");
         if (nameString.indexOf(':') > -1) {
             name = ObjectName.getInstance(nameString);
@@ -125,19 +132,41 @@
             NodeList patterns = reference.getElementsByTagName("pattern");
             for (int p = 0; p < references.getLength(); p++) {
                 Element pattern = (Element) patterns.item(p);
-                NodeList gbeanNames = pattern.getElementsByTagName("gbean-name");
-                if (gbeanNames.getLength() != 1) {
-                    throw new MalformedObjectNameException("pattern does not contain a valid gbean-name:" +
-                            " name=" + nameString +
-                            " referenceName=" + referenceName);
+                String groupId = getChildAsText(pattern, "groupId");
+                String artifactId = getChildAsText(pattern, "artifactId");
+                String version = getChildAsText(pattern, "version");
+                String type = getChildAsText(pattern, "type");
+                String module = getChildAsText(pattern, "module");
+                String name = getChildAsText(pattern, "name");
+
+                Artifact referenceArtifact = null;
+                if (artifactId != null) {
+                    referenceArtifact = new Artifact(groupId, artifactId, version, type);
                 }
-                String value = getContentsAsText((Element)gbeanNames.item(0));
-                ObjectName objectNamePattern = new ObjectName(value);
-                objectNamePatterns.add(objectNamePattern);
+                Map nameMap = new HashMap();
+                if (module != null) {
+                    nameMap.put("module", module);
+                }
+                if (name != null) {
+                    nameMap.put("name", name);
+                }
+                AbstractNameQuery abstractNameQuery = new AbstractNameQuery(referenceArtifact, nameMap, Collections.EMPTY_SET);
+                objectNamePatterns.add(abstractNameQuery);
             }
 
-            setReferencePatterns(referenceName, objectNamePatterns);
+            setReferencePatterns(referenceName, new ReferencePatterns(objectNamePatterns));
+        }
+    }
+
+    private static String getChildAsText(Element element, String name) throws InvalidGBeanException {
+        NodeList children = element.getElementsByTagName(name);
+        if (children == null || children.getLength() == 0) {
+            return null;
         }
+        if (children.getLength() > 1) {
+            throw new InvalidGBeanException("invalid name, too many parts named: " + name);
+        }
+        return getContentsAsText((Element) children.item(0));
     }
 
     private static String getContentsAsText(Element element) {
@@ -188,15 +217,11 @@
         return references;
     }
 
-    public Set getReferencePatterns(String name) {
-        return (Set) references.get(name);
-    }
-
-    public void setReferencePattern(String name, ObjectName pattern) {
-        setReferencePatterns(name, Collections.singleton(pattern));
+    public ReferencePatterns getReferencePatterns(String name) {
+        return (ReferencePatterns) references.get(name);
     }
 
-    public void setReferencePatterns(String name, Set patterns) {
+    public void setReferencePatterns(String name, ReferencePatterns patterns) {
         references.put(name, patterns);
     }
 
@@ -212,7 +237,7 @@
         if (gbeanInfo != null) {
             out.print(" gbeanInfo=\"" + gbeanInfo + "\"");
         }
-        
+
         if (!load) {
             out.print(" load=\"false\"");
         }
@@ -233,14 +258,35 @@
         for (Iterator iterator = references.entrySet().iterator(); iterator.hasNext();) {
             Map.Entry entry = (Map.Entry) iterator.next();
             String name = (String) entry.getKey();
-            Set patterns = (Set) entry.getValue();
+            ReferencePatterns patterns = (ReferencePatterns) entry.getValue();
 
             out.println("      <reference name=\"" + name + "\">");
-            for (Iterator patternIterator = patterns.iterator(); patternIterator.hasNext();) {
-                ObjectName pattern = (ObjectName) patternIterator.next();
-                out.print("          <pattern><gbean-name>");
-                out.print(pattern.getCanonicalName());
-                out.println("</gbean-name></pattern>");
+            for (Iterator patternIterator = patterns.getPatterns().iterator(); patternIterator.hasNext();) {
+                AbstractNameQuery pattern = (AbstractNameQuery) patternIterator.next();
+                out.println("          <pattern>");
+                List artifacts = pattern.getArtifacts();
+                if (artifacts != null && !artifacts.isEmpty()) {
+                    Artifact artifact = (Artifact) artifacts.get(0);
+                    if (artifact.getGroupId() != null) {
+                        out.println("              <groupId>" + artifact.getGroupId() + "</groupId>");
+                    }
+                    out.println("              <artifactId>" + artifact.getArtifactId() + "</artifactId>");
+                    if (artifact.getVersion() != null) {
+                        out.println("              <version>" + artifact.getVersion() + "</version>");
+                    }
+                    if (artifact.getType() != null) {
+                        out.println("              <type>" + artifact.getType() + "</ype>");
+                    }
+                    Map nameMap = pattern.getName();
+                    if (nameMap.get("module") != null) {
+                        out.println("              <module>" + nameMap.get("module") + "</module>");
+                    }
+                    if (nameMap.get("name") != null) {
+                        out.println("              <name>" + nameMap.get("name") + "</name>");
+                    }
+                }
+                out.print(pattern.toString());
+                out.println("</pattern>");
             }
             out.println("      </reference>");
         }

Modified: geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/configuration/LocalAttributeManager.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/configuration/LocalAttributeManager.java?rev=384141&r1=384140&r2=384141&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/configuration/LocalAttributeManager.java (original)
+++ geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/configuration/LocalAttributeManager.java Tue Mar  7 23:30:08 2006
@@ -19,12 +19,14 @@
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.geronimo.common.propertyeditor.PropertyEditors;
+import org.apache.geronimo.gbean.AbstractName;
 import org.apache.geronimo.gbean.GAttributeInfo;
 import org.apache.geronimo.gbean.GBeanData;
 import org.apache.geronimo.gbean.GBeanInfo;
 import org.apache.geronimo.gbean.GBeanInfoBuilder;
 import org.apache.geronimo.gbean.GBeanLifecycle;
 import org.apache.geronimo.gbean.GReferenceInfo;
+import org.apache.geronimo.gbean.ReferencePatterns;
 import org.apache.geronimo.kernel.config.InvalidConfigException;
 import org.apache.geronimo.kernel.config.ManageableAttributeStore;
 import org.apache.geronimo.kernel.config.PersistentConfigurationList;
@@ -95,7 +97,7 @@
         return readOnly;
     }
 
-    public synchronized Collection setAttributes(Artifact configurationName, Collection gbeanDatas, ClassLoader classLoader) throws InvalidConfigException {
+    public synchronized Collection applyOverrides(Artifact configurationName, Collection gbeanDatas, ClassLoader classLoader) throws InvalidConfigException {
         // clone the datas since we will be modifying this collection
         gbeanDatas = new ArrayList(gbeanDatas);
 
@@ -109,7 +111,7 @@
         Map datasByName = new HashMap();
         for (Iterator iterator = gbeanDatas.iterator(); iterator.hasNext();) {
             GBeanData gbeanData = (GBeanData) iterator.next();
-            datasByName.put(gbeanData.getName(), gbeanData);
+            datasByName.put(gbeanData.getAbstractName(), gbeanData);
         }
 
         // add the new GBeans
@@ -119,13 +121,13 @@
             GBeanOverride gbean = (GBeanOverride) entry.getValue();
             if (!datasByName.containsKey(name) && gbean.getGBeanInfo() != null && gbean.isLoad()) {
                 if (!(name instanceof ObjectName)) {
-                    throw new InvalidConfigException("New GBeans must be specified with a full objectName:" +
+                    throw new InvalidConfigException("New GBeans must be specified with a full abstractName:" +
                             " configuration=" + configName +
                             " gbeanName=" + name);
                 }
-                ObjectName objectName = (ObjectName) name;
                 GBeanInfo gbeanInfo = GBeanInfo.getGBeanInfo(gbean.getGBeanInfo(), classLoader);
-                GBeanData gBeanData = new GBeanData(objectName, gbeanInfo);
+                AbstractName abstractName = new AbstractName(configurationName, ((ObjectName)name).getKeyPropertyList(), gbeanInfo.getInterfaces(), (ObjectName)name);
+                GBeanData gBeanData = new GBeanData(abstractName, gbeanInfo);
                 gbeanDatas.add(gBeanData);
             }
         }
@@ -153,10 +155,10 @@
      *
      */
     private synchronized boolean setAttributes(GBeanData data, ConfigurationOverride configuration, String configName, ClassLoader classLoader) throws InvalidConfigException {
-        ObjectName gbeanName = data.getName();
+        AbstractName gbeanName = data.getAbstractName();
         GBeanOverride gbean = configuration.getGBean(gbeanName);
         if (gbean == null) {
-            gbean = configuration.getGBean(gbeanName.getKeyProperty("name"));
+            gbean = configuration.getGBean((String) gbeanName.getName().get("name"));
         }
 
         if (gbean == null) {
@@ -193,7 +195,7 @@
                 throw new InvalidConfigException("No reference: " + referenceName + " for gbean: " + data.getName());
             }
 
-            Set referencePatterns = (Set) entry.getValue();
+            ReferencePatterns referencePatterns = (ReferencePatterns) entry.getValue();
 
             data.setReferencePatterns(referenceName, referencePatterns);
         }
@@ -201,7 +203,7 @@
     }
 
 
-    private synchronized Object getValue(GAttributeInfo attribute, String value, String configurationName, ObjectName gbeanName, ClassLoader classLoader) {
+    private synchronized Object getValue(GAttributeInfo attribute, String value, String configurationName, AbstractName gbeanName, ClassLoader classLoader) {
         if (value == null) {
             return null;
         }
@@ -221,14 +223,14 @@
         }
     }
 
-    public synchronized void setValue(String configurationName, ObjectName gbeanName, GAttributeInfo attribute, Object value) {
+    public synchronized void setValue(String configurationName, AbstractName gbeanName, GAttributeInfo attribute, Object value) {
         if (readOnly) {
             return;
         }
         ConfigurationOverride configuration = serverOverride.getConfiguration(configurationName, true);
         GBeanOverride gbean = configuration.getGBean(gbeanName);
         if (gbean == null) {
-            gbean = configuration.getGBean(gbeanName.getKeyProperty("name"));
+            gbean = configuration.getGBean((String) gbeanName.getName().get("name"));
             if (gbean == null) {
                 gbean = new GBeanOverride(gbeanName, true);
                 configuration.addGBean(gbeanName, gbean);
@@ -241,15 +243,10 @@
         } catch (InvalidAttributeException e) {
             // attribute can not be represented as a string
             log.error(e.getMessage());
-            return;
         }
     }
 
-    public synchronized void setReferencePattern(String configurationName, ObjectName gbeanName, GReferenceInfo reference, ObjectName pattern) {
-        setReferencePatterns(configurationName, gbeanName, reference, Collections.singleton(pattern));
-    }
-
-    public synchronized void setReferencePatterns(String configurationName, ObjectName gbeanName, GReferenceInfo reference, Set patterns) {
+    public synchronized void setReferencePatterns(String configurationName, AbstractName gbeanName, GReferenceInfo reference, ReferencePatterns patterns) {
         if (readOnly) {
             return;
         }
@@ -257,7 +254,7 @@
         ConfigurationOverride configuration = serverOverride.getConfiguration(configurationName, true);
         GBeanOverride gbean = configuration.getGBean(gbeanName);
         if (gbean == null) {
-            gbean = configuration.getGBean(gbeanName.getKeyProperty("name"));
+            gbean = configuration.getGBean((String)gbeanName.getName().get("name"));
             if (gbean == null) {
                 gbean = new GBeanOverride(gbeanName, true);
                 configuration.addGBean(gbeanName, gbean);
@@ -267,7 +264,7 @@
         attributeChanged();
     }
 
-    public synchronized void setShouldLoad(String configurationName, ObjectName gbeanName, boolean load) {
+    public synchronized void setShouldLoad(String configurationName, AbstractName gbeanName, boolean load) {
         if (readOnly) {
             return;
         }
@@ -276,7 +273,7 @@
         GBeanOverride gbean = configuration.getGBean(gbeanName);
         if (gbean == null) {
             // attempt to lookup by short name
-            gbean = configuration.getGBean(gbeanName.getKeyProperty("name"));
+            gbean = configuration.getGBean((String)gbeanName.getName().get("name"));
         }
 
         if (gbean == null) {
@@ -304,7 +301,6 @@
         } catch (InvalidAttributeException e) {
             // attribute can not be represented as a string
             log.error(e.getMessage());
-            return;
         }
     }
 

Modified: geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/jmx/MBeanServerKernelBridge.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/jmx/MBeanServerKernelBridge.java?rev=384141&r1=384140&r2=384141&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/jmx/MBeanServerKernelBridge.java (original)
+++ geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/jmx/MBeanServerKernelBridge.java Tue Mar  7 23:30:08 2006
@@ -57,11 +57,12 @@
         this.kernel = kernel;
         ArrayList servers = MBeanServerFactory.findMBeanServer(mbeanServerId);
         if (servers.size() == 0) {
-            throw new MBeanServerNotFound("No MBeanServers were found with the agent id " + mbeanServerId);
+            mbeanServer = MBeanServerFactory.createMBeanServer("geronimo");
         } else if (servers.size() > 1) {
             throw new MBeanServerNotFound(servers.size() + " MBeanServers were found with the agent id " + mbeanServerId);
+        } else {
+            mbeanServer = (MBeanServer) servers.get(0);
         }
-        mbeanServer = (MBeanServer) servers.get(0);
 
     }
 

Modified: geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/main/CommandLine.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/main/CommandLine.java?rev=384141&r1=384140&r2=384141&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/main/CommandLine.java (original)
+++ geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/main/CommandLine.java Tue Mar  7 23:30:08 2006
@@ -33,6 +33,7 @@
 import org.apache.geronimo.kernel.config.ConfigurationUtil;
 import org.apache.geronimo.kernel.log.GeronimoLogging;
 import org.apache.geronimo.kernel.repository.Artifact;
+import org.apache.geronimo.gbean.AbstractName;
 
 
 /**
@@ -75,7 +76,7 @@
     }
 
     private Kernel kernel;
-    private ObjectName configurationName;
+    private AbstractName configurationName;
 
     public void invokeMainGBean(List configurations, ObjectName mainGBean, String mainMethod, String[] args) throws Exception {
         startKernel(configurations);

Modified: geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/main/Daemon.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/main/Daemon.java?rev=384141&r1=384140&r2=384141&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/main/Daemon.java (original)
+++ geronimo/branches/1.1/modules/system/src/java/org/apache/geronimo/system/main/Daemon.java Tue Mar  7 23:30:08 2006
@@ -17,22 +17,9 @@
 
 package org.apache.geronimo.system.main;
 
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.PrintStream;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Set;
-import javax.management.MBeanServer;
-import javax.management.MBeanServerFactory;
-import javax.management.ObjectName;
-
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.geronimo.common.GeronimoEnvironment;
-import org.apache.geronimo.gbean.GBeanData;
 import org.apache.geronimo.gbean.GBeanQuery;
 import org.apache.geronimo.kernel.Kernel;
 import org.apache.geronimo.kernel.KernelFactory;
@@ -41,9 +28,18 @@
 import org.apache.geronimo.kernel.config.PersistentConfigurationList;
 import org.apache.geronimo.kernel.log.GeronimoLogging;
 import org.apache.geronimo.kernel.repository.Artifact;
-import org.apache.geronimo.system.jmx.MBeanServerKernelBridge;
 import org.apache.geronimo.system.serverinfo.DirectoryUtils;
 
+import javax.management.ObjectName;
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.PrintStream;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Set;
+
 /**
  * @version $Rev$ $Date$
  */
@@ -231,8 +227,8 @@
             ClassLoader classLoader = Daemon.class.getClassLoader();
 
             // create a mbean server
-            MBeanServer mbeanServer = MBeanServerFactory.createMBeanServer("geronimo");
-            String mbeanServerId = (String) mbeanServer.getAttribute(new ObjectName("JMImplementation:type=MBeanServerDelegate"), "MBeanServerId");
+//            MBeanServer mbeanServer = MBeanServerFactory.createMBeanServer("geronimo");
+//            String mbeanServerId = (String) mbeanServer.getAttribute(new ObjectName("JMImplementation:type=MBeanServerDelegate"), "MBeanServerId");
 
             // create the kernel
             final Kernel kernel = KernelFactory.newInstance().createKernel("geronimo");
@@ -256,11 +252,12 @@
             });
 
             // add the jmx bridge
-            ObjectName mbeanServerKernelBridgeName = new ObjectName("geronimo.boot:role=MBeanServerKernelBridge");
-            GBeanData mbeanServerKernelBridge = new GBeanData(mbeanServerKernelBridgeName, MBeanServerKernelBridge.GBEAN_INFO);
-            mbeanServerKernelBridge.setAttribute("mbeanServerId", mbeanServerId);
-            kernel.loadGBean(mbeanServerKernelBridge, classLoader);
-            kernel.startGBean(mbeanServerKernelBridgeName);
+            //now it's in the plan
+//            ObjectName mbeanServerKernelBridgeName = new ObjectName("geronimo.boot:role=MBeanServerKernelBridge");
+//            GBeanData mbeanServerKernelBridge = new GBeanData(mbeanServerKernelBridgeName, MBeanServerKernelBridge.GBEAN_INFO);
+//            mbeanServerKernelBridge.setAttribute("mbeanServerId", mbeanServerId);
+//            kernel.loadGBean(mbeanServerKernelBridge, classLoader);
+//            kernel.startGBean(mbeanServerKernelBridgeName);
 
             // load this configuration
             InputStream in = classLoader.getResourceAsStream("META-INF/config.ser");

Modified: geronimo/branches/1.1/modules/system/src/test/org/apache/geronimo/system/configuration/LocalAttributeManagerTest.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/system/src/test/org/apache/geronimo/system/configuration/LocalAttributeManagerTest.java?rev=384141&r1=384140&r2=384141&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/system/src/test/org/apache/geronimo/system/configuration/LocalAttributeManagerTest.java (original)
+++ geronimo/branches/1.1/modules/system/src/test/org/apache/geronimo/system/configuration/LocalAttributeManagerTest.java Tue Mar  7 23:30:08 2006
@@ -23,6 +23,8 @@
 import org.apache.geronimo.gbean.GBeanInfoBuilder;
 import org.apache.geronimo.gbean.GReferenceInfo;
 import org.apache.geronimo.gbean.AbstractNameQuery;
+import org.apache.geronimo.gbean.AbstractName;
+import org.apache.geronimo.gbean.ReferencePatterns;
 import org.apache.geronimo.kernel.repository.Artifact;
 import org.apache.geronimo.system.serverinfo.BasicServerInfo;
 
@@ -43,7 +45,7 @@
 
     private LocalAttributeManager localAttributeManager;
     private Artifact configurationName;
-    private ObjectName gbeanName;
+    private AbstractName gbeanName;
     private GAttributeInfo attributeInfo;
     private GReferenceInfo referenceInfo;
 
@@ -54,7 +56,7 @@
         originalDatas.add(gbeanData);
 
         Set newDatas;
-        newDatas = new HashSet(localAttributeManager.setAttributes(configurationName, originalDatas, getClass().getClassLoader()));
+        newDatas = new HashSet(localAttributeManager.applyOverrides(configurationName, originalDatas, getClass().getClassLoader()));
         assertEquals(1, newDatas.size());
         assertEquals(originalDatas, newDatas);
 
@@ -64,7 +66,7 @@
         localAttributeManager.setValue(configurationName.toString(), gbeanName, attributeInfo, attributeValue);
 
         // should still load
-        newDatas = new HashSet(localAttributeManager.setAttributes(configurationName, originalDatas, getClass().getClassLoader()));
+        newDatas = new HashSet(localAttributeManager.applyOverrides(configurationName, originalDatas, getClass().getClassLoader()));
         assertEquals(1, newDatas.size());
         assertEquals(originalDatas, newDatas);
 
@@ -72,13 +74,14 @@
         localAttributeManager.removeConfiguration(configurationName.toString());
 
         // should still get the same gbeans, config list and gbean attribute override functions are separate interfaces.
-        newDatas = new HashSet(localAttributeManager.setAttributes(configurationName, originalDatas, getClass().getClassLoader()));
+        newDatas = new HashSet(localAttributeManager.applyOverrides(configurationName, originalDatas, getClass().getClassLoader()));
         assertEquals(1, newDatas.size());
         assertEquals(originalDatas, newDatas);
     }
 
     public void testGBeanShouldLoad() throws Exception {
-        ObjectName gbeanName2 = ObjectName.getInstance(":name=gbean2");
+        ObjectName objectName = ObjectName.getInstance(":name=gbean2");
+        AbstractName gbeanName2 = new AbstractName(configurationName, objectName.getKeyPropertyList(), LocalAttributeManagerTest.class.getName(), objectName);
 
         // should load by default
         Set originalDatas = new HashSet();
@@ -88,7 +91,7 @@
         originalDatas.add(gbeanData2);
 
         Set newDatas;
-        newDatas = new HashSet(localAttributeManager.setAttributes(configurationName, originalDatas, getClass().getClassLoader()));
+        newDatas = new HashSet(localAttributeManager.applyOverrides(configurationName, originalDatas, getClass().getClassLoader()));
         assertEquals(2, newDatas.size());
         assertEquals(originalDatas, newDatas);
 
@@ -98,7 +101,7 @@
         localAttributeManager.setValue(configurationName.toString(), gbeanName, attributeInfo, attributeValue);
 
         // should still load
-        newDatas = new HashSet(localAttributeManager.setAttributes(configurationName, originalDatas, getClass().getClassLoader()));
+        newDatas = new HashSet(localAttributeManager.applyOverrides(configurationName, originalDatas, getClass().getClassLoader()));
         assertEquals(2, newDatas.size());
         assertEquals(originalDatas, newDatas);
 
@@ -106,7 +109,7 @@
         localAttributeManager.setShouldLoad(configurationName.toString(), gbeanName, false);
 
         // should not load
-        newDatas = new HashSet(localAttributeManager.setAttributes(configurationName, originalDatas, getClass().getClassLoader()));
+        newDatas = new HashSet(localAttributeManager.applyOverrides(configurationName, originalDatas, getClass().getClassLoader()));
         assertEquals(1, newDatas.size());
         GBeanData newGBeanData = (GBeanData) newDatas.iterator().next();
         assertSame(gbeanData2, newGBeanData);
@@ -119,29 +122,31 @@
         Collection gbeanDatas = new ArrayList();
         GBeanData gbeanData = new GBeanData(gbeanName, GBEAN_INFO);
         gbeanDatas.add(gbeanData);
-        gbeanDatas = localAttributeManager.setAttributes(configurationName, gbeanDatas, getClass().getClassLoader());
+        gbeanDatas = localAttributeManager.applyOverrides(configurationName, gbeanDatas, getClass().getClassLoader());
         assertEquals(attributeValue, gbeanData.getAttribute(attributeInfo.getName()));
     }
 
     public void testSetReference() throws Exception {
-        ObjectName referencePattern = new ObjectName(":name=referencePattern,*");
-        localAttributeManager.setReferencePattern(configurationName.toString(), gbeanName, referenceInfo, referencePattern);
+        ObjectName referencePatternObjectName = new ObjectName(":name=referencePattern");
+        AbstractName referencePattern = new AbstractName(configurationName, referencePatternObjectName.getKeyPropertyList(), Collections.EMPTY_SET, referencePatternObjectName);
+        ReferencePatterns referencePatterns = new ReferencePatterns(referencePattern);
+        localAttributeManager.setReferencePatterns(configurationName.toString(), gbeanName, referenceInfo, referencePatterns);
         Collection gbeanDatas = new ArrayList();
         GBeanData gbeanData = new GBeanData(gbeanName, GBEAN_INFO);
         gbeanDatas.add(gbeanData);
-        gbeanDatas = localAttributeManager.setAttributes(configurationName, gbeanDatas, getClass().getClassLoader());
-        assertEquals(Collections.singleton(referencePattern), gbeanData.getReferencePatterns(referenceInfo.getName()));
+        gbeanDatas = localAttributeManager.applyOverrides(configurationName, gbeanDatas, getClass().getClassLoader());
+        assertEquals(referencePatterns, gbeanData.getReferencePatterns(referenceInfo.getName()));
     }
 
     public void testSetReferences() throws Exception {
         ObjectName referencePattern1 = new ObjectName(":name=referencePattern1,*");
         ObjectName referencePattern2 = new ObjectName(":name=referencePattern2,*");
-        Set referencePatterns = new LinkedHashSet(Arrays.asList(new ObjectName[] {referencePattern1, referencePattern2}));
+        ReferencePatterns referencePatterns = new ReferencePatterns(new LinkedHashSet(Arrays.asList(new ObjectName[] {referencePattern1, referencePattern2})));
         localAttributeManager.setReferencePatterns(configurationName.toString(), gbeanName, referenceInfo, referencePatterns);
         Collection gbeanDatas = new ArrayList();
         GBeanData gbeanData = new GBeanData(gbeanName, GBEAN_INFO);
         gbeanDatas.add(gbeanData);
-        gbeanDatas = localAttributeManager.setAttributes(configurationName, gbeanDatas, getClass().getClassLoader());
+        gbeanDatas = localAttributeManager.applyOverrides(configurationName, gbeanDatas, getClass().getClassLoader());
         assertEquals(referencePatterns, gbeanData.getReferencePatterns(referenceInfo.getName()));
     }
 
@@ -157,14 +162,14 @@
 
 
         Collection gbeanDatas = new ArrayList();
-        gbeanDatas = localAttributeManager.setAttributes(configurationName, gbeanDatas, getClass().getClassLoader());
+        gbeanDatas = localAttributeManager.applyOverrides(configurationName, gbeanDatas, getClass().getClassLoader());
         assertEquals(1, gbeanDatas.size());
         GBeanData newGBeanData = (GBeanData) gbeanDatas.iterator().next();
 
         assertNotSame(gbeanData, newGBeanData);
         assertSame(gbeanData.getGBeanInfo(), newGBeanData.getGBeanInfo());
         assertSame(gbeanData.getName(), newGBeanData.getName());
-        assertEquals(Collections.singleton(referencePattern), newGBeanData.getReferencePatterns(referenceInfo.getName()));
+        assertEquals(Collections.singleton(referencePattern), newGBeanData.getReferencePatterns(referenceInfo.getName()).getPatterns());
         assertEquals(attributeValue, newGBeanData.getAttribute(attributeInfo.getName()));
     }
 
@@ -172,7 +177,8 @@
         super.setUp();
         localAttributeManager = new LocalAttributeManager("target/test-config.xml", false, new BasicServerInfo(basedir));
         configurationName = Artifact.create("configuration/name/1/car");
-        gbeanName = ObjectName.getInstance(":name=gbean");
+        ObjectName objectName = ObjectName.getInstance(":name=gbean");
+        gbeanName = new AbstractName(configurationName, objectName.getKeyPropertyList(), LocalAttributeManagerTest.class.getName(), objectName);
         attributeInfo = GBEAN_INFO.getAttribute("attribute");
         referenceInfo = GBEAN_INFO.getReference("reference");
     }

Modified: geronimo/branches/1.1/modules/system/src/test/org/apache/geronimo/system/configuration/ServerOverrideTest.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/modules/system/src/test/org/apache/geronimo/system/configuration/ServerOverrideTest.java?rev=384141&r1=384140&r2=384141&view=diff
==============================================================================
--- geronimo/branches/1.1/modules/system/src/test/org/apache/geronimo/system/configuration/ServerOverrideTest.java (original)
+++ geronimo/branches/1.1/modules/system/src/test/org/apache/geronimo/system/configuration/ServerOverrideTest.java Tue Mar  7 23:30:08 2006
@@ -17,9 +17,12 @@
 package org.apache.geronimo.system.configuration;
 
 import junit.framework.TestCase;
+import org.apache.geronimo.gbean.AbstractNameQuery;
+import org.apache.geronimo.gbean.ReferencePatterns;
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
 
+import javax.management.MalformedObjectNameException;
 import javax.management.ObjectName;
 import javax.xml.parsers.DocumentBuilderFactory;
 import java.io.ByteArrayInputStream;
@@ -47,12 +50,14 @@
         pizza.setAttribute("cheese", "mozzarella");
         assertEquals("mozzarella", pizza.getAttribute("cheese"));
 
-        ObjectName pizzaOvenPattern = new ObjectName(":name=PizzaOven,j2eeType=oven,*");
-        pizza.setReferencePattern("oven", pizzaOvenPattern);
-        assertEquals(Collections.singleton(pizzaOvenPattern), pizza.getReferencePatterns("oven"));
-
-        ObjectName toasterOvenPattern = new ObjectName(":name=ToasterOven,j2eeType=oven,*");
-        Set ovenPatterns = new LinkedHashSet(Arrays.asList(new ObjectName[] {pizzaOvenPattern, toasterOvenPattern}));
+        AbstractNameQuery pizzaOvenQuery = getAbstractNameQuery(":name=PizzaOven,j2eeType=oven");
+        ReferencePatterns pizzaOvenPatterns = new ReferencePatterns(Collections.singleton(pizzaOvenQuery));
+        pizza.setReferencePatterns("oven", pizzaOvenPatterns);
+        assertEquals(pizzaOvenPatterns, pizza.getReferencePatterns("oven"));
+
+        AbstractNameQuery toasterOvenQuery = getAbstractNameQuery(":name=ToasterOven,j2eeType=oven,*");
+        AbstractNameQuery[] queries = new AbstractNameQuery[]{pizzaOvenQuery, toasterOvenQuery};
+        ReferencePatterns ovenPatterns = getReferencePatterns(queries);
         pizza.setReferencePatterns("oven", ovenPatterns);
         assertEquals(ovenPatterns, pizza.getReferencePatterns("oven"));
 
@@ -70,6 +75,16 @@
         assertSame(dinnerMenu, restaurant.getConfiguration("Dinner Menu"));
     }
 
+    private ReferencePatterns getReferencePatterns(AbstractNameQuery[] queries) {
+        Set querySet = new LinkedHashSet(Arrays.asList(queries));
+        return new ReferencePatterns(querySet);
+    }
+
+    private AbstractNameQuery getAbstractNameQuery(String pizzaOvenString) throws MalformedObjectNameException {
+        ObjectName pizzaOvenPattern = new ObjectName(pizzaOvenString);
+        return new AbstractNameQuery(Collections.EMPTY_LIST, pizzaOvenPattern.getKeyPropertyList(), Collections.EMPTY_SET);
+    }
+
     public void testGBeanXml() throws Exception {
         GBeanOverride pizza = new GBeanOverride("Pizza", true);
         assertCopyIdentical(pizza);
@@ -83,12 +98,14 @@
         pizza.setAttribute("size", "x-large");
         assertCopyIdentical(pizza);
 
-        ObjectName pizzaOvenPattern = new ObjectName(":name=PizzaOven,j2eeType=oven,*");
-        pizza.setReferencePattern("oven", pizzaOvenPattern);
+        AbstractNameQuery pizzaOvenQuery = getAbstractNameQuery(":name=PizzaOven,j2eeType=oven");
+        ReferencePatterns pizzaOvenPatterns = new ReferencePatterns(Collections.singleton(pizzaOvenQuery));
+        pizza.setReferencePatterns("oven", pizzaOvenPatterns);
         assertCopyIdentical(pizza);
 
-        ObjectName toasterOvenPattern = new ObjectName(":name=ToasterOven,j2eeType=oven,*");
-        Set ovenPatterns = new LinkedHashSet(Arrays.asList(new ObjectName[] {pizzaOvenPattern, toasterOvenPattern}));
+        AbstractNameQuery toasterOvenQuery = getAbstractNameQuery(":name=ToasterOven,j2eeType=oven,*");
+        AbstractNameQuery[] queries = new AbstractNameQuery[]{pizzaOvenQuery, toasterOvenQuery};
+        ReferencePatterns ovenPatterns = getReferencePatterns(queries);
         pizza.setReferencePatterns("oven", ovenPatterns);
         assertCopyIdentical(pizza);
     }
@@ -103,16 +120,19 @@
         GBeanOverride pizza = new GBeanOverride("Pizza", false);
         pizza.setAttribute("cheese", "mozzarella");
         pizza.setAttribute("size", "x-large");
-        ObjectName pizzaOvenPattern = new ObjectName(":name=PizzaOven,j2eeType=oven,*");
-        ObjectName toasterOvenPattern = new ObjectName(":name=ToasterOven,j2eeType=oven,*");
-        pizza.setReferencePatterns("oven", new LinkedHashSet(Arrays.asList(new ObjectName[] {pizzaOvenPattern, toasterOvenPattern})));
-        assertCopyIdentical(dinnerMenu);
+        AbstractNameQuery pizzaOvenQuery = getAbstractNameQuery(":name=PizzaOven,j2eeType=oven");
+        AbstractNameQuery toasterOvenQuery = getAbstractNameQuery(":name=ToasterOven,j2eeType=oven,*");
+        AbstractNameQuery[] queries = new AbstractNameQuery[]{pizzaOvenQuery, toasterOvenQuery};
+        ReferencePatterns ovenPatterns = getReferencePatterns(queries);
+        pizza.setReferencePatterns("oven", ovenPatterns);
+         assertCopyIdentical(dinnerMenu);
 
         dinnerMenu.addGBean(pizza);
         assertCopyIdentical(dinnerMenu);
 
         GBeanOverride garlicCheeseBread = new GBeanOverride("Garlic Cheese Bread", true);
-        garlicCheeseBread.setReferencePattern("oven", toasterOvenPattern);
+        ReferencePatterns toasterOvenPatterns = new ReferencePatterns(Collections.singleton(toasterOvenQuery));
+        garlicCheeseBread.setReferencePatterns("oven", toasterOvenPatterns);
         dinnerMenu.addGBean(garlicCheeseBread);
         assertCopyIdentical(dinnerMenu);
     }
@@ -126,31 +146,34 @@
         GBeanOverride pizza = new GBeanOverride("Pizza", false);
         pizza.setAttribute("cheese", "mozzarella");
         pizza.setAttribute("size", "x-large");
-        ObjectName pizzaOvenPattern = new ObjectName(":name=PizzaOven,j2eeType=oven,*");
-        ObjectName toasterOvenPattern = new ObjectName(":name=ToasterOven,j2eeType=oven,*");
-        pizza.setReferencePatterns("oven", new LinkedHashSet(Arrays.asList(new ObjectName[] {pizzaOvenPattern, toasterOvenPattern})));
+        AbstractNameQuery pizzaOvenQuery = getAbstractNameQuery(":name=PizzaOven,j2eeType=oven");
+        AbstractNameQuery toasterOvenQuery = getAbstractNameQuery(":name=ToasterOven,j2eeType=oven,*");
+        AbstractNameQuery[] queries = new AbstractNameQuery[]{pizzaOvenQuery, toasterOvenQuery};
+        ReferencePatterns ovenPatterns = getReferencePatterns(queries);
+        pizza.setReferencePatterns("oven", ovenPatterns);
         dinnerMenu.addGBean(pizza);
         GBeanOverride garlicCheeseBread = new GBeanOverride("Garlic Cheese Bread", true);
-        garlicCheeseBread.setReferencePattern("oven", toasterOvenPattern);
+        ReferencePatterns toasterOvenPatterns = new ReferencePatterns(Collections.singleton(toasterOvenQuery));
+        garlicCheeseBread.setReferencePatterns("oven", toasterOvenPatterns);
         dinnerMenu.addGBean(garlicCheeseBread);
         assertCopyIdentical(restaurant);
 
         ConfigurationOverride drinkMenu = new ConfigurationOverride("Drink Menu", false);
         restaurant.addConfiguration(drinkMenu);
         GBeanOverride beer = new GBeanOverride("Beer", true);
-        pizza.setReferencePatterns("glass", new LinkedHashSet(Arrays.asList(new ObjectName[] {
-            new ObjectName(":name=PintGlass"),
-            new ObjectName(":name=BeerStein"),
-            new ObjectName(":name=BeerBottle"),
-            new ObjectName(":name=BeerCan")
-        })));
+        pizza.setReferencePatterns("glass", getReferencePatterns(new AbstractNameQuery[] {
+            getAbstractNameQuery(":name=PintGlass"),
+            getAbstractNameQuery(":name=BeerStein"),
+            getAbstractNameQuery(":name=BeerBottle"),
+            getAbstractNameQuery(":name=BeerCan")
+        }));
         drinkMenu.addGBean(beer);
         GBeanOverride wine = new GBeanOverride("Wine", true);
-        wine.setReferencePatterns("glass", new LinkedHashSet(Arrays.asList(new ObjectName[] {
-            new ObjectName(":name=WineGlass"),
-            new ObjectName(":name=WineBottle"),
-            new ObjectName(":name=BoxWine")
-        })));
+        wine.setReferencePatterns("glass", getReferencePatterns(new AbstractNameQuery[] {
+            getAbstractNameQuery(":name=WineGlass"),
+            getAbstractNameQuery(":name=WineBottle"),
+            getAbstractNameQuery(":name=BoxWine")
+        }));
         drinkMenu.addGBean(wine);
         assertCopyIdentical(restaurant);
     }
@@ -225,8 +248,7 @@
         System.out.println(new String(out.toByteArray()));
         ByteArrayInputStream in = new ByteArrayInputStream(out.toByteArray());
         Element element = parseXml(in);
-        ServerOverride copy = new ServerOverride(element);
-        return copy;
+        return new ServerOverride(element);
     }
 
     private ConfigurationOverride copy(ConfigurationOverride configuration) throws Exception {
@@ -237,8 +259,7 @@
         System.out.println(new String(out.toByteArray()));
         ByteArrayInputStream in = new ByteArrayInputStream(out.toByteArray());
         Element element = parseXml(in);
-        ConfigurationOverride copy = new ConfigurationOverride(element);
-        return copy;
+        return new ConfigurationOverride(element);
     }
 
     private GBeanOverride copy(GBeanOverride gbean) throws Exception {
@@ -249,8 +270,7 @@
         System.out.println(new String(out.toByteArray()));
         ByteArrayInputStream in = new ByteArrayInputStream(out.toByteArray());
         Element element = parseXml(in);
-        GBeanOverride copy = new GBeanOverride(element);
-        return copy;
+        return new GBeanOverride(element);
     }
 
     private Element parseXml(InputStream in) throws Exception {

Modified: geronimo/branches/1.1/plugins/geronimo-packaging-plugin/src/java/org/apache/geronimo/plugin/packaging/MavenAttributeStore.java
URL: http://svn.apache.org/viewcvs/geronimo/branches/1.1/plugins/geronimo-packaging-plugin/src/java/org/apache/geronimo/plugin/packaging/MavenAttributeStore.java?rev=384141&r1=384140&r2=384141&view=diff
==============================================================================
--- geronimo/branches/1.1/plugins/geronimo-packaging-plugin/src/java/org/apache/geronimo/plugin/packaging/MavenAttributeStore.java (original)
+++ geronimo/branches/1.1/plugins/geronimo-packaging-plugin/src/java/org/apache/geronimo/plugin/packaging/MavenAttributeStore.java Tue Mar  7 23:30:08 2006
@@ -36,7 +36,7 @@
     public MavenAttributeStore() {
     }
 
-    public Collection setAttributes(Artifact configurationName, Collection datas, ClassLoader classLoader) {
+    public Collection applyOverrides(Artifact configurationName, Collection datas, ClassLoader classLoader) {
         return datas;
     }
 



Mime
View raw message