T - The records typepublic interface ChangeNotifier<T>
DnsSrvWatcher.
The records can be of any type. Usually something that directly reflects what your application will use the records for.
A ChangeNotifier.Listener can be attached to listen to change events on the watched set of records.
| Modifier and Type | Interface and Description |
|---|---|
static interface |
ChangeNotifier.ChangeNotification<T>
A change event containing the current and previous set of records.
|
static interface |
ChangeNotifier.Listener<T>
A listener which will be called when the set of records change
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Close this
ChangeNotifier, releasing any resources allocated. |
Set<T> |
current()
Get the current set of records.
|
void |
setListener(ChangeNotifier.Listener<T> listener,
boolean fire)
Set a listener to be called when the set of records change.
|
void setListener(ChangeNotifier.Listener<T> listener, boolean fire)
One one listener can be added. Multiple calls to this method is an error.
listener - The listener to setfire - Fire the notification event immediately. Can be used to ensure that no updates
are missed when setting the listenerIllegalStateException - if called more than oncevoid close()
ChangeNotifier, releasing any resources allocated. Once closed, no more
ChangeNotifier.Listener events will be fired. Implementations of ChangeNotifier are not
allowed to throw checked exceptions from close().Copyright © 2017. All rights reserved.