@ExperimentalApi @ThreadSafe public final class NameResolverRegistry extends NameResolver.Factory
NameResolver.Factorys and dispatches target URI to the
first one that can handle it.PARAMS_DEFAULT_PORT| Modifier and Type | Method and Description |
|---|---|
static NameResolverRegistry |
getDefaultRegistry() |
String |
getDefaultScheme()
Returns the default scheme, which will be used to construct a URI when
ManagedChannelBuilder.forTarget(String) is given an authority string instead of a compliant
URI. |
NameResolver |
newNameResolver(URI targetUri,
Attributes params)
Returns a
NameResolver created by the first factory that can handle the given target
URI, or null if no one can handle it. |
void |
register(NameResolver.Factory factory)
Registers a
NameResolver.Factory. |
public static NameResolverRegistry getDefaultRegistry()
public void register(NameResolver.Factory factory)
NameResolver.Factory.public NameResolver newNameResolver(URI targetUri, Attributes params)
NameResolver created by the first factory that can handle the given target
URI, or null if no one can handle it.
The factory that was registered later has higher priority.
newNameResolver in class NameResolver.FactorytargetUri - the target URI to be resolved, whose scheme must not be nullparams - optional parameters. Canonical keys are defined as PARAMS_* fields in
NameResolver.Factory.public String getDefaultScheme()
NameResolver.FactoryManagedChannelBuilder.forTarget(String) is given an authority string instead of a compliant
URI.getDefaultScheme in class NameResolver.Factory