felix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marcel Offermans <marcel.offerm...@luminis.nl>
Subject Re: Contribution of the dependency manager to Feli
Date Sat, 28 Jan 2006 00:53:05 GMT
John E. Conlon wrote:

>Good 5 Minute overview. Thanks Peter.
>  
>
Agreed, thanks!

>One question it mentions
>For each dependency: 
>      * Instance fields are set, through reflection, if they exist.
>
>
>But what if there are multiple dependencies with the same interface -
>like the example?
>  
>
Good question. Since there obviously only is one instance field, it will 
be set to the highest ranking service implementation. So the field will 
only give you access to the "preferred" service.

If you want to keep track of multiple services (for example if you add a 
dependency to track all Device services or something like that) then 
don't use an instance field but use the callback hooks instead and make 
a list of every service that is added. The article I wrote (which can be 
found on the OSGi website) contains some examples of this, btw.

Greetings, Marcel


Mime
View raw message