Details
-
Improvement
-
Status: Closed
-
Major
-
Resolution: Fixed
-
Commons OSGi 2.3.0
-
None
Description
Currently the iterator in RankedServices returns the services in the ascending order from lowest to highest ranking. This is a different order then being used by OSGi internally [1]. Usually you are only interested in an iterator which gives you the service with the highest ranking first (because that would also be the one being returned by BundleContext.getServiceReference(...)).
If we don't change the iterator logic we should at least make it clearer in the Javadoc that the iterator really gives the services in ascending order of their service ranking property and we should probably add a more useful iterator which gives back the services with the highest ranking first.
The issue came up in the context of SLING-5035.
Attachments
Issue Links
- is related to
-
SLING-5667 MockBundleContext.getServiceReference(...) does not return service reference with highest ranking
- Resolved
-
SLING-5865 Models Impl: Update to org.apache.sling.commons.osgi 2.4.0
- Resolved
-
SLING-5864 i18n: Update to org.apache.sling.commons.osgi 2.4.0
- Closed
- relates to
-
SLING-5035 Sling Models Injectors should be queried in the reverse order of their service ranking value
- Resolved
-
SLING-4521 Commons OSGi: Add helper class for thread-safe access list of ranked service dependencies
- Closed