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(@NotNull NodeState root)
Create a new instance for dispatching content changes
|
Modifier and Type | Method and Description |
---|---|
@NotNull java.io.Closeable |
addObserver(Observer observer)
Register a new
Observer for receiving notifications about changes reported to
this change dispatcher. |
void |
contentChanged(@NotNull NodeState root,
@NotNull CommitInfo info)
Observes a content change.
|
public ChangeDispatcher(@NotNull @NotNull NodeState root)
root
- current root node state@NotNull public @NotNull 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(@NotNull @NotNull NodeState root, @NotNull @NotNull 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 informationCopyright © 2010 - 2020 Adobe. All Rights Reserved