[
https://issues.apache.org/jira/browse/SLING-5041?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15081428#comment-15081428
]
Konrad Windszus commented on SLING-5041:
----------------------------------------
In [r1722921|http://svn.apache.org/r1722921] I added a reference to OSGi
Declarative Services 1.3 and fixed some minor javadoc issues with both
ServiceUtil and RankedServices.
> Clarify the order of the iterator given by RankedServices
> ---------------------------------------------------------
>
> Key: SLING-5041
> URL: https://issues.apache.org/jira/browse/SLING-5041
> Project: Sling
> Issue Type: Improvement
> Components: Commons
> Affects Versions: Commons OSGi 2.3.0
> Reporter: Konrad Windszus
> Assignee: Konrad Windszus
> Fix For: Commons OSGi 2.4.0
>
>
> 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.
> [1] -
> https://osgi.org/javadoc/r4v42/org/osgi/framework/BundleContext.html#getServiceReference(java.lang.String)
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)