aries-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mnutt...@apache.org
Subject svn commit: r1489006 - /aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/AbstractServiceReferenceRecipe.java
Date Mon, 03 Jun 2013 14:34:15 GMT
Author: mnuttall
Date: Mon Jun  3 14:34:15 2013
New Revision: 1489006

URL: http://svn.apache.org/r1489006
Log:
Aries-896: Undo threading changes to AbstractServiceReferenceRecipe.serviceChanged() since
they can result in unbind-methods being driven with invalid service references. 

Modified:
    aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/AbstractServiceReferenceRecipe.java

Modified: aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/AbstractServiceReferenceRecipe.java
URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/AbstractServiceReferenceRecipe.java?rev=1489006&r1=1489005&r2=1489006&view=diff
==============================================================================
--- aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/AbstractServiceReferenceRecipe.java
(original)
+++ aries/trunk/blueprint/blueprint-core/src/main/java/org/apache/aries/blueprint/container/AbstractServiceReferenceRecipe.java
Mon Jun  3 14:34:15 2013
@@ -35,7 +35,6 @@ import java.util.List;
 import java.util.Map;
 import java.util.Set;
 import java.util.concurrent.Callable;
-import java.util.concurrent.RejectedExecutionException;
 import java.util.concurrent.atomic.AtomicBoolean;
 
 import org.apache.aries.blueprint.BlueprintConstants;
@@ -307,30 +306,22 @@ public abstract class AbstractServiceRef
         }
     }
 
-    public void serviceChanged(final ServiceEvent event) {
-        final int eventType = event.getType();
-        final ServiceReference ref = event.getServiceReference();
-        try {
-            blueprintContainer.getExecutors().submit(new Runnable() {
-                public void run() {
-                    switch (eventType) {
-                        case ServiceEvent.REGISTERED:
-                            serviceAdded(ref);
-                            break;
-                        case ServiceEvent.MODIFIED:
-                            serviceModified(ref);
-                            break;
-                        case ServiceEvent.UNREGISTERING:
-                            serviceRemoved(ref);
-                            break;
-                    }
-                }
-            });
-        } catch (RejectedExecutionException e) {
-            // The job has been rejected because the executor is shut down
-            // so ignore the exception
-        }
-    }
+    public void serviceChanged(ServiceEvent event) {
+      int eventType = event.getType();
+      ServiceReference ref = event.getServiceReference();
+      switch (eventType) {
+          case ServiceEvent.REGISTERED:
+              serviceAdded(ref);
+              break;
+          case ServiceEvent.MODIFIED:
+              serviceModified(ref);
+              break;
+          case ServiceEvent.UNREGISTERING:
+              serviceRemoved(ref);
+              break;
+      }
+    }  
+
 
     private void serviceAdded(ServiceReference ref) {
         LOGGER.debug("Tracking reference {} for OSGi service {}", ref, getOsgiFilter());



Mime
View raw message