Hi Carsten,

You are right, the BVP with the highest service.ranking is called last. But
shouldn't it be called first, in order to be consistent with the OSGi way
of obtaining a reference? To me it's counter-intuitive to set the
service.ranking value to a negative value if I want my BVP to be called
before a another BVP with no service.ranking property set explicitly.

In the end I think the answer revolves around the way we think a BVP is
more powerful: if it's called last in the queue or first.

Regards,
Radu


On Fri, Aug 22, 2014 at 6:44 PM, Carsten Ziegeler <[email protected]>
wrote:

> Hi Radu,
>
> I think the current order is giving the service with the highest ordering
> the final call. If two providers provide a value for the same key, the one
> with the highest wins as it is called last. So I think this matches the
> other usages of service ranking.
>
> Regards
> Carsten
>
>
> 2014-08-22 17:17 GMT+02:00 Radu Cotescu <[email protected]>:
>
> > Hi,
> >
> > In SLING-3320 [0] we introduced some ordering in the BVPs maps, such that
> > BVPs are called using the natural ordering of their ServiceReferences,
> > which is based on the service.ranking value: the higher the
> service.ranking
> > is, the later in the call chain will a BVP be called to add its bindings.
> >
> > Given that in the OSGi world the service.ranking is used to determine
> which
> > implementation is returned for a certain service, the rule of thumb being
> > that the higher the service.ranking is the most likely that
> implementation
> > will be provided, should't we actually reverse the sort order of the
> BVPs?
> >
> > In theory this might introduce some subtle bugs in clients' code, but no
> > one complained when we introduced the ordering in the first place.
> >
> > WDYT?
> >
> > Cheers,
> > Radu
> >
> > [0] - https://issues.apache.org/jira/browse/SLING-3320
> >
>
>
>
> --
> Carsten Ziegeler
> Adobe Research Switzerland
> [email protected]
>

Reply via email to