geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gno...@apache.org
Subject svn commit: r784007 - /geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/container/ServiceRecipe.java
Date Fri, 12 Jun 2009 06:46:43 GMT
Author: gnodet
Date: Fri Jun 12 06:46:43 2009
New Revision: 784007

URL: http://svn.apache.org/viewvc?rev=784007&view=rev
Log:
Rename createSimpleRecipe to createRecipe

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

Modified: geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/container/ServiceRecipe.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/container/ServiceRecipe.java?rev=784007&r1=784006&r2=784007&view=diff
==============================================================================
--- geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/container/ServiceRecipe.java
(original)
+++ geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/container/ServiceRecipe.java
Fri Jun 12 06:46:43 2009
@@ -90,6 +90,7 @@
         this.listenersRecipe = listenersRecipe;
         this.propertiesRecipe = propertiesRecipe;
         this.explicitDependencies = explicitDependencies;
+        this.prototypeService = isPrototypeService(metadata.getServiceComponent());
     }
 
     @Override
@@ -127,7 +128,7 @@
             registered = true;
             Hashtable props = new Hashtable();
             if (properties == null) {
-                properties = (Map) createSimpleRecipe(propertiesRecipe);
+                properties = (Map) createRecipe(propertiesRecipe);
             }
             props.putAll(properties);
             props.put(Constants.SERVICE_RANKING, metadata.getRanking());
@@ -204,7 +205,6 @@
         // Create initial service
         if (this.service == null) {
             try {
-                prototypeService = isPrototypeService(metadata.getServiceComponent());
                 LOGGER.debug("Creating service instance");
                 this.service = createInstance();
                 LOGGER.debug("Service created: {}", this.service);
@@ -212,7 +212,7 @@
                 if (listeners == null) {
                     LOGGER.debug("Creating listeners");
                     if (listenersRecipe != null) {
-                        listeners = (List) createSimpleRecipe(listenersRecipe);
+                        listeners = (List) createRecipe(listenersRecipe);
                     } else {
                         listeners = Collections.emptyList();
                     }
@@ -232,6 +232,7 @@
         if (service instanceof ServiceFactory) {
             service = ((ServiceFactory) service).getService(bundle, registration);
         } else {
+            // TODO: this looks a bit wrong, as we will create two instances for a prototype
for the first bundle
             service = createInstance();
             LOGGER.debug("Created service instance for bundle: " + bundle + " " + service.hashCode());
         }
@@ -272,10 +273,10 @@
     }
 
     private Object createInstance() {
-        return createSimpleRecipe(serviceRecipe);
+        return createRecipe(serviceRecipe);
     }
 
-    private Object createSimpleRecipe(Recipe recipe) {
+    private Object createRecipe(Recipe recipe) {
         String name = recipe.getName();
         Repository repo = blueprintContainer.getRepository();
         if (repo.getRecipe(name) != recipe) {



Mime
View raw message