public class ChangeDispatcher extends java.lang.Object implements Observable, Observer
ChangeDispatcher
instance dispatches content changes
to registered Observer
s.
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 |
---|---|
java.io.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.
|
public ChangeDispatcher(NodeState root)
root
- current root node statepublic java.io.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 Observable
Closeable
instancepublic void contentChanged(NodeState root, CommitInfo info)
Observer
Observer
class javadocs
and relevant repository and observer registration details for more
information on when and how this method gets called.contentChanged
in interface Observer
root
- root state of the repositoryinfo
- commit information"Copyright © 2010 - 2020 Adobe Systems Incorporated. All Rights Reserved"