[jira] [Comment Edited] (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-tabpanelfocusedCommentId=14336551#comment-14336551 ] Konrad Windszus edited comment on SLING-4454 at 2/25/15 2:38 PM: - Since a {{ConcurrentSkipListMap}} is used in the {{UseRuntimeExtension}} with a {{ServiceReference}} as key, 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. was (Author: kwin): 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)
[jira] [Comment Edited] (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-tabpanelfocusedCommentId=14336767#comment-14336767 ] Radu Cotescu edited comment on SLING-4454 at 2/25/15 5:13 PM: -- [~kwin], the JavaDoc from the providers was correct - the higher the service ranking the sooner a provider will be called in the chain. So while the providers are indeed ordered in their ascending natural order, they are actually queried from highest to lowest. See \[0\] for more details. I will revert r1662230 and correct the documentation where needed. \[0\] - https://github.com/apache/sling/blob/trunk/contrib/scripting/sightly/engine/src/main/java/org/apache/sling/scripting/sightly/impl/engine/extension/use/UseRuntimeExtension.java#L85 was (Author: radu.cotescu): [~kwin], the JavaDoc from the providers was correct - the higher the service ranking the sooner a provider will be called in the chain. So while the providers are indeed ordered in their ascending natural order, they are actually queried from highest to lowest. See \[0\] for more details. \[0\] - https://github.com/apache/sling/blob/trunk/contrib/scripting/sightly/engine/src/main/java/org/apache/sling/scripting/sightly/impl/engine/extension/use/UseRuntimeExtension.java#L85 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 Assignee: Konrad Windszus Fix For: Scripting Sightly Engine 1.0.0 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)
[jira] [Comment Edited] (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-tabpanelfocusedCommentId=14336767#comment-14336767 ] Radu Cotescu edited comment on SLING-4454 at 2/25/15 5:14 PM: -- [~kwin], the JavaDoc from the providers was correct - the higher the service ranking the sooner a provider will be called in the chain. So while the providers are indeed ordered in their ascending natural order in the collection that we use for storing them, they are actually queried from highest to lowest. See \[0\] for more details. I will revert r1662230 and correct the documentation where needed. \[0\] - https://github.com/apache/sling/blob/trunk/contrib/scripting/sightly/engine/src/main/java/org/apache/sling/scripting/sightly/impl/engine/extension/use/UseRuntimeExtension.java#L85 was (Author: radu.cotescu): [~kwin], the JavaDoc from the providers was correct - the higher the service ranking the sooner a provider will be called in the chain. So while the providers are indeed ordered in their ascending natural order, they are actually queried from highest to lowest. See \[0\] for more details. I will revert r1662230 and correct the documentation where needed. \[0\] - https://github.com/apache/sling/blob/trunk/contrib/scripting/sightly/engine/src/main/java/org/apache/sling/scripting/sightly/impl/engine/extension/use/UseRuntimeExtension.java#L85 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 Assignee: Konrad Windszus Fix For: Scripting Sightly Engine 1.0.0 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)