geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gno...@apache.org
Subject svn commit: r780890 - /geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/container/BlueprintContainerImpl.java
Date Mon, 01 Jun 2009 23:59:42 GMT
Author: gnodet
Date: Mon Jun  1 23:59:42 2009
New Revision: 780890

URL: http://svn.apache.org/viewvc?rev=780890&view=rev
Log:
Update repository between each processor to allow processors to interact with each other,
when the singletons are instanciated also create service references that have listeners

Modified:
    geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/container/BlueprintContainerImpl.java

Modified: geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/container/BlueprintContainerImpl.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/container/BlueprintContainerImpl.java?rev=780890&r1=780889&r2=780890&view=diff
==============================================================================
--- geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/container/BlueprintContainerImpl.java
(original)
+++ geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/container/BlueprintContainerImpl.java
Mon Jun  1 23:59:42 2009
@@ -77,6 +77,7 @@
 import org.osgi.service.blueprint.reflect.ServiceMetadata;
 import org.osgi.service.blueprint.reflect.ServiceReferenceMetadata;
 import org.osgi.service.blueprint.reflect.Target;
+import org.osgi.service.blueprint.reflect.ReferenceMetadata;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -267,17 +268,6 @@
                     case InitialReferencesSatisfied:
                         processTypeConverters();
                         processProcessors();
-                        // Update repository with recipes processed by the processors
-                        untrackServiceReferences();
-                        Repository repository = instantiator.getRepository();
-                        Repository tmpRepo = new RecipeBuilder(this).createRepository();
-                        for (String name : tmpRepo.getNames()) {
-                            if (repository.getInstance(name) == null) {
-                                repository.putRecipe(name, tmpRepo.getRecipe(name));
-                            }
-                        }
-                        satisfiables = null;
-                        trackServiceReferences();
                         // Check references
                         if (!waitForDependencies) {
                             state = State.Create;
@@ -366,6 +356,17 @@
             if (ComponentDefinitionRegistryProcessor.class.isAssignableFrom(clazz)) {
                 Object obj = instantiator.create(bean.getId());
                 ((ComponentDefinitionRegistryProcessor) obj).process(componentDefinitionRegistry);
+                // Update repository with recipes processed by the processors
+                untrackServiceReferences();
+                Repository repository = instantiator.getRepository();
+                Repository tmpRepo = new RecipeBuilder(this).createRepository();
+                for (String name : tmpRepo.getNames()) {
+                    if (repository.getInstance(name) == null) {
+                        repository.putRecipe(name, tmpRepo.getRecipe(name));
+                    }
+                }
+                satisfiables = null;
+                trackServiceReferences();
             } else if (Processor.class.isAssignableFrom(clazz)) {
                 Object obj = instantiator.create(bean.getId());
                 this.processors.add((Processor) obj);
@@ -471,8 +472,10 @@
                 if (local.getInitialization() == BeanMetadata.INITIALIZATION_EAGER &&
BeanMetadata.SCOPE_SINGLETON.equals(scope)) {
                     components.add(name);
                 }
-            } else {
-                if (component instanceof ServiceMetadata) {
+            } else if (component instanceof ServiceMetadata) {
+                components.add(name);
+            } else if (component instanceof ServiceReferenceMetadata) {
+                if (!((ServiceReferenceMetadata) component).getServiceListeners().isEmpty())
{
                     components.add(name);
                 }
             }



Mime
View raw message