felix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stuart McCulloch <mccu...@gmail.com>
Subject Re: Service Rankings
Date Mon, 25 May 2009 06:10:52 GMT
2009/5/25 João Ferreira <jtjeferreira@gmail.com>

> Hi
> I think i found a bug with service rankings since the comparator method
> of service reference isn't being called. I placed a breakpoint in the
> method and got no stop.

you'll need to provide more details like which version of Felix you're using
where you're setting the breakpoint (in trunk the ServiceReference.compareTo
implementation is actually in ServiceRegistrationImpl.java:452)

also it depends how you're getting the service - if you use the bundle
method "getServiceReference(String clazz)" this definitely uses compareTo
- see the "getBestServiceReference" utility method in BundleContextImpl:271

but if you're using a high-level framework like iPOJO then it might be using
own implementation of the ranking algorithm to sort services (the compareTo
method in ServiceReference only appeared in r4.1 of the OSGi spec, before
that the service ordering was defined in the spec but there was no compareTo
method defined in the ServiceReference interface)

Could someone confirm this? I'm creating the services with ipojo but i
> dont think thats the prob since the services have the service.ranking
> property set.
> Thanks
> João Ferreira

Cheers, Stuart

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message