I understand you want to have the word "added" defined in the light of
a filter?
Kind regards,
Peter Kriens
NH> Spec Experts;
NH> The specification for BundleContext.addServiceListener says that if we
change
NH> the service property, the whole lifecycle will NOT be seen by the listener.
NH> I can't find the clarity in the ServiceTracker specification. It says;
NH> "When a service is being added to the ServiceTracker object or when a
tracked
NH> service is modified or removed from the ServiceTracker object, it must call
NH> addingService, modifiedService or reovedService respectively, on the
NH> ServcieTrackerCustomizer object..."
NH> However, it is unclear what "added to..." refers to, and what the real
intent
NH> really is.
NH> I provide a tracking filter to the ServiceTracker that uses service
NH> properties; (&(objectClass=org.hedhman.MyService)(habba=abc))
NH> IMHO, if I change the property "habba" of myService from "def" to "abc" the
NH> ServiceTrackerCustomizer.addedService() should[1] be called for the above
NH> tracker. Likewise, if the filter of the tracking 'looses' the service, then
NH> removedService() should be called. I.e. modifiedService would only be called
NH> if service properties are changed, but the filter is still evaluating true.
NH> This is significantly different from what is descibed in the
NH> BundleContext.addServiceListener, and may be considered both "incompatible"
NH> as well as "complicated", but it makes sense for the user.
NH> In either case, I think the documentation should be complemented with a
NH> diagram of the full cycle.
NH> Cheers
NH> Niclas
NH> [1] I have actually not tried this yet, but it is part of upcoming work this
NH> week. Looking at the ServiceTracker source, I get the impression that only
NH> the services that initially match the filter will be considered at all.
NH> _______________________________________________
NH> OSGi Developer Mail List
NH> [email protected]
NH> http://www2.osgi.org/mailman/listinfo/osgi-dev
--
Peter Kriens Tel +33467542167
9C, Avenue St. Drézéry AOL,Yahoo: pkriens
34160 Beaulieu, France ICQ 255570717
Skype pkriens Fax +1 8153772599
_______________________________________________
OSGi Developer Mail List
[email protected]
http://www2.osgi.org/mailman/listinfo/osgi-dev