Package io.grpc.internal
Class NameResolverFactoryToProviderFacade
java.lang.Object
io.grpc.NameResolver.Factory
io.grpc.NameResolverProvider
io.grpc.internal.NameResolverFactoryToProviderFacade
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the default scheme, which will be used to construct a URI whenManagedChannelBuilder.forTarget(String)is given an authority string instead of a compliant URI.protected booleanWhether this provider is available for use, taking the current environment into consideration.newNameResolver(URI targetUri, NameResolver.Args args) Creates aNameResolverfor the given target URI, ornullif the given URI cannot be resolved by this factory.protected intpriority()A priority, from 0 to 10 that this provider should be used, taking the current environment into consideration.Methods inherited from class io.grpc.NameResolverProvider
getProducedSocketAddressTypes, getScheme
-
Field Details
-
factory
-
-
Constructor Details
-
NameResolverFactoryToProviderFacade
NameResolverFactoryToProviderFacade(NameResolver.Factory factory)
-
-
Method Details
-
newNameResolver
Description copied from class:NameResolver.FactoryCreates aNameResolverfor the given target URI, ornullif the given URI cannot be resolved by this factory. The decision should be solely based on the scheme of the URI.- Specified by:
newNameResolverin classNameResolver.Factory- Parameters:
targetUri- the target URI to be resolved, whose scheme must not benullargs- other information that may be useful
-
getDefaultScheme
Description copied from class:NameResolver.FactoryReturns the default scheme, which will be used to construct a URI whenManagedChannelBuilder.forTarget(String)is given an authority string instead of a compliant URI.- Specified by:
getDefaultSchemein classNameResolver.Factory
-
isAvailable
protected boolean isAvailable()Description copied from class:NameResolverProviderWhether this provider is available for use, taking the current environment into consideration. Iffalse, no other methods are safe to be called.- Specified by:
isAvailablein classNameResolverProvider
-
priority
protected int priority()Description copied from class:NameResolverProviderA priority, from 0 to 10 that this provider should be used, taking the current environment into consideration. 5 should be considered the default, and then tweaked based on environment detection. A priority of 0 does not imply that the provider wouldn't work; just that it should be last in line.- Specified by:
priorityin classNameResolverProvider
-