geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r481464 - /geronimo/server/trunk/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/Configuration.java
Date Sat, 02 Dec 2006 00:53:01 GMT
Author: djencks
Date: Fri Dec  1 16:53:00 2006
New Revision: 481464

URL: http://svn.apache.org/viewvc?view=rev&rev=481464
Log:
GERONIMO-2611 Remove duplicates from allServiceParents

Modified:
    geronimo/server/trunk/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/Configuration.java

Modified: geronimo/server/trunk/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/Configuration.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/Configuration.java?view=diff&rev=481464&r1=481463&r2=481464
==============================================================================
--- geronimo/server/trunk/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/Configuration.java
(original)
+++ geronimo/server/trunk/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/config/Configuration.java
Fri Dec  1 16:53:00 2006
@@ -31,6 +31,7 @@
 import java.util.ListIterator;
 import java.util.Map;
 import java.util.Set;
+import java.util.HashSet;
 
 import javax.management.MalformedObjectNameException;
 import javax.management.ObjectName;
@@ -269,7 +270,8 @@
             //
             // Get all service parents in depth first order
             //
-            addDepthFirstServiceParents(this, allServiceParents);
+
+            addDepthFirstServiceParents(this, allServiceParents, new HashSet());
 
             //
             // Deserialize the GBeans in the configurationData
@@ -382,11 +384,14 @@
         }
     }
 
-    private void addDepthFirstServiceParents(Configuration configuration, List ancestors)
{
-        ancestors.add(configuration);
-        for (Iterator parents = configuration.getServiceParents().iterator(); parents.hasNext();)
{
-            Configuration parent = (Configuration) parents.next();
-            addDepthFirstServiceParents(parent, ancestors);
+    private void addDepthFirstServiceParents(Configuration configuration, List ancestors,
Set ids) {
+        if (!ids.contains(configuration.getId())) {
+            ancestors.add(configuration);
+            ids.add(configuration.getId());
+            for (Iterator parents = configuration.getServiceParents().iterator(); parents.hasNext();)
{
+                Configuration parent = (Configuration) parents.next();
+                addDepthFirstServiceParents(parent, ancestors, ids);
+            }
         }
     }
 
@@ -708,6 +713,13 @@
         return datas;
     }
 
+    /**
+     * Find the gbeanDatas matching the patterns in this configuration only, ignoring parents.
+     *
+     * @param configuration
+     * @param patterns
+     * @return set of gbeandatas matching one of the patterns from this configuration only,
not including parents.
+     */
     private LinkedHashSet findGBeanDatas(Configuration configuration, Set patterns) {
         LinkedHashSet result = new LinkedHashSet();
 



Mime
View raw message