Oh Sorry :/

Those combinations with cardinalities optional/mandatory have been assigned to ITest, those with multiple/at_least_one have been assigned to List<ITest>.

I didn't think it makes sense to assign them vice versa, e.g., ITest with multiple or List<ITest> with mandatory? Or am I wrong? If so, in what case would you use such a combination?

Kind regards,
Thomas

------ Originalnachricht ------
Von: "Raymond Auge" <raymond.a...@liferay.com>
An: "Thomas Driessen" <thomas.driessen...@gmail.com>; "OSGi Developer Mail List" <osgi-dev@mail.osgi.org>
Gesendet: 16.02.2019 17:42:19
Betreff: Re: [osgi-dev] Clarification on reference behavior regarding field injection

You're chart doesn't appear to list _which_ field (Reference) was associated with any given line (collection vs. scalar). It makes a difference.

- Ray

On Sat, Feb 16, 2019 at 9:15 AM Thomas Driessen via osgi-dev <osgi-dev@mail.osgi.org> wrote:
Hi,

I'm trying to get an overview over the effects of different combinations of cardinality, policy and policyOption within a @Reference annotation for a field.

My Example looks like this:

@Component
public class MyComp{
  @Reference(...)
  ITest myTest;

  @Reference(...)
  List<ITest> myTests;
}

and the observed behavior for this setup with different combinations of the above named properties is:


I'm especially interested in the yellow marked cases: Is this an intended behavior?

Kind regards,
Thomas
_______________________________________________
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev


--
Raymond Augé <http://www.liferay.com/web/raymond.auge/profile> (@rotty3000) Senior Software Architect Liferay, Inc. <http://www.liferay.com> (@Liferay) Board Member & EEG Co-Chair, OSGi Alliance <http://osgi.org> (@OSGiAlliance)
_______________________________________________
OSGi Developer Mail List
osgi-dev@mail.osgi.org
https://mail.osgi.org/mailman/listinfo/osgi-dev

Reply via email to