Package io.grpc.netty

Class GrpcHttp2ConnectionHandler

  • All Implemented Interfaces:
    io.netty.channel.ChannelHandler, io.netty.channel.ChannelInboundHandler, io.netty.channel.ChannelOutboundHandler, io.netty.handler.codec.http2.Http2LifecycleManager
    Direct Known Subclasses:
    AbstractNettyHandler

    @Internal
    public abstract class GrpcHttp2ConnectionHandler
    extends io.netty.handler.codec.http2.Http2ConnectionHandler
    gRPC wrapper for Http2ConnectionHandler.
    • Nested Class Summary

      • Nested classes/interfaces inherited from class io.netty.handler.codec.ByteToMessageDecoder

        io.netty.handler.codec.ByteToMessageDecoder.Cumulator
      • Nested classes/interfaces inherited from interface io.netty.channel.ChannelHandler

        io.netty.channel.ChannelHandler.Sharable
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected GrpcHttp2ConnectionHandler​(io.netty.channel.ChannelPromise channelUnused, io.netty.handler.codec.http2.Http2ConnectionDecoder decoder, io.netty.handler.codec.http2.Http2ConnectionEncoder encoder, io.netty.handler.codec.http2.Http2Settings initialSettings, ChannelLogger negotiationLogger)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      java.lang.String getAuthority()
      Returns the authority of the server.
      Attributes getEagAttributes()
      Get the attributes of the EquivalentAddressGroup used to create this transport.
      ChannelLogger getNegotiationLogger()
      Returns the channel logger for the given channel context.
      void handleProtocolNegotiationCompleted​(Attributes attrs)
      Deprecated.
      Use the two argument method instead.
      void handleProtocolNegotiationCompleted​(Attributes attrs, InternalChannelz.Security securityInfo)
      Triggered on protocol negotiation completion.
      void notifyUnused()
      Calling this method indicates that the channel will no longer be used.
      (package private) static boolean usingPre4_1_111_Netty()  
      • Methods inherited from class io.netty.handler.codec.http2.Http2ConnectionHandler

        bind, channelActive, channelInactive, channelReadComplete, channelWritabilityChanged, close, closeStream, closeStreamLocal, closeStreamRemote, connect, connection, decode, decoder, deregister, disconnect, encoder, exceptionCaught, flush, frameWriter, goAway, gracefulShutdownTimeoutMillis, gracefulShutdownTimeoutMillis, handlerAdded, handlerRemoved0, handleServerHeaderDecodeSizeError, isGracefulShutdownComplete, onConnectionError, onError, onHttpClientUpgrade, onHttpServerUpgrade, onStreamError, read, resetStream, write
      • Methods inherited from class io.netty.handler.codec.ByteToMessageDecoder

        actualReadableBytes, callDecode, channelRead, decodeLast, discardSomeReadBytes, handlerRemoved, internalBuffer, isSingleDecode, setCumulator, setDiscardAfterReads, setSingleDecode, userEventTriggered
      • Methods inherited from class io.netty.channel.ChannelInboundHandlerAdapter

        channelRegistered, channelUnregistered
      • Methods inherited from class io.netty.channel.ChannelHandlerAdapter

        ensureNotSharable, isSharable
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface io.netty.channel.ChannelHandler

        handlerRemoved
    • Field Detail

      • ADAPTIVE_CUMULATOR_COMPOSE_MIN_SIZE_DEFAULT

        static final int ADAPTIVE_CUMULATOR_COMPOSE_MIN_SIZE_DEFAULT
        See Also:
        Constant Field Values
      • ADAPTIVE_CUMULATOR

        static final io.netty.handler.codec.ByteToMessageDecoder.Cumulator ADAPTIVE_CUMULATOR
      • channelUnused

        @Nullable
        protected final io.netty.channel.ChannelPromise channelUnused
      • negotiationLogger

        private final ChannelLogger negotiationLogger
      • usingPre4_1_111_Netty

        private static final boolean usingPre4_1_111_Netty
    • Constructor Detail

      • GrpcHttp2ConnectionHandler

        protected GrpcHttp2ConnectionHandler​(io.netty.channel.ChannelPromise channelUnused,
                                             io.netty.handler.codec.http2.Http2ConnectionDecoder decoder,
                                             io.netty.handler.codec.http2.Http2ConnectionEncoder encoder,
                                             io.netty.handler.codec.http2.Http2Settings initialSettings,
                                             ChannelLogger negotiationLogger)
    • Method Detail

      • usingPre4_1_111_Netty

        static boolean usingPre4_1_111_Netty()
      • handleProtocolNegotiationCompleted

        public void handleProtocolNegotiationCompleted​(Attributes attrs,
                                                       InternalChannelz.Security securityInfo)
        Triggered on protocol negotiation completion.

        It must me called after negotiation is completed but before given handler is added to the channel.

        Parameters:
        attrs - arbitrary attributes passed after protocol negotiation (eg. SSLSession).
        securityInfo - informs channelz about the security protocol.
      • getNegotiationLogger

        public ChannelLogger getNegotiationLogger()
        Returns the channel logger for the given channel context.
      • notifyUnused

        public void notifyUnused()
        Calling this method indicates that the channel will no longer be used. This method is roughly the same as calling Http2ConnectionHandler.close(io.netty.channel.ChannelHandlerContext, io.netty.channel.ChannelPromise) on the channel, but leaving the channel alive. This is useful if the channel will soon be deregistered from the executor and used in a non-Netty context.
      • getEagAttributes

        public Attributes getEagAttributes()
        Get the attributes of the EquivalentAddressGroup used to create this transport.
      • getAuthority

        public java.lang.String getAuthority()
        Returns the authority of the server. Only available on the client-side.
        Throws:
        java.lang.UnsupportedOperationException - if on server-side