You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by ga...@apache.org on 2009/05/18 22:31:28 UTC
svn commit: r776083 -
/geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/context/CollectionBasedServiceReferenceRecipe.java
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);