geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ga...@apache.org
Subject svn commit: r809012 - /geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/container/ServiceRecipe.java
Date Fri, 28 Aug 2009 20:09:25 GMT
Author: gawor
Date: Fri Aug 28 20:09:25 2009
New Revision: 809012

URL: http://svn.apache.org/viewvc?rev=809012&view=rev
Log:
more synchronization fixes

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=809012&r1=809011&r2=809012&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 Aug 28 20:09:25 2009
@@ -161,8 +161,8 @@
             LOGGER.debug("Registering service {} with interfaces {} and properties {}",
                          new Object[] { name, classes, props });
 
-            registration = blueprintContainer.registerService(classArray, new TriggerServiceFactory(),
props);
             registrationProperties = props;
+            registration = blueprintContainer.registerService(classArray, new TriggerServiceFactory(),
props);            
         }
     }
 
@@ -298,6 +298,13 @@
     }
 
     public synchronized Object getService(Bundle bundle, ServiceRegistration registration)
{
+        /** getService() can get called before registerService() returns with the registration
object.
+         *  So we need to set the registration object in case registration listeners call

+         *  getServiceReference(). 
+         */
+        if (this.registration == null) {
+            this.registration = registration;
+        }
         return internalGetService(bundle, registration);
     }
 



Mime
View raw message