Hi all.
I would like to find the documentation about Felix SCR annotation Reference
that explains the injection for a list of services.
@Reference
List<ArticleFilter> list;
Is that correct ?
I've found in other places something like :
@Reference(referenceInterface = AspectRatioCalculator.class,
cardinality = ReferenceCardinality.OPTIONAL_MULTIPLE, policy =
ReferencePolicy.DYNAMIC)
private final Map<String, AspectRatioCalculator>
aspectRatioCalculators = new ConcurrentHashMap<String,
AspectRatioCalculator>();
protected void bindAspectRatioCalculators(final AspectRatioCalculator arc) {
this.aspectRatioCalculators.put(arc.getResourceType(), arc);
}
protected void unbindAspectRatioCalculators(final AspectRatioCalculator arc) {
this.aspectRatioCalculators.remove(arc.getResourceType());
}
And in this last case I don't know if the bind/unbind methods are a must,
if not I can use a list of services injections using a Map ? if so, what is
the first type String for ?....
So, is there all this information written in any place in the
documentation ?
Thank you.
[image: Inline image 2]
* Jonathan Vila ** <https://www.twitter.com/jonathan_vila>
<http://www.linkedin.com/in/jonathanvila>*
* [email protected] <[email protected]>*