felix-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Raymond Auge <raymond.a...@liferay.com>
Subject Re: Declarative Services problems in Apache Karaf
Date Fri, 17 Nov 2017 12:08:19 GMT
On Nov 17, 2017 7:04 AM, "Raymond Auge" <raymond.auge@liferay.com> wrote:

Hey Marco,

Now that your reference will be properly dynamic, multiple, I hope that

private B b;

as a non-volatile field is just an over simplification in your example. DS
concurrently calls


.. dynamic ..

bind methods on your component so setting of the non-volatile private field
will be dangerous. You'll want to ensure that you handle that, such as
making b volatile and making method local copies of b before using it. You
could also use an AtomicReference<B> instead.

There are also several other non-obvious concerns if you're gonna manage
your own "collection" of services. So take care with that.

Sincerely,
- Ray



On Nov 17, 2017 5:22 AM, "MarcoF90" <marco.fierimonte@gmail.com> wrote:

Hi Neil,

thank you for your answer, this further difference is clear to me.

Kind regards,
Marco



--
Sent from: http://apache-felix.18485.x6.nabble.com/Apache-Felix-Users-f
4833200.html

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message