Observer
interface when it wants to be informed of changes in observable objects.
@author Chris Warth
@version 1.20, 11/17/05
@see java.util.Observable
@since JDK1.0
Each observer is guaranteed to see a linear sequence of changes, i.e. the "after" state of one method call is guaranteed to be the "before" state of the following call. This sequence of changes only applies while a hook is registered with a specific repository instance, and is thus for example not guaranteed across repository restarts. Note also that two observers may not necessarily see the same sequence of content changes, and each commit does not necessarily trigger a separate observer callback. It is also possible for an observer to be notified when no actual changes have been committed. A specific implementation or deployment may offer more guarantees about when and how observers are notified of content changes. See the relevant documentation for more details about such cases.
@since Oak 0.3
An Observer is the corresponding interface to the Observable
: The Observer is watching the Observable.
If the Observable changes its state, it calls the Observers setObservableState()
method.
IObserver
implementation. An Observer
is an object that encapsulates information about an interested object with a method that should be called when a particular INotification
is broadcast.
In PureMVC, the Observer
class assumes these responsibilities:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|