Package com.linecorp.armeria.xds
Interface XdsBootstrap
- All Superinterfaces:
AutoCloseable
,SafeCloseable
An
XdsBootstrap
encapsulates all logic to communicate with control plane servers
to fetch xDS resources locally. Users may choose to watch resources and listen to event
updates using this class. The appropriate resources are found from a Bootstrap
that can be provided like the following:
Bootstrap bootstrap = ...;
XdsBootstrap xdsBootstrap = XdsBootstrap.of(bootstrap);
ListenerRoot root = xdsBootstrap.listenerRoot("listener1");
root.addSnapshotWatcher(...);
root.close();
Initializing a XdsBootstrap
does not consume any resources until a resource is subscribed
via listenerRoot(String)
or its variants.
Note that it is important to close the ListenerRoot
or ClusterRoot
after usage to avoid leaking resources.
Closing the XdsBootstrap
will also close all connections and relevant resources.-
Method Summary
Modifier and TypeMethodDescriptionclusterRoot
(String resourceName) Represents aCluster
root node of a bootstrap.io.netty.util.concurrent.EventExecutor
Returns the event loop used to notify events.listenerRoot
(String resourceName) Represents aListener
root node of a bootstrap.static XdsBootstrap
of
(io.envoyproxy.envoy.config.bootstrap.v3.Bootstrap bootstrap) Constructs aXdsBootstrap
which watches resources using the providedBootstrap
.static XdsBootstrap
of
(io.envoyproxy.envoy.config.bootstrap.v3.Bootstrap bootstrap, io.netty.util.concurrent.EventExecutor eventLoop) Constructs aXdsBootstrap
which watches resources using the providedBootstrap
.Methods inherited from interface com.linecorp.armeria.common.util.SafeCloseable
close
-
Method Details
-
of
Constructs aXdsBootstrap
which watches resources using the providedBootstrap
. -
of
@UnstableApi static XdsBootstrap of(io.envoyproxy.envoy.config.bootstrap.v3.Bootstrap bootstrap, io.netty.util.concurrent.EventExecutor eventLoop) Constructs aXdsBootstrap
which watches resources using the providedBootstrap
. -
listenerRoot
Represents aListener
root node of a bootstrap. Users may hook watchers to the root node to listen to events. -
clusterRoot
Represents aCluster
root node of a bootstrap. Users may hook watchers to the root node to listen to events. -
eventLoop
io.netty.util.concurrent.EventExecutor eventLoop()Returns the event loop used to notify events.
-