Package io.grpc
Class NameResolver.Args
java.lang.Object
io.grpc.NameResolver.Args
- Enclosing class:
- NameResolver
@ExperimentalApi("https://github.com/grpc/grpc-java/issues/1770")
public static final class NameResolver.Args
extends Object
Information that a
NameResolver.Factory uses to create a NameResolver.
Note this class doesn't override neither equals() nor hashCode().
- Since:
- 1.21.0
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionReturns theChannelLoggerfor the Channel served by this NameResolver.intThe port number used in case the target or the underlying naming system doesn't provide a port number.Returns the Executor on which this resolver should execute long-running or I/O bound work.Returns the overrideAuthority from channelManagedChannelBuilder.overrideAuthority(java.lang.String).If the NameResolver wants to support proxy, it should inquire thisProxyDetector.Returns aScheduledExecutorServicefor scheduling delayed tasks.Returns theNameResolver.ServiceConfigParser.Returns theSynchronizationContextwhereNameResolver.start(Listener2),NameResolver.shutdown()andNameResolver.refresh()are run from.static NameResolver.Args.BuilderCreates a new builder.Returns a builder with the same initial values as this object.toString()
-
Method Details
-
getDefaultPort
public int getDefaultPort()The port number used in case the target or the underlying naming system doesn't provide a port number.- Since:
- 1.21.0
-
getProxyDetector
If the NameResolver wants to support proxy, it should inquire thisProxyDetector. See documentation onProxyDetectorabout how proxies work in gRPC.- Since:
- 1.21.0
-
getSynchronizationContext
Returns theSynchronizationContextwhereNameResolver.start(Listener2),NameResolver.shutdown()andNameResolver.refresh()are run from.- Since:
- 1.21.0
-
getScheduledExecutorService
@ExperimentalApi("https://github.com/grpc/grpc-java/issues/6454") public ScheduledExecutorService getScheduledExecutorService()Returns aScheduledExecutorServicefor scheduling delayed tasks.This service is a shared resource and is only meant for quick tasks. DO NOT block or run time-consuming tasks.
The returned service doesn't support
shutdown()andshutdownNow(). They will throw if called.- Since:
- 1.26.0
-
getServiceConfigParser
Returns theNameResolver.ServiceConfigParser.- Since:
- 1.21.0
-
getChannelLogger
@ExperimentalApi("https://github.com/grpc/grpc-java/issues/6438") public ChannelLogger getChannelLogger()Returns theChannelLoggerfor the Channel served by this NameResolver.- Since:
- 1.26.0
-
getOffloadExecutor
Returns the Executor on which this resolver should execute long-running or I/O bound work. Null if no Executor was set.- Since:
- 1.25.0
-
getOverrideAuthority
@Nullable @ExperimentalApi("https://github.com/grpc/grpc-java/issues/9406") public String getOverrideAuthority()Returns the overrideAuthority from channelManagedChannelBuilder.overrideAuthority(java.lang.String). Overrides the host name for L7 HTTP virtual host matching. Almost all name resolvers should not use this.- Since:
- 1.49.0
-
toString
-
toBuilder
Returns a builder with the same initial values as this object.- Since:
- 1.21.0
-
newBuilder
Creates a new builder.- Since:
- 1.21.0
-