Package com.linecorp.armeria.xds
Class ListenerRoot
java.lang.Object
com.linecorp.armeria.xds.ListenerRoot
- All Implemented Interfaces:
SafeCloseable
,SnapshotWatcher<ListenerSnapshot>
,AutoCloseable
A root node representing a
Listener
.
Users may query the latest value of this resource or add a watcher to be notified of changes.
Note that it is important to close this resource to avoid leaking connections to the control plane server.-
Method Summary
Modifier and TypeMethodDescriptionvoid
addSnapshotWatcher
(SnapshotWatcher<? super ListenerSnapshot> watcher) Adds a watcher which waits for a snapshot update.void
close()
void
Invoked when an unexpected error occurs while processing a resource.void
Invoked when a resource is deemed not to exist.void
removeSnapshotWatcher
(SnapshotWatcher<? super ListenerSnapshot> watcher) Removes a watcher which waits for a snapshot update.void
snapshotUpdated
(ListenerSnapshot newSnapshot) Invoked when a full snapshot is updated.
-
Method Details
-
close
public void close()- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceSafeCloseable
-
addSnapshotWatcher
Adds a watcher which waits for a snapshot update. -
removeSnapshotWatcher
Removes a watcher which waits for a snapshot update. -
snapshotUpdated
Description copied from interface:SnapshotWatcher
Invoked when a full snapshot is updated.- Specified by:
snapshotUpdated
in interfaceSnapshotWatcher<T extends Snapshot<? extends XdsResource>>
-
onMissing
Description copied from interface:SnapshotWatcher
Invoked when a resource is deemed not to exist. This can either be due to a timeout on a watch, or the xDS control plane explicitly signalling a resource is missing.- Specified by:
onMissing
in interfaceSnapshotWatcher<T extends Snapshot<? extends XdsResource>>
-
onError
Description copied from interface:SnapshotWatcher
Invoked when an unexpected error occurs while processing a resource.- Specified by:
onError
in interfaceSnapshotWatcher<T extends Snapshot<? extends XdsResource>>
-