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 2015/02/25 15:38:05 UTC

[jira] [Commented] (SLING-4454) Contradicting information about service.ranking in UseProvider and JavaUseProvider

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

Konrad Windszus commented on SLING-4454:
----------------------------------------

Since a {{ConcurrentSkipListMap}} is used in the {{UseRuntimeExtension}} with {{ServiceReference}}s as keys, the natural ordering of a {{ServiceReference}} is followed: https://osgi.org/javadoc/r4v43/core/org/osgi/framework/ServiceReference.html#compareTo%28java.lang.Object%29.
That means lower service rankings are checked first -> the javadoc in the UseProvider is correct, for all implementations the documentation is wrong.

> Contradicting information about service.ranking in UseProvider and JavaUseProvider
> ----------------------------------------------------------------------------------
>
>                 Key: SLING-4454
>                 URL: https://issues.apache.org/jira/browse/SLING-4454
>             Project: Sling
>          Issue Type: Bug
>          Components: Scripting
>    Affects Versions: Scripting Sightly Engine 1.0.0
>            Reporter: Konrad Windszus
>
> The {{org.apache.sling.scripting.sightly.use.UseProvider}} states in the javadoc:
> {code}
> {@code UseProvider} services are ranked according to the OSGi service
>  * registration propertiy {@code service.ranking} which is an integer value.
>  * {@code UseProvider} servies with lower ranking values are tried before
>  * services with higher ranking values. The default value for the ranking if the
>  * property is missing is zero.
> {code}
> All implementations like {{org.apache.sling.scripting.sightly.impl.engine.extension.use.JavaUseProvider}} and sibling classes state
> {code}
> @Properties({
>         @Property(
>                 name = Constants.SERVICE_RANKING,
>                 label = "Service Ranking",
>                 description = "The Service Ranking value acts as the priority with which this Use Provider is queried to return an " +
>                         "Use-object. A higher value represents a higher priority.",
>                 intValue = 90,
>                 propertyPrivate = false
>         )
> })
> {code}
> So what is true here? Are UseProvider with lower rankings queried first? What happens if they return a result.
> Please clarify the javadoc here.



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