Package io.grpc
Class NameResolver.Factory
java.lang.Object
io.grpc.NameResolver.Factory
- Direct Known Subclasses:
NameResolverProvider
- Enclosing class:
NameResolver
@ExperimentalApi("https://github.com/grpc/grpc-java/issues/1770")
public abstract static class NameResolver.Factory
extends Object
Factory that creates
NameResolver
instances.- Since:
- 1.0.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract String
Returns the default scheme, which will be used to construct a URI whenManagedChannelBuilder.forTarget(String)
is given an authority string instead of a compliant URI.abstract NameResolver
newNameResolver
(URI targetUri, NameResolver.Args args) Creates aNameResolver
for the given target URI, ornull
if the given URI cannot be resolved by this factory.
-
Constructor Details
-
Factory
public Factory()
-
-
Method Details
-
newNameResolver
Creates aNameResolver
for the given target URI, ornull
if the given URI cannot be resolved by this factory. The decision should be solely based on the scheme of the URI.- Parameters:
targetUri
- the target URI to be resolved, whose scheme must not benull
args
- other information that may be useful- Since:
- 1.21.0
-
getDefaultScheme
Returns the default scheme, which will be used to construct a URI whenManagedChannelBuilder.forTarget(String)
is given an authority string instead of a compliant URI.- Since:
- 1.0.0
-