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

Bertrand Delacretaz commented on SLING-3320:
--------------------------------------------

service.ranking can be used at any time, the code that uses the services just 
needs to sort the ServiceReference objects to get the services in the order of 
that integer value. I'm not sure if we are currently doing that for BVPs, but 
if we are not we should.

Whether the order is up or down depends on the code that uses the services.

If you could try changing the ranking to check if that has an impact that would 
be nice, or even better add tests to [1] that create BVPs with various rankings 
and check the result. I think you just need to modify getProperties(String 
context, String engineName) to take an optional ranking parameter, add that to 
service properties, and add some tests that create BVPs in a single context 
with different rankings to verify.

[1] 
https://svn.apache.org/repos/asf/sling/trunk/bundles/scripting/core/src/test/java/org/apache/sling/scripting/core/impl/BindingsValuesProvidersByContextIT.java

> Execution order of BindingsValuesProvider 
> ------------------------------------------
>
>                 Key: SLING-3320
>                 URL: https://issues.apache.org/jira/browse/SLING-3320
>             Project: Sling
>          Issue Type: Bug
>            Reporter: Feike Visser
>
> I have implemented two basic BindingsValuesProviders like this.
> {code}
> @Service
> @Component(immediate=true)
> public class MyBindings implements BindingsValuesProvider {
> }
> {code}
> What I want to make sure is that they are *always* executed in the same 
> order, first A, then B.
> Because I want to re-use objects that were set in the first 
> BindingsValuesProvider.
> Currently I don't have a way to do this.



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)

Reply via email to