You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@felix.apache.org by Elvy <pi...@gmail.com> on 2008/06/03 11:16:04 UTC

ServiceTracker and already registered services

Hi there,

Assume some services are already registered and, at a certain moment, a new
ServiceTracker in installed.

One could expect that:
 - either the services already available are notified so we get synchronized
with the current system state
 - or only new registrations are notified

I just discovered that Felix informs trackers about all the already
available services. This seems very good to me, but I was wondering whether
or not it was part of OSGi specification (didn't find it...).

Thanks for the info and congratulations



-----
Tell me something you don't know!
-- 
View this message in context: http://www.nabble.com/ServiceTracker-and-already-registered-services-tp17619421p17619421.html
Sent from the Apache Felix - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: ServiceTracker and already registered services

Posted by jaredmac <jm...@mathworks.com>.

Elvy wrote:
> 
> Hi there,
> 
> Assume some services are already registered and, at a certain moment, a
> new ServiceTracker in installed.
> 
> One could expect that:
>  - either the services already available are notified so we get
> synchronized with the current system state
>  - or only new registrations are notified
> 
> I just discovered that Felix informs trackers about all the already
> available services. This seems very good to me, but I was wondering
> whether or not it was part of OSGi specification (didn't find it...).
> 
> Thanks for the info and congratulations
> 

I had a similar question. I am relying on the behavior of being informed
about the services that are already available, but it I am relying on it too
early in the process. That is to say, sometimes I ask and there are three
services; other times, two or four. 

If I add some debugging statements, I can see that ServiceEvents are still
being received at the same time that I am asking for services.

I am wondering if there is any way to wait for or ask if the registration of
initially available services is complete... for my program, the
bundle/services state is static after initialization.
-- 
View this message in context: http://www.nabble.com/ServiceTracker-and-already-registered-services-tp17619421p17741282.html
Sent from the Apache Felix - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: ServiceTracker and already registered services

Posted by "Richard S. Hall" <he...@ungoverned.org>.
I don't think the Felix notifies the service tracker, I assume the 
service tracker queries the service registry for existing services and 
starts listening for new services events at that point in time.

This should be the standard behavior, because it wouldn't be as useful 
without it.

-> richard

Elvy wrote:
> Hi there,
>
> Assume some services are already registered and, at a certain moment, a new
> ServiceTracker in installed.
>
> One could expect that:
>  - either the services already available are notified so we get synchronized
> with the current system state
>  - or only new registrations are notified
>
> I just discovered that Felix informs trackers about all the already
> available services. This seems very good to me, but I was wondering whether
> or not it was part of OSGi specification (didn't find it...).
>
> Thanks for the info and congratulations
>
>
>
> -----
> Tell me something you don't know!
>   

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org