| Summary: | Filter specified in ServiceTracker's constructor | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] Equinox | Reporter: | Ikuo Yamasaki <yamasaki.ikuo> | ||||
| Component: | Framework | Assignee: | equinox.framework-inbox <equinox.framework-inbox> | ||||
| Status: | RESOLVED INVALID | QA Contact: | |||||
| Severity: | enhancement | ||||||
| Priority: | P3 | CC: | hargrave, Ikuo_Yamasaki, yamasaki.ikuo | ||||
| Version: | 3.2 | ||||||
| Target Milestone: | --- | ||||||
| Hardware: | PC | ||||||
| OS: | Windows XP | ||||||
| Whiteboard: | |||||||
| Attachments: |
|
||||||
|
Description
Ikuo Yamasaki
Created attachment 43175 [details]
Patch of ServiceTracker of listener filter modification
Yes. There is a reason the code is the way it is. This patch will break the proper operation of the ServiceTracker. When tracking by class name or service reference id, those values are immutable for a given service registration. When tracking by an arbitraty filter, the service properties which may cause the filter to match are mutable. For example, when using a ServiceTracker with the filter "(foo=bar)" and ST registers a ServiceListener with the filter "(foo=bar)", if a service is registered with service property foo=bar, then the REGISTERED event will be delivered and the ServiceTracker will track the service. If the service then modifies its properties to change the value of foo to xyz, then the ServiceListener will NOT deliver the MODIFIED event to the ServiceTracker since the filter does not match, foo=xyz and not bar. So the ServiceTracker will not properly untrack the service. So the ServiceTracker must receive all ServiceEvents when a user specified filter is supplied and test each even to see if the service should be tracked or untracked. BJ, thank you for your explanation in detail. I understand the whole. p.s. I was just thinking of reducing event dispatching operations if possible, because a bunch of registered ServiceListener cause degrade of performance related with service registry. |