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

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,680
Members
48,796
Latest member
Greg L.

Latest Threads

Top