felix-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Felix Meschberger <fmesc...@adobe.com>
Subject Re: DS and FindHook
Date Thu, 02 Aug 2012 14:37:33 GMT
Hi,

Am 02.08.2012 um 16:26 schrieb <contact@christian-vogel.info>:

> I'm using 4.0.1

Hmm, looking at the code the FindHook should actually be called. 

Is you FindHook called at all -- for other situations, too ? 

Is you DS component properly defined to use the bind method ? E.g. are you sure to not mix
Apache Felix SCR annotations with BND DS annotations ?

Regards
Felix


> 
> ----- Original Message -----
> From: fmeschbe@adobe.com
> To: users@felix.apache.org
> Date: 02.08.2012 16:23:28
> Subject: Re: DS and FindHook
> 
> 
>> Hi,
>> 
>> Am 02.08.2012 um 16:21 schrieb <contact@christian-vogel.info>:
>> 
>>> Hi Felix,
>>> 
>>> thx for your answer. I completely forgot to tell that I'm using Apache Felix
of course. 
>>> 
>>> I tried my FindHook with the more general way by calling BundleContext.getServiceReference
and there it works. So as you told that must be an issue of the framework.
>> 
>> This of course bears the next question: Which version of the framework are you using
?
>> 
>> Regards
>> Felix
>> 
>>> 
>>> Greetings.
>>> Christian
>>> 
>>> ----- Original Message -----
>>> From: fmeschbe@adobe.com
>>> To: users@felix.apache.org
>>> Date: 02.08.2012 16:01:56
>>> Subject: Re: DS and FindHook
>>> 
>>> 
>>>> Hi,
>>>> 
>>>> Am 02.08.2012 um 14:32 schrieb <contact@christian-vogel.info>:
>>>> 
>>>>> Hi,
>>>>> 
>>>>> Today I worked a little bit with OSGi Hooks, specially with FindHook
and EventListenerHook for services. I wanted to try out proxying services. The EventListenerHook
works fine and my services are proxied. But I realized that the FindHook event would'nt be
called if a service will get a reference of the service implementation by annotating the related
setXXX method with @Reference (Bnd style). Maybe it is not a problem with the annotation,
but with DS in general.
>>>>> 
>>>>> This is quite bad, bc there are two services registered one without proxy
and one proxied. I only want to get references from the proxied one. In general, without DS,
you can get references by calling BundleContext.getServiceReference(java.lang.Class<S>
clazz) and the event FindHook.find will be called, where you can decide which ServiceReference
you want to return.
>>>>> 
>>>>> What kind of processes will be executed when I'm using DS like approaches
(for me: Bnd annotation @Reference)? As I described in the above section: I want to decide
which services should be referenced.
>>>> 
>>>> I can only speak for the Apache Felix DS implementation: I use the BundleContext.getServiceReferences(String,
String) to explicitly access service references using the BundleContext of the respective
context (thus to also have OSGi security applied). I would assume that candidate service references
are send to the FilterHook before getting the result to the DS implementation.
>>>> 
>>>> So, unless there is a bug in the framework implementation or in your hook
registration, your hook should really be called. (and of course only if the getServiceReferences
call comes after your hook is registered.
>>>> 
>>>> Regards
>>>> Felix
>>>> 
>>>>> 
>>>>> Greetings.
>>>>> Christian
>>>>> 
>>>>> 
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>>>>> For additional commands, e-mail: users-help@felix.apache.org
>>>>> 
>>>> 
>>>> 
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>>>> For additional commands, e-mail: users-help@felix.apache.org
>>> 
>>> 
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>>> For additional commands, e-mail: users-help@felix.apache.org
>>> 
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>> For additional commands, e-mail: users-help@felix.apache.org
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
> 


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


Mime
View raw message