[jboss-osgi-issues] [JBoss JIRA] (JBOSGI-753) ServiceTracker ignores filter when started with "open(true)"

Daniel Yokomizo (JIRA) jira-events at lists.jboss.org
Fri Nov 15 19:20:06 EST 2013


Daniel Yokomizo created JBOSGI-753:
--------------------------------------

             Summary: ServiceTracker ignores filter when started with "open(true)"
                 Key: JBOSGI-753
                 URL: https://issues.jboss.org/browse/JBOSGI-753
             Project: JBoss OSGi
          Issue Type: Bug
      Security Level: Public (Everyone can see)
         Environment: Linux 3.5.0-43-generic #66-Ubuntu SMP Wed Oct 23 17:33:43 UTC 2013 i686 i686 i686 GNU/Linux 

java version "1.7.0_25" 
OpenJDK Runtime Environment (IcedTea 2.3.10) (7u25-2.3.10-1ubuntu0.12.10.2) 
OpenJDK Server VM (build 23.7-b01, mixed mode) 

WildFly-8.0.0.Beta1 

JBossOSGi-2.1.0
            Reporter: Daniel Yokomizo
            Assignee: Thomas Diesler


I created a project on github[1] to illustrate the problem. I have a bundle activator that instantiates a ServiceTracker with some filter and calls "open(true)" on it. In another bundle I register a couple of services. The tracker ends up calling its customizer's "addingService(ServiceReference)" for all registered services, regardless if they match or not the filter. When starting the ServiceTracker with "open()" or "open(false)" only the matching services are passed to the customizer.

The specification states that only matching services should be tracked:

http://www.osgi.org/javadoc/r5/core/org/osgi/util/tracker/ServiceTracker.html#open(boolean)


The server.log contents, showing the incorrect calls, are:


22:03:56,949 INFO  [stdout] (MSC service thread 1-1) ServiceATracker.addingService(ServiceState{service.id=20, objectClass=[test.ServiceA], foo=bar})
22:03:56,950 INFO  [stdout] (MSC service thread 1-1) ServiceBTracker.addingService(ServiceState{service.id=20, objectClass=[test.ServiceA], foo=bar})
22:03:56,951 INFO  [stdout] (MSC service thread 1-1) ServiceATracker.addingService(ServiceState{service.id=21, objectClass=[test.ServiceB], foo=bar})
22:03:56,952 INFO  [stdout] (MSC service thread 1-1) ServiceBTracker.addingService(ServiceState{service.id=21, objectClass=[test.ServiceB], foo=bar})


1. https://github.com/dyokomizo/wildfly-service-tracker-test

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


More information about the jboss-osgi-issues mailing list