felix-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Pawel Pogorzelski <pawel.pogorzels...@gmail.com>
Subject Re: OSGi Declarative Services dependency on a generic supertype
Date Thu, 05 Feb 2015 16:15:04 GMT
Thanks Ferry, it indeed works. Is there any way of doing it without
specifying all the object supertypes during the registration? Maybe using
Felix SCR annotations instead of OSGi ones?

Cheers,
Pawel



On Thu, Feb 5, 2015 at 5:02 PM, Ferry Huberts <mailings@hupie.com> wrote:

>
>
> On 05/02/15 16:59, Pawel Pogorzelski wrote:
>
>> Guys,
>> I have a generic interface IRepository<T> extended by IAppleRepository,
>> IOrangeRepository and so on. Concrete implementations like AppleRepository
>> are registered in the container with non-generic interfaces like
>> IAppleRepository. Is it possible to tell DS engine I need every service
>> sublassing IRepository? Corresponding line in my component.xml looks like
>> follows:
>>
>>    <reference name="Repository" cardinality="0..n" policy="dynamic"
>> interface="com.Whatever.IRepository" bind="addRepository"
>> unbind="removeRepository"/>
>>
>> but it doesn't work. I'm on Felix 4.4.1.
>>
>
>
> Then the bundles don't advertise the IRepository interface but their
> subclass(es).
>
> Make the bundles advertise IRepository and it'll work.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message