aries-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r1528973 - /aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintContainerImpl.java
Date Thu, 03 Oct 2013 19:03:33 GMT
Author: dkulp
Date: Thu Oct  3 19:03:33 2013
New Revision: 1528973

URL: http://svn.apache.org/r1528973
Log:
[ARIES-1120] Make sure the getComponentIds is relatively consistent with the actual registry

Modified:
    aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintContainerImpl.java

Modified: aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintContainerImpl.java
URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintContainerImpl.java?rev=1528973&r1=1528972&r2=1528973&view=diff
==============================================================================
--- aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintContainerImpl.java
(original)
+++ aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/BlueprintContainerImpl.java
Thu Oct  3 19:03:33 2013
@@ -239,7 +239,7 @@ public class BlueprintContainerImpl 
                 return;
             }
             tidyupComponents();
-            this.componentDefinitionRegistry.reset();
+            resetComponentDefinitionRegistry();
             this.repository = null;
             this.processors = new ArrayList<Processor>();
             timeout = 5 * 60 * 1000;
@@ -254,6 +254,14 @@ public class BlueprintContainerImpl 
             schedule();
         }
     }
+    
+    private void resetComponentDefinitionRegistry() {
+        this.componentDefinitionRegistry.reset();
+        componentDefinitionRegistry.registerComponentDefinition(new PassThroughMetadataImpl("blueprintContainer",
this));
+        componentDefinitionRegistry.registerComponentDefinition(new PassThroughMetadataImpl("blueprintBundle",
bundle));
+        componentDefinitionRegistry.registerComponentDefinition(new PassThroughMetadataImpl("blueprintBundleContext",
bundleContext));
+        componentDefinitionRegistry.registerComponentDefinition(new PassThroughMetadataImpl("blueprintConverter",
converter));
+    }
 
     public void run() {
         scheduled.set(false);
@@ -308,11 +316,7 @@ public class BlueprintContainerImpl 
                             eventDispatcher.blueprintEvent(new BlueprintEvent(BlueprintEvent.GRACE_PERIOD,
getBundle(), getExtenderBundle(), missing.toArray(new String[missing.size()])));
                             return;
                         }
-                        componentDefinitionRegistry.reset();
-                        componentDefinitionRegistry.registerComponentDefinition(new PassThroughMetadataImpl("blueprintContainer",
this));
-                        componentDefinitionRegistry.registerComponentDefinition(new PassThroughMetadataImpl("blueprintBundle",
bundle));
-                        componentDefinitionRegistry.registerComponentDefinition(new PassThroughMetadataImpl("blueprintBundleContext",
bundleContext));
-                        componentDefinitionRegistry.registerComponentDefinition(new PassThroughMetadataImpl("blueprintConverter",
converter));
+                        resetComponentDefinitionRegistry();
                         if (xmlValidation) {
                             parser.validate(handlerSet.getSchema());
                         }
@@ -737,13 +741,7 @@ public class BlueprintContainerImpl 
     }
     
     public Set<String> getComponentIds() {
-        Set<String> set = new LinkedHashSet<String>();
-        set.addAll(componentDefinitionRegistry.getComponentDefinitionNames());
-        set.add("blueprintContainer");
-        set.add("blueprintBundle");
-        set.add("blueprintBundleContext");
-        set.add("blueprintConverter");
-        return set;
+        return new LinkedHashSet<String>(componentDefinitionRegistry.getComponentDefinitionNames());
     }
     
     public Object getComponentInstance(String id) throws NoSuchComponentException {
@@ -902,7 +900,7 @@ public class BlueprintContainerImpl 
                     return;
                 }
                 tidyupComponents();
-                this.componentDefinitionRegistry.reset();
+                resetComponentDefinitionRegistry();
                 this.repository = null;
                 state = State.WaitForNamespaceHandlers;
                 schedule();



Mime
View raw message