Package io.grpc
Class NameResolverProvider
- java.lang.Object
-
- io.grpc.NameResolver.Factory
-
- io.grpc.NameResolverProvider
-
@ExperimentalApi("https://github.com/grpc/grpc-java/issues/4159") public abstract class NameResolverProvider extends NameResolver.Factory
Provider of name resolvers for name agnostic consumption.Implementations should not throw. If they do, it may interrupt class loading. If exceptions may reasonably occur for implementation-specific reasons, implementations should generally handle the exception gracefully and return
falsefromisAvailable().
-
-
Field Summary
Fields Modifier and Type Field Description static Attributes.Key<java.lang.Integer>PARAMS_DEFAULT_PORTDeprecated.-
Fields inherited from class io.grpc.NameResolver.Factory
PARAMS_PROXY_DETECTOR
-
-
Constructor Summary
Constructors Constructor Description NameResolverProvider()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static NameResolver.FactoryasFactory()Deprecated.Use NameResolverRegistry.getDefaultRegistry().asFactory()protected abstract booleanisAvailable()Whether this provider is available for use, taking the current environment into consideration.protected abstract intpriority()A priority, from 0 to 10 that this provider should be used, taking the current environment into consideration.static java.util.List<NameResolverProvider>providers()Deprecated.Has no replacement-
Methods inherited from class io.grpc.NameResolver.Factory
getDefaultScheme, newNameResolver, newNameResolver, newNameResolver
-
-
-
-
Field Detail
-
PARAMS_DEFAULT_PORT
@Deprecated public static final Attributes.Key<java.lang.Integer> PARAMS_DEFAULT_PORT
Deprecated.The port number used in case the target or the underlying naming system doesn't provide a port number.- Since:
- 1.0.0
-
-
Method Detail
-
providers
@Deprecated public static java.util.List<NameResolverProvider> providers()
Deprecated.Has no replacementReturns non-nullClassLoader-wide providers, in preference order.- Since:
- 1.0.0
-
asFactory
@Deprecated public static NameResolver.Factory asFactory()
Deprecated.Use NameResolverRegistry.getDefaultRegistry().asFactory()- Since:
- 1.0.0
-
isAvailable
protected abstract boolean isAvailable()
Whether this provider is available for use, taking the current environment into consideration. Iffalse, no other methods are safe to be called.- Since:
- 1.0.0
-
priority
protected abstract int priority()
A 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.- Since:
- 1.0.0
-
-