[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [p2-dev] Service ranking and p2's IAgentServiceFactory.

Am 01.08.2012 04:48, schrieb Mengxin Zhu:
> P2 is searching services via OSGi API that would sort the service 
> implementations by their ranking.

At least in the code snippets posted p2 uses
BundleContext#getServiceReferences(...). Nothing in the contract of
those methods states that the result returned is sorted in any way. One
either needs sort the results (ServiceReference implements Comparable)
or switch to using a ServiceTracker which honors service ranking in
ServiceTracker#getServiceReference().

-Gunnar



-- 
Gunnar Wagenknecht
gunnar@xxxxxxxxxxxxxxx
http://wagenknecht.org/