Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Equinox » ServiceTracker
ServiceTracker [message #72630] Fri, 25 August 2006 07:38 Go to next message
Marco  Lehmann-Mörz is currently offline Marco Lehmann-MörzFriend
Messages: 53
Registered: July 2009
Member
Hi folks,

I have found a strange behaviour in using the ServiceTracker.
I have two plugins A & B (I have more in my RCP application, but this
doesn't matter). Plugin A registers a service in its Activator. Plugin B
creates a ServiceTracker (in a view). First I start plugin B. When I now
start plugin A, plugin B finds the service registered by plugin A. That
is all expected and working behaviour, but when I now stop plugin A,
then the service is released (tracing org.eclipse.osgi), but the service
tracker in plugin B was not informed.

I think the service tracker should be informed?!

TIA
Marco


PS: Eclipse 3.1.2
Re: ServiceTracker [message #72683 is a reply to message #72630] Mon, 28 August 2006 21:27 Go to previous messageGo to next message
Thomas Watson is currently offline Thomas WatsonFriend
Messages: 503
Registered: July 2009
Senior Member
Hi Marco,

Yes the ServiceTracker should be informed. Before I ask you to open a
bug report can you tell me more about the ServiceTracker you are
creating? Do you use a ServiceTrackerCustomizer? If so what do you do
in the ServiceTrackerCustomizer.addingService method? For a service to
be tracked by ServiceTracker the ServiceTrackerCustomizer must return a
non-null object to be tracked from the addingService method.

If you are using a ServiceTrackerCustomizer and returning non-null from
addingService then you should definately be informed if that service
goes away. If you are not getting the removedService called then please
open a bug report against Equinox->Framework and attach a testcase we
can use to reproduce.

Thanks.

Tom.

Marco Lehmann wrote:
> Hi folks,
>
> I have found a strange behaviour in using the ServiceTracker.
> I have two plugins A & B (I have more in my RCP application, but this
> doesn't matter). Plugin A registers a service in its Activator. Plugin B
> creates a ServiceTracker (in a view). First I start plugin B. When I now
> start plugin A, plugin B finds the service registered by plugin A. That
> is all expected and working behaviour, but when I now stop plugin A,
> then the service is released (tracing org.eclipse.osgi), but the service
> tracker in plugin B was not informed.
>
> I think the service tracker should be informed?!
>
> TIA
> Marco
>
>
> PS: Eclipse 3.1.2
Re: ServiceTracker [message #72717 is a reply to message #72683] Thu, 31 August 2006 08:54 Go to previous message
Marco  Lehmann-Mörz is currently offline Marco Lehmann-MörzFriend
Messages: 53
Registered: July 2009
Member
Hi Tom,

unfortunatly, I changed my code to use the extension registry and
therefore extension points. I had several problems with only resolved
and not started bundles.
In spite of that fact I tried to enforce to problem again. I can't. I
tried several scenarios:

1. Plugin A and Plugin B are completly independent of each other
2. Plugin B depends on Plugin A (the service interface is defined in
PluginA)

Both cases work as expected. The service tracker gets informed in both
cases. I must have done something wrong, but I can't remember what.
I'll keep watching.

Thanks for your reply, Tom.


Bye, Marco


Tom Watson schrieb:
> Hi Marco,
>
> Yes the ServiceTracker should be informed. Before I ask you to open a
> bug report can you tell me more about the ServiceTracker you are
> creating? Do you use a ServiceTrackerCustomizer? If so what do you do
> in the ServiceTrackerCustomizer.addingService method? For a service to
> be tracked by ServiceTracker the ServiceTrackerCustomizer must return a
> non-null object to be tracked from the addingService method.
>
> If you are using a ServiceTrackerCustomizer and returning non-null from
> addingService then you should definately be informed if that service
> goes away. If you are not getting the removedService called then please
> open a bug report against Equinox->Framework and attach a testcase we
> can use to reproduce.
>
> Thanks.
>
> Tom.
>
> Marco Lehmann wrote:
>> Hi folks,
>>
>> I have found a strange behaviour in using the ServiceTracker.
>> I have two plugins A & B (I have more in my RCP application, but this
>> doesn't matter). Plugin A registers a service in its Activator. Plugin B
>> creates a ServiceTracker (in a view). First I start plugin B. When I now
>> start plugin A, plugin B finds the service registered by plugin A. That
>> is all expected and working behaviour, but when I now stop plugin A,
>> then the service is released (tracing org.eclipse.osgi), but the service
>> tracker in plugin B was not informed.
>>
>> I think the service tracker should be informed?!
>>
>> TIA
>> Marco
>>
>>
>> PS: Eclipse 3.1.2
Previous Topic:ContextFinder help
Next Topic:How can I start the Equinox OSGi frame with Java 2 Security?Does it work?
Goto Forum:
  


Current Time: Thu Sep 19 00:46:03 GMT 2024

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

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

Back to the top