You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@felix.apache.org by "Gay David (Annecy)" <dg...@axway.com> on 2011/04/04 19:01:38 UTC

iPojo, service.ranking and dynamic-priority

Hi all,

I'm trying to use the service ranking with iPojo.

As far as I understand, if I provide a service property "service.ranking", iPojo will inject to consumers the "best" service with the highest value at the time I required a service.

Even more, if I put @Requires( policy="dynamic-priority"), I understand that iPojo will dynamically inject me the "best" service found every time.

I made a little test to check this behavior, but I was unable to make it works.
If you install my test bundle in Felix, type in console :

-> foo-create 3
* BIND FooService
* VALIDATE Consumer
Create foo service with a ranking level of '3'

-> foo-consume
Consuming foo : foo service with rank 3

-> foo-create 54
Create foo service with a ranking level of '54'

-> foo-consume
Consuming foo : foo service with rank 3


I expect iPojo to inject me the "best" service (service.ranking=54) in this case inside my consumer. But it's not the case, the consumer still use the first created consumer.

Is it the normal behavior ?
Is my code wrong somewhere ?
Did I misunderstood dynamic-policy behavior ?

Thanks for any helps
PS : I've tested with iPojo 1.8.0 & Felix 3.2.0 with Java 1.6.0_23-b05 / Win XP

Regards
David G.