You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "Carsten Ziegeler (Jira)" <ji...@apache.org> on 2021/12/21 13:38:00 UTC

[jira] [Created] (SLING-11029) OSGiServiceInjector.getService() should rely on framework

Carsten Ziegeler created SLING-11029:
----------------------------------------

             Summary: OSGiServiceInjector.getService() should rely on framework
                 Key: SLING-11029
                 URL: https://issues.apache.org/jira/browse/SLING-11029
             Project: Sling
          Issue Type: Improvement
          Components: Sling Models
    Affects Versions: Models Implementation 1.5.0
            Reporter: Carsten Ziegeler
             Fix For: Models Implementation 1.5.2


Looking at https://github.com/apache/sling-org-apache-sling-models-impl/blob/master/src/main/java/org/apache/sling/models/impl/injectors/OSGiServiceInjector.java#L102 it seems to get all service references, sort them and then uses the one with the highest ranking.
However BundleContext#getServiceReference() does exactly that, so it can be directly used



--
This message was sent by Atlassian Jira
(v8.20.1#820001)