geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ga...@apache.org
Subject svn commit: r776083 - /geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/context/CollectionBasedServiceReferenceRecipe.java
Date Mon, 18 May 2009 20:31:28 GMT
Author: gawor
Date: Mon May 18 20:31:28 2009
New Revision: 776083

URL: http://svn.apache.org/viewvc?rev=776083&view=rev
Log:
return proxy in getMember() and throw ServiceUnavailableException in loadObject()

Modified:
    geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/context/CollectionBasedServiceReferenceRecipe.java

Modified: geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/context/CollectionBasedServiceReferenceRecipe.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/context/CollectionBasedServiceReferenceRecipe.java?rev=776083&r1=776082&r2=776083&view=diff
==============================================================================
--- geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/context/CollectionBasedServiceReferenceRecipe.java
(original)
+++ geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/context/CollectionBasedServiceReferenceRecipe.java
Mon May 18 20:31:28 2009
@@ -41,12 +41,12 @@
 import org.apache.geronimo.blueprint.utils.DynamicSortedList;
 import org.apache.geronimo.blueprint.utils.DynamicSortedSet;
 import org.apache.xbean.recipe.ConstructionException;
-import org.apache.xbean.recipe.ExecutionContext;
 import org.apache.xbean.recipe.Recipe;
 import org.apache.xbean.recipe.RecipeHelper;
 import org.osgi.framework.Constants;
 import org.osgi.framework.ServiceReference;
 import org.osgi.service.blueprint.context.BlueprintContext;
+import org.osgi.service.blueprint.context.ServiceUnavailableException;
 import org.osgi.service.blueprint.reflect.RefCollectionMetadata;
 
 /**
@@ -202,14 +202,11 @@
             this.memberReference = memberReference;
         }
 
-        public synchronized Object getMember() {
+        public Object getMember() {
             if (memberReference) {
                 return reference;
             } else {
-                if (service == null && reference != null) {
-                    service = reference.getBundle().getBundleContext().getService(reference);
-                }
-                return service;
+                return proxy;
             }
         }
         
@@ -224,7 +221,7 @@
 
         public synchronized Object loadObject() throws Exception {
             if (reference == null) {
-                throw new ServiceUnregisteredException();
+                throw new ServiceUnavailableException("Service is unavailable", null, null);
             }
             if (service == null) {
                 service = reference.getBundle().getBundleContext().getService(reference);



Mime
View raw message