aries-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael Vorburger (JIRA)" <>
Subject [jira] [Commented] (ARIES-1740) blueprint-maven-plugin should generate <reference-list> instead of <reference id="list" interface="java.util.List"/> for a @OsgiService List<Service> ?
Date Mon, 25 Sep 2017 18:12:00 GMT


Michael Vorburger commented on ARIES-1740:

> use @ReferenceListener annotation and track binding and unbinding of osgi services and
then reference-list element will be generated

Ah, OK; tx. I thought letting Aries does it's dynamic proxy list thing was nice, and seemed
"better" to me than a listener.

>  write reference-list in separate blueprint file and inject it without @OsgiService (but
propably with @Named(...))

yep, that's exactly what we've done to move - just thought I'd raise as a possible future
enhancement/change request, fine.

> The main problem with reference and reference-list is how to decide if you need one service
implementing java.util.List (as it is generated now) or list of services (what you want in
this issue).

I see, OK. Personally I would think that one wanting to inject java.util.List is perhaps unlikely,
not real something anyone would ever want to do especially without a TypeLiteral like in Guice
DI (but you could use named and filters, of course), so perhaps could even default to list
of services. That would break backwards compatibility though, so perhaps it's already too
late for that?

FYI I've noticed a dynamic=true/false flag on the OsgiService annotation.. Peeking at it's
JavaDoc here
makes me wonder if this could be used as an indication.. or better not to mix up with that

> Maybe we need another annotation e. g. @OsgiServices ?

Or just a new attribute on OsgiService? Like... well, referenceList? Maybe default to true,
so that it does OOB what I think one would normally want, but one who wants the current behaviour
could override to behave as today? Or again if backwards compatibility is an issue, then default
to false, and opt-in to true.

BUT while trying to find the JavaDoc of the OsgiService annotation, I noticed that the master
branch of ops4j cdi doesn't have the OsgiService annotation anymore, see
- what's going on there? We're just starting to use it more in ODL, so if this is removed,
deprecated or somewhere else now, I'd be interesting in knowing more about that...

> blueprint-maven-plugin should generate <reference-list> instead of <reference
id="list" interface="java.util.List"/> for a @OsgiService List<Service> ?
> -------------------------------------------------------------------------------------------------------------------------------------------------------
>                 Key: ARIES-1740
>                 URL:
>             Project: Aries
>          Issue Type: New Feature
>            Reporter: Michael Vorburger
>            Assignee: Dominik Przybysz
> I may be misunderstanding something, but I would have expected the {{blueprint-maven-plugin}}
(currently using its 1.4.0 in ODL) to generate {{<reference-list ...>}} instead of a
{{<reference id="list" interface="java.util.List"/>}} for a {{@Singleton}}'s bean constructor
{{@Inject @OsgiService List<Service> services}} argument?

This message was sent by Atlassian JIRA

View raw message