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

Models: OSGiServiceInjector does not consider service.ranking

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • Sling Models Impl 1.2.6
    • Sling Models Impl 1.2.8
    • Extensions
    • None

    Description

      The injector is using BundleContext.getServiceReferences(Class, String) or SlingScriptHelper.getServices(Class, String) (https://github.com/apache/sling/blob/trunk/bundles/extensions/models/impl/src/main/java/org/apache/sling/models/impl/injectors/OSGiServiceInjector.java#L97). From the returned array it just takes the first item.
      Unfortunately the order in that array is not-deterministic, especially it is not necessarily that way that items with a higher service.ranking are returned first.

      Attachments

        1. SLING-5664-v01.patch
          23 kB
          Konrad Windszus

        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: