rk Hoheisel,Christoph Kübel, Uwe Raschke, Peter Tyroller
Von: osgi-dev-boun...@mail.osgi.org [mailto:osgi-dev-boun...@mail.osgi.org] Im Auftrag von Tim WardGesendet: Freitag, 21. Juli 2017 00:03An: OSGi Developer Mail List Betreff: Re: [osgi-dev] Regarding Collection references
Hi Scott
Betreff: Re: [osgi-dev] Regarding Collection references
Hi Scott,
The SCR annotations are interpreted based on the context of where they are
applied. This is described in the JavaDoc for the annotations, and the DS spec.
Because you have declared your SCR reference as a final field this mean
Hi Scott,
The SCR annotations are interpreted based on the context of where they are
applied. This is described in the JavaDoc for the annotations, and the DS spec.
Because you have declared your SCR reference as a final field this means that
the SCR will be told to update your collection usin
Thats is not a safe collection type. Why not let DS manage the field?
If you need to use a final field, then you need to use a thread safe collection.
--BJ HargraveSenior Technical Staff Member, IBM // office: +1 386 848 1781OSGi Fellow and CTO of the OSGi Alliance // mobile: +1 386 848 3788hargr
If I have a reference in an SCR component like the following,
@Reference(policy = ReferencePolicy.DYNAMIC)
private final Collection factories = new java.util.ArrayList<>();
Since the collection is updated by the runtime as services come and go, I
assume it's prudent to synchronize
on the collect