Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Equinox » service.ranking and ServiceTracker
service.ranking and ServiceTracker [message #97162] Wed, 12 September 2007 07:58 Go to next message
Gavin Bong is currently offline Gavin BongFriend
Messages: 23
Registered: July 2009
Junior Member
I register 2 services into the OSGi runtime.
These services implement the interface IFoo.

I set the service.ranking of one of the services to be higher
than its counterpart.

Service #1: service.ranking=200
Service #2: service.ranking=1

When I start a ServiceTracker, will addingService(..) be called with Service #2 first ? This is not mentioned in the compendium spec. Thanks.

Regards,

Gavin Bong
Re: service.ranking and ServiceTracker [message #97192 is a reply to message #97162] Wed, 12 September 2007 09:54 Go to previous messageGo to next message
Gavin Bong is currently offline Gavin BongFriend
Messages: 23
Registered: July 2009
Junior Member
I just read the javadoc. The service.ranking property is only useful to the method BundleContext.getServiceReference(..). So to answer my own question above: NO.
Re: service.ranking and ServiceTracker [message #97755 is a reply to message #97192] Wed, 19 September 2007 21:17 Go to previous message
Thomas Watson is currently offline Thomas WatsonFriend
Messages: 503
Registered: July 2009
Senior Member
Gavin Bong wrote:
> I just read the javadoc. The service.ranking property is only useful to the method BundleContext.getServiceReference(..). So to answer my own question above: NO.

The ServiceTracker.getService() should still return the highest ranking
service available. But the addingService(..) is called in the order in
which the services are actually registered. This is because the service
registration events are synchronous and cannot really be queued up
correctly to get a proper ranking order. This would cause all kinds of
timing issues.

HTH.

Tom
Previous Topic:Bundle location reported in console
Next Topic:Using preferences to control external: manifest entries
Goto Forum:
  


Current Time: Sat Apr 27 02:40:57 GMT 2024

Powered by FUDForum. Page generated in 0.03142 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top