public class ChangeDispatcher extends Object implements Observable, Observer
ChangeDispatcher instance dispatches content changes
to registered Observers.
Changes are reported by calling contentChanged(NodeState, CommitInfo).
The addObserver(Observer) method registers an Observer for receiving
notifications for all changes reported to this instance.
| Constructor and Description |
|---|
ChangeDispatcher(NodeState root)
Create a new instance for dispatching content changes
|
| Modifier and Type | Method and Description |
|---|---|
Closeable |
addObserver(Observer observer)
Register a new
Observer for receiving notifications about changes reported to
this change dispatcher. |
void |
contentChanged(NodeState root,
CommitInfo info)
Observes a content change.
|
@Nonnull public Closeable addObserver(Observer observer)
Observer for receiving notifications about changes reported to
this change dispatcher. Changes are reported synchronously and clients need to ensure
to no block any length of time (e.g. by relaying through a BackgroundObserver).
Clients need to call Closeable.close() close} on the returned
Closeable instance to stop receiving notifications.
addObserver in interface ObservableCloseable instancepublic void contentChanged(@Nonnull NodeState root, @Nonnull CommitInfo info)
ObserverObserver class javadocs
and relevant repository and observer registration details for more
information on when and how this method gets called.contentChanged in interface Observerroot - root state of the repositoryinfo - commit informationCopyright © 2012–2017 The Apache Software Foundation. All rights reserved.