Package io.grpc.netty
Class NettyChannelProvider
- java.lang.Object
-
- io.grpc.ManagedChannelProvider
-
- io.grpc.netty.NettyChannelProvider
-
@Internal public final class NettyChannelProvider extends ManagedChannelProvider
Provider forNettyChannelBuilder
instances.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class io.grpc.ManagedChannelProvider
ManagedChannelProvider.NewChannelBuilderResult, ManagedChannelProvider.ProviderNotFoundException
-
-
Constructor Summary
Constructors Constructor Description NettyChannelProvider()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description NettyChannelBuilder
builderForAddress(java.lang.String name, int port)
Creates a new builder with the given host and port.NettyChannelBuilder
builderForTarget(java.lang.String target)
Creates a new builder with the given target URI.protected java.util.Collection<java.lang.Class<? extends java.net.SocketAddress>>
getSupportedSocketAddressTypes()
Returns theSocketAddress
types this ManagedChannelProvider supports.boolean
isAvailable()
Whether this provider is available for use, taking the current environment into consideration.ManagedChannelProvider.NewChannelBuilderResult
newChannelBuilder(java.lang.String target, ChannelCredentials creds)
Creates a new builder with the given target URI and credentials.int
priority()
A priority, from 0 to 10 that this provider should be used, taking the current environment into consideration.-
Methods inherited from class io.grpc.ManagedChannelProvider
provider
-
-
-
-
Method Detail
-
isAvailable
public boolean isAvailable()
Description copied from class:ManagedChannelProvider
Whether this provider is available for use, taking the current environment into consideration. Iffalse
, no other methods are safe to be called.- Specified by:
isAvailable
in classManagedChannelProvider
-
priority
public int priority()
Description copied from class:ManagedChannelProvider
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.- Specified by:
priority
in classManagedChannelProvider
-
builderForAddress
public NettyChannelBuilder builderForAddress(java.lang.String name, int port)
Description copied from class:ManagedChannelProvider
Creates a new builder with the given host and port.- Specified by:
builderForAddress
in classManagedChannelProvider
-
builderForTarget
public NettyChannelBuilder builderForTarget(java.lang.String target)
Description copied from class:ManagedChannelProvider
Creates a new builder with the given target URI.- Specified by:
builderForTarget
in classManagedChannelProvider
-
newChannelBuilder
public ManagedChannelProvider.NewChannelBuilderResult newChannelBuilder(java.lang.String target, ChannelCredentials creds)
Description copied from class:ManagedChannelProvider
Creates a new builder with the given target URI and credentials. Returns an error-string result if unable to understand the credentials.- Overrides:
newChannelBuilder
in classManagedChannelProvider
-
getSupportedSocketAddressTypes
protected java.util.Collection<java.lang.Class<? extends java.net.SocketAddress>> getSupportedSocketAddressTypes()
Description copied from class:ManagedChannelProvider
Returns theSocketAddress
types this ManagedChannelProvider supports.- Specified by:
getSupportedSocketAddressTypes
in classManagedChannelProvider
-
-