org.osgi.framework.hooks.service.EventListenerHook.event(ServiceEvent, 
Map<BundleContext, Collection<ListenerInfo>>)

That hook was introduced to be able to distinguish between the different 
listeners (trackers) for a specific bundle.  But I agree with others, 
hooks are not the most simple thing to get right.

Tom





From:   Neil Bartlett <njbartl...@gmail.com>
To:     OSGi Developer Mail List <osgi-dev@mail.osgi.org>
Date:   04/15/2015 07:32 AM
Subject:        Re: [osgi-dev] service tracker precedence
Sent by:        osgi-dev-boun...@mail.osgi.org



In addition to the caveats from Chris and Marcel, I would add that service 
hooks can only filter at the consuming bundle level. They cannot 
distinguish between multiple trackers coming from the same bundle.

Regards
Neil

On 15 Apr 2015, at 13:10, Marcel Offermans <marcel.offerm...@luminis.nl> 
wrote:

And even those probably only work if you manage to actually install the 
bundle with the hook before the other bundles...
On 15 Apr 2015 at 13:56:01, chris.g...@kiffer.be (chris.g...@kiffer.be) 
wrote:
With the caveat that service registry hooks are significantly harder to 
get right than service trackers. But indeed this is the only way to "hide" 

services from being found through the regular channels. 

> A service tracker might be the wrong thing to use for your case. 
> Instead you might want to look into the service registry hooks. This 
> should allow you to intercept the lookup of the tracker SA and filter 
> out the services it should not see. 
> 
> 
http://coderthoughts.blogspot.de/2009/11/altering-osgi-service-lookups-with.html
 

> 
> Christian 
> 
> On 15.04.2015 12:52, Frank Langel wrote: 
>> Hi, 
>> 
>> Short question regarding service tracker concept if I may: 
>> 
>> 1. I have two service tracker SA and SB tracking the same service S 
>> 2. SA is out of the box and cannot not be modified 
>> 3. SB is my own service tracker 
>> 
>> I want to make sure that my service tracker SB always tracks/finds the 
>> service first, and if it decides to track the service, SA will not be 
>> triggered/invoked and therefore have no way of tracking it. 
>> 
>> Would giving SA und SB different service.ranking do the trick ? ( I 
>> don¹t 
>> think so ). How do I stop SB from being notified about S ? 
>> 
>> Is that possible? Any pointers would be highly appreciated 
>> Thanks a lot 
>> Frank 
>> 
>> 
>> 
>> _______________________________________________ 
>> OSGi Developer Mail List 
>> osgi-dev@mail.osgi.org 
>> https://mail.osgi.org/mailman/listinfo/osgi-dev 
> 
> 
> -- 
> Christian Schneider 
> http://www.liquid-reality.de 
> 
> Open Source Architect 
> http://www.talend.com 
> 
> _______________________________________________ 
> OSGi Developer Mail List 
> osgi-dev@mail.osgi.org 
> https://mail.osgi.org/mailman/listinfo/osgi-dev 
> 


_______________________________________________ 
OSGi Developer Mail List 
osgi-dev@mail.osgi.org 
https://mail.osgi.org/mailman/listinfo/osgi-dev 
_______________________________________________
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev
_______________________________________________
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev
_______________________________________________
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev

Reply via email to