felix-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Felix Meschberger <fmesc...@adobe.com>
Subject Re: declarative Services
Date Thu, 06 Jun 2013 23:11:30 GMT
Hi

Am 06.06.2013 um 15:31 schrieb Agemo Cui:

> On 6/6/13 11:09 AM, Carsten Ziegeler wrote:
>> 2013/6/6 Agemo Cui <agemocui@jruyi.org>
>> 
>>> 
>>> On 6/6/13 5:21 AM, Chetan Mehrotra wrote:
>>> 
>>>> I have at times also struggled with DS when I moved from Blueprint. Within
>>>> a Bundle if there are some internal services which are used by various DS
>>>> Components *within* that bundle then is it fine to
>>>> 
>>>> 1. Register these internal services as DS components but with classes
>>>> which
>>>> are not part of Export-Package list i.e. private classes
>>>> 
>>> Yes (at least) for Apache SCR.
>>> 
>> Do you mean, this doesn't or might not work with other DS implementations?
> 
> Yes. Because Im not sure if this is mentioned in the spec.
> However, it works in my case using felix scr.

Why should that not work ? A service registered with a service interface/class name and the
service registry does not care whether this is actually exported or not. What the service
registry does is make sure that the consumer can use the service, thus knows the service interface/class
(unless the getAllServiceReferences method is used).

Regards
Felix

> 
>> 
>>> But other bundles are not really prevented from using this service by this
>>> method.
>>> The service still can be fetched, and be used through reflection.
>>> 
>>> I don't think this is a problem - you can do all kinds of tricks using
>> reflection etc.
>> However, I'm not sure if you're really able to get the service as
>> ServiceReference.isAssignableTo is called and if I understand this
>> correctly, this will fail as the client bundle does not see the private
>> class under which the service is registered.
> Sorry, it's not a problem
> 
> 
>> 
>> Carsten
>> 
> 
> 
> ---------------------------------------------------------------------
> 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