URI and return addresses to the caller.
A NameResolver uses the URI's scheme to determine whether it can resolve it, and uses
the components after the scheme for actual resolution.
The addresses and attributes of a target may be changed over time, thus the caller registers a
Listener to receive continuous updates.
A NameResolver does not need to automatically re-resolve on failure. Instead, the
Listener is responsible for eventually (after an appropriate backoff period) invoking
refresh().
Implementations don't need to be thread-safe. All methods are guaranteed to
be called sequentially. Additionally, all methods that have side-effects, i.e.,
start(Listener2), shutdown and refresh are called from the same
SynchronizationContext as returned by Args#getSynchronizationContext. Do
not block within the synchronization context; blocking I/O and time-consuming tasks
should be offloaded to a separate thread, generally Args#getOffloadExecutor.
| Modifier and Type | Class and Description |
|---|---|
| public static class | NameResolver.Args
Information that a |
| public static class | NameResolver.ConfigOrError
Represents either a successfully parsed service config, containing all necessary parts to be later applied by the channel, or a Status containing the error encountered while parsing. |
| public abstract static class | NameResolver.Factory
Factory that creates |
| public static interface | NameResolver.Listener
Receives address updates. |
| public abstract static class | NameResolver.Listener2
Receives address updates. |
| public static class | NameResolver.ResolutionResult
Represents the results from a Name Resolver. |
| public static @interface | NameResolver.ResolutionResultAttr
Annotation for name resolution result attributes. |
| public abstract static class | NameResolver.ServiceConfigParser
Parses and validates service configuration. |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public abstract String | |
| public void | |
| public abstract void | |
| public void | start(final NameResolver.
used to receive updates on the target listenerStarts the resolution. |
| public void |