Skip to main content



      Home
Home » Eclipse Projects » Equinox » service.ranking and ServiceTracker
service.ranking and ServiceTracker [message #97162] Wed, 12 September 2007 03:58 Go to next message
Eclipse UserFriend
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 05:54 Go to previous messageGo to next message
Eclipse UserFriend
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 17:17 Go to previous message
Eclipse UserFriend
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: Fri Jul 04 19:07:43 EDT 2025

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

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

Back to the top