Hello Arjun, On Nov 17, 2008, at 15:28 , Arjun Panday wrote:
I noticed that the ServiceTracker in DependencyManager filters either on the given class name OR the given filter, but not both (see ServiceDependency.start(Service)) I found this to be an issue since i happen to register several types of object with the same set of properties (they refer to the same source) The consequence is that I am then called back with the wrong kind of object and end up with an IllegalArgumenException.
Actually, the ServiceTracker that is used by the dependency manager uses the same API as a normal service tracker. I only added a couple of internal callbacks. So basically I chose to stick with the official API. I do agree that it can be a bit confusing though.
Why this limitation when the underlying BundleContext.getServiceReferences() allows to filter on both class name and ldap filter? Note: I understand that it may be worked around by adding the objectClass information to my filter, but it seems counter-intuitive since the setService method already takes the service class as first parameter.
I thought about adding this behaviour, so actually implicitly adding objectClass information to the filter before offering it to the ServiceTracker, but if you do that, then you cannot filter on just a property anymore. What I could do is add an extra convenience method that does this though. I'm not completely convinced that this makes it less confusing though. :)
Greetings, Marcel --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

