Observable class

J

JKV

I have a question on the use of the Observable class and the notifyObservers
method. I wonder what the contract is. If the method returns, can you rely
on the fact that all update methods of the observers ran completely? Or is
this not guaranteed?

From the Java API doc I understood that the update methods can run on
different threads, depending on the implementation of the actual
notifyObservers method. Is that a correct understanding?

Thanks,

Jan
 
W

William Brogden

JKV said:
I have a question on the use of the Observable class and the notifyObservers
method. I wonder what the contract is. If the method returns, can you rely
on the fact that all update methods of the observers ran completely? Or is
this not guaranteed?

From the Java API doc I understood that the update methods can run on
different threads, depending on the implementation of the actual
notifyObservers method. Is that a correct understanding?

It looks to me like all of the update methods are executed by the Thread
that runs the notifyObservers method.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top