felix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Pierre De Rop (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (FELIX-4426) Allow DM to manage collections of services
Date Fri, 10 Oct 2014 10:53:33 GMT

    [ https://issues.apache.org/jira/browse/FELIX-4426?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14166633#comment-14166633

Pierre De Rop commented on FELIX-4426:

Thanks Jan Willem ... I'm looking forward to get your feedback :-)

To make a quick test, you can load dm4 in bndtools (I'm using 2.4.0 M1), and you can then
take a look at 
org.apache.felix.dependencymanager.samples/ samples, where the src/org/apache/felix/dependencymanager/samples/dictionary/SpellChecker.java
is using an Iterable in order to dynamically inspect all currently available "DictionaryService"
(see README file in the samples, which describes this sample).

> Allow DM to manage collections of services
> ------------------------------------------
>                 Key: FELIX-4426
>                 URL: https://issues.apache.org/jira/browse/FELIX-4426
>             Project: Felix
>          Issue Type: New Feature
>          Components: Dependency Manager
>    Affects Versions: dependencymanager-4.0.0
>            Reporter: J.W. Janssen
>            Assignee: Pierre De Rop
>             Fix For: dependencymanager-4.0.0
> DM has great support for single-cardinality dependencies, allowing you to only declare
the dependency as (volatile) field. For multiple-cardinality dependencies, no such support
is present, forcing you to always manually implement this using callbacks.
> It would be great if I could declare multiple-cardinality dependencies like:
> {code}
> private volatile List<MyService> m_services;
> {code}
> and let DM manage the list for me.
> Note that you need some additional reflection mojo to obtain the actual collection type.
An example of how this can work can be found in a utility class for Swagger in the Amdatu-Web
project, see https://bitbucket.org/amdatu/amdatu-web/src/master/org.amdatu.web.rest/src/org/amdatu/web/rest/doc/swagger/SwaggerUtil.java?at=master#cl-304

This message was sent by Atlassian JIRA

View raw message