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

Feike Visser commented on SLING-3320:
-------------------------------------

Little experiment:

{code}
@Service
@Component(immediate=true)
@Properties (
@Property(name = Constants.SERVICE_RANKING, intValue = 10, propertyPrivate = 
false))
public class MyBindings2 implements BindingsValuesProvider {

        @Override
        public void addBindings(Bindings bindings) {
                if ( bindings.get("test") == null) { 
                        System.out.println("test not found!!!");
                }
        }
}

@Service
@Component(immediate=true)
@Properties (
@Property(name = Constants.SERVICE_RANKING, intValue = 10000, propertyPrivate = 
false))
public class MyBindings implements BindingsValuesProvider {

        @Override
        public void addBindings(Bindings bindings) {
                bindings.put("test", "test");
        }
}

{code}

This works: so the higher the value the earlier it gets picked up.

Do you know if there is a default when no ranking is specified?


> 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