Java.util.Observable, clients will complete their update () before continuing

When i call:

setChanged();
notifyObservers();

in the class java.until.Observable, all listening Observer objects complete their udpate () methods - if we work in the same thread - before the class java.until.Observablecontinues to work?

This is important because I will send several messages using the method notifyObservers(Object o)in fast concession, it is important that each Observer class complete its method to a new one.

I understand that the execution order for each Observer class can change when called notifyObservers()- it is simply important that the execution order of the method for each individual instance is in order.

+3
source share
4

java.util.Observable , . , , .

notifyObservers(Object o):

, hasChanged, , clearChanged, , . , : arg.

, . , notifyObservers(Object o) , .

, java.util.Observer.update(Observable a, Object arg) . , notifyObservers(Object o) , , , Observer.update(Observable a, Object arg) . , , .

Observers, Observables, , , notifyObservers(Object o) update(Observable o, Object arg).

+3

Observable . , update() , , - - , , . , Java 1.6, .

+1

, notifyObservers() ... ... , .. , notifyObserver() . notifyObserver() , , update().

0

" , Observable, , , , , , , ". , . , @Jacob Tomaw.

:" , , , ( ).

0

Source: https://habr.com/ru/post/1748031/


All Articles