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

Models: OSGiServiceInjector does not consider service.ranking

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: Sling Models Impl 1.2.6
    • Fix Version/s: Sling Models Impl 1.2.8
    • Component/s: Extensions
    • Labels:
      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

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved: