2013/6/6 Agemo Cui <[email protected]>

>
>
> 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?


> 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.

Carsten

Reply via email to