You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@felix.apache.org by pa...@apache.org on 2006/06/24 16:24:52 UTC

svn commit: r416921 - /incubator/felix/trunk/org.apache.felix.eventadmin.bridge.upnp/src/main/java/org/apache/felix/eventadmin/bridge/upnp/UPnPEventToEventAdminBridge.java

Author: pauls
Date: Sat Jun 24 07:24:52 2006
New Revision: 416921

URL: http://svn.apache.org/viewvc?rev=416921&view=rev
Log:
Fix property key mismatch (FELIX-68)

Modified:
    incubator/felix/trunk/org.apache.felix.eventadmin.bridge.upnp/src/main/java/org/apache/felix/eventadmin/bridge/upnp/UPnPEventToEventAdminBridge.java

Modified: incubator/felix/trunk/org.apache.felix.eventadmin.bridge.upnp/src/main/java/org/apache/felix/eventadmin/bridge/upnp/UPnPEventToEventAdminBridge.java
URL: http://svn.apache.org/viewvc/incubator/felix/trunk/org.apache.felix.eventadmin.bridge.upnp/src/main/java/org/apache/felix/eventadmin/bridge/upnp/UPnPEventToEventAdminBridge.java?rev=416921&r1=416920&r2=416921&view=diff
==============================================================================
--- incubator/felix/trunk/org.apache.felix.eventadmin.bridge.upnp/src/main/java/org/apache/felix/eventadmin/bridge/upnp/UPnPEventToEventAdminBridge.java (original)
+++ incubator/felix/trunk/org.apache.felix.eventadmin.bridge.upnp/src/main/java/org/apache/felix/eventadmin/bridge/upnp/UPnPEventToEventAdminBridge.java Sat Jun 24 07:24:52 2006
@@ -170,11 +170,12 @@
         }
     }
 
-    // The set contains the last used filter parts. It will be null in case the last
-    // time we registered with a null property. It will be an empty HashSet in 
+    // The set contains the last used filter parts. It will be null in case the
+    // last
+    // time we registered with a null property. It will be an empty HashSet in
     // case we have been unregistered previously
     private Set last = new HashSet();
-    
+
     // Registers itself as an UPnPEventListener with the framework in case there
     // is both, at least one EventAdmin (i.e., !m_adminRefs.isEmpty()) and at
     // least one EventHandler (i.e., !m_handlerRefs.isEmpty()) present and it is
@@ -185,16 +186,17 @@
         // do we need to be registered?
         if(m_adminRefs.isEmpty() || m_handlerRefs.isEmpty())
         {
-            //no we don't but do we need to unregister?
+            // no we don't but do we need to unregister?
             if(null != m_reg)
             {
-                //yes 
+                // yes
                 m_reg.unregister();
                 m_reg = null;
                 last = new HashSet();
             }
         }
-        else // yes we need to be registered
+        else
+        // yes we need to be registered
         {
             final Set parts = new HashSet();
             final StringBuffer result = new StringBuffer().append("(|");
@@ -204,7 +206,8 @@
                 final String filter = (String) ((ServiceReference) iter.next())
                     .getProperty(EventConstants.EVENT_FILTER);
 
-                // if any filter is not set we need to register with a null and can
+                // if any filter is not set we need to register with a null and
+                // can
                 // return
                 if(null == filter)
                 {
@@ -234,10 +237,10 @@
                 }
             }
 
-            final String filter = result.append(")").toString();
-
-            // parts will one be empty if there is no handler with a valid filter
-            // and we only need to register with the new filter if it doesn't equal
+            // parts will one be empty if there is no handler with a valid
+            // filter
+            // and we only need to register with the new filter if it doesn't
+            // equal
             // the last filter
             if(!parts.isEmpty() && !parts.equals(last))
             {
@@ -249,7 +252,10 @@
                     {
                         {
                             put(UPnPEventListener.UPNP_FILTER, m_context
-                                .createFilter(filter));
+                                .createFilter(result.append(")").toString()
+                                    .replaceAll("upnp.serviceId",
+                                        UPnPService.ID).replaceAll(
+                                        "upnp.deviceId", UPnPDevice.ID)));
                         }
                     });
                 } catch(InvalidSyntaxException e)
@@ -361,6 +367,8 @@
                         {
                             put(UPnPDevice.ID, deviceId);
                             put(UPnPService.ID, serviceId);
+                            put("upnp.serviceId", serviceId);
+                            put("upnp.deviceId", deviceId);
                             put("upnp.events", immutableEvents);
                         }
                     }));