felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r1549743 - /felix/trunk/framework/src/main/java/org/apache/felix/framework/util/EventDispatcher.java
Date Tue, 10 Dec 2013 02:26:56 GMT
Author: cziegeler
Date: Tue Dec 10 02:26:56 2013
New Revision: 1549743

URL: http://svn.apache.org/r1549743
Log:
FELIX-4080 : Core R5] Add support for org.osgi.framework.UnfilteredServiceListener. Apply
patch from David Bosschaert

Modified:
    felix/trunk/framework/src/main/java/org/apache/felix/framework/util/EventDispatcher.java

Modified: felix/trunk/framework/src/main/java/org/apache/felix/framework/util/EventDispatcher.java
URL: http://svn.apache.org/viewvc/felix/trunk/framework/src/main/java/org/apache/felix/framework/util/EventDispatcher.java?rev=1549743&r1=1549742&r2=1549743&view=diff
==============================================================================
--- felix/trunk/framework/src/main/java/org/apache/felix/framework/util/EventDispatcher.java
(original)
+++ felix/trunk/framework/src/main/java/org/apache/felix/framework/util/EventDispatcher.java
Tue Dec 10 02:26:56 2013
@@ -48,6 +48,7 @@ import org.osgi.framework.ServiceListene
 import org.osgi.framework.ServicePermission;
 import org.osgi.framework.ServiceReference;
 import org.osgi.framework.SynchronousBundleListener;
+import org.osgi.framework.UnfilteredServiceListener;
 import org.osgi.framework.hooks.service.ListenerHook;
 import org.osgi.framework.launch.Framework;
 
@@ -908,8 +909,15 @@ public class EventDispatcher
         if (hasPermission)
         {
             // Dispatch according to the filter.
-            boolean matched = (filter == null)
-                || filter.match(((ServiceEvent) event).getServiceReference());
+            boolean matched;
+            if (l instanceof UnfilteredServiceListener) {
+                // An UnfilteredServiceListener always matches, regardless of the filter.
+                // The filter is still passed on to the Service Registry Hooks.
+                matched = true;
+            } else {
+                matched = (filter == null)
+                        || filter.match(((ServiceEvent) event).getServiceReference());
+            }
 
             if (matched)
             {
@@ -1112,4 +1120,4 @@ public class EventDispatcher
         public Map<BundleContext, List<ListenerInfo>> m_listeners = null;
         public EventObject m_event = null;
     }
-}
\ No newline at end of file
+}



Mime
View raw message