You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@felix.apache.org by ma...@apache.org on 2009/08/11 10:30:43 UTC

svn commit: r803028 - /felix/trunk/dependencymanager/src/main/java/org/apache/felix/dependencymanager/ServiceDependency.java

Author: marrs
Date: Tue Aug 11 08:30:43 2009
New Revision: 803028

URL: http://svn.apache.org/viewvc?rev=803028&view=rev
Log:
FELIX-1464 applied the patch with the exception of one change that I commented on in the issue.

Modified:
    felix/trunk/dependencymanager/src/main/java/org/apache/felix/dependencymanager/ServiceDependency.java

Modified: felix/trunk/dependencymanager/src/main/java/org/apache/felix/dependencymanager/ServiceDependency.java
URL: http://svn.apache.org/viewvc/felix/trunk/dependencymanager/src/main/java/org/apache/felix/dependencymanager/ServiceDependency.java?rev=803028&r1=803027&r2=803028&view=diff
==============================================================================
--- felix/trunk/dependencymanager/src/main/java/org/apache/felix/dependencymanager/ServiceDependency.java (original)
+++ felix/trunk/dependencymanager/src/main/java/org/apache/felix/dependencymanager/ServiceDependency.java Tue Aug 11 08:30:43 2009
@@ -518,7 +518,8 @@
      * Sets the name of the service that should be tracked. You can either specify
      * only the name, or the name and a filter. In the latter case, the filter is used
      * to track the service and should only return services of the type that was specified
-     * in the name.
+     * in the name. To make sure of this, the filter is actually extended internally to
+     * filter on the correct name.
      * 
      * @param serviceName the name of the service
      * @param serviceFilter the filter condition
@@ -530,7 +531,12 @@
             throw new IllegalArgumentException("Service name cannot be null.");
         }
         m_trackedServiceName = serviceName;
-        m_trackedServiceFilter = serviceFilter;
+        if (serviceFilter != null) {
+            m_trackedServiceFilter ="(&(" + Constants.OBJECTCLASS + "=" + serviceName + ")" + serviceFilter + ")";
+        }
+        else {
+            m_trackedServiceFilter = null;
+        }
         m_trackedServiceReference = null;
         return this;
     }