Uploaded image for project: 'Sling'
  1. Sling
  2. SLING-5041

Clarify the order of the iterator given by RankedServices

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • Commons OSGi 2.3.0
    • Commons OSGi 2.4.0
    • Commons
    • 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.

      [1] - https://osgi.org/javadoc/r4v42/org/osgi/framework/BundleContext.html#getServiceReference(java.lang.String)

      Attachments

        Issue Links

          Activity

            People

              kwin Konrad Windszus
              kwin Konrad Windszus
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: