You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "Konrad Windszus (JIRA)" <ji...@apache.org> on 2016/04/15 11:16:25 UTC

[jira] [Commented] (SLING-5664) Models: OSGiServiceInjector does not consider service.ranking

    [ https://issues.apache.org/jira/browse/SLING-5664?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15242677#comment-15242677 ] 

Konrad Windszus commented on SLING-5664:
----------------------------------------

The implementation in `OsgiServiceReferenceUtils.getServiceReference(...) seems to solve exactly that issue (https://src.springframework.org/svn/spring-osgi/trunk/core/src/main/java/org/springframework/osgi/util/OsgiServiceReferenceUtils.java).

> Models: OSGiServiceInjector does not consider service.ranking
> -------------------------------------------------------------
>
>                 Key: SLING-5664
>                 URL: https://issues.apache.org/jira/browse/SLING-5664
>             Project: Sling
>          Issue Type: Bug
>          Components: Extensions
>    Affects Versions: Sling Models Impl 1.2.6
>            Reporter: Konrad Windszus
>
> 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.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)