Package io.grpc.netty
Class ProtocolNegotiators.ClientTlsProtocolNegotiator
- java.lang.Object
-
- io.grpc.netty.ProtocolNegotiators.ClientTlsProtocolNegotiator
-
- All Implemented Interfaces:
ProtocolNegotiator
- Enclosing class:
- ProtocolNegotiators
static final class ProtocolNegotiators.ClientTlsProtocolNegotiator extends java.lang.Object implements ProtocolNegotiator
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface io.grpc.netty.ProtocolNegotiator
ProtocolNegotiator.ClientFactory, ProtocolNegotiator.ServerFactory
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.concurrent.Executorexecutorprivate ObjectPool<? extends java.util.concurrent.Executor>executorPoolprivate java.util.Optional<java.lang.Runnable>handshakeCompleteRunnableprivate io.netty.handler.ssl.SslContextsslContext
-
Constructor Summary
Constructors Constructor Description ClientTlsProtocolNegotiator(io.netty.handler.ssl.SslContext sslContext, ObjectPool<? extends java.util.concurrent.Executor> executorPool, java.util.Optional<java.lang.Runnable> handshakeCompleteRunnable)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Releases resources held by this negotiator.io.netty.channel.ChannelHandlernewHandler(GrpcHttp2ConnectionHandler grpcHandler)Creates a new handler to control the protocol negotiation.io.netty.util.AsciiStringscheme()The HTTP/2 scheme to be used when sendingHEADERS.
-
-
-
Field Detail
-
sslContext
private final io.netty.handler.ssl.SslContext sslContext
-
executorPool
private final ObjectPool<? extends java.util.concurrent.Executor> executorPool
-
handshakeCompleteRunnable
private final java.util.Optional<java.lang.Runnable> handshakeCompleteRunnable
-
executor
private java.util.concurrent.Executor executor
-
-
Constructor Detail
-
ClientTlsProtocolNegotiator
public ClientTlsProtocolNegotiator(io.netty.handler.ssl.SslContext sslContext, ObjectPool<? extends java.util.concurrent.Executor> executorPool, java.util.Optional<java.lang.Runnable> handshakeCompleteRunnable)
-
-
Method Detail
-
scheme
public io.netty.util.AsciiString scheme()
Description copied from interface:ProtocolNegotiatorThe HTTP/2 scheme to be used when sendingHEADERS.- Specified by:
schemein interfaceProtocolNegotiator
-
newHandler
public io.netty.channel.ChannelHandler newHandler(GrpcHttp2ConnectionHandler grpcHandler)
Description copied from interface:ProtocolNegotiatorCreates a new handler to control the protocol negotiation. Once the negotiation has completed successfully, the provided handler is installed. Must callgrpcHandler.onHandleProtocolNegotiationCompleted()at certain point if the negotiation has completed successfully.- Specified by:
newHandlerin interfaceProtocolNegotiator
-
close
public void close()
Description copied from interface:ProtocolNegotiatorReleases resources held by this negotiator. Called when the Channel transitions to terminated or when InternalServer is shutdown (depending on client or server). That means handlers returned byProtocolNegotiator.newHandler(io.grpc.netty.GrpcHttp2ConnectionHandler)can outlive their parent negotiator on server-side, but not on client-side.- Specified by:
closein interfaceProtocolNegotiator
-
-