Class AbstractNettyHandler
java.lang.Object
io.netty.channel.ChannelHandlerAdapter
io.netty.channel.ChannelInboundHandlerAdapter
io.netty.handler.codec.ByteToMessageDecoder
io.netty.handler.codec.http2.Http2ConnectionHandler
io.grpc.netty.GrpcHttp2ConnectionHandler
io.grpc.netty.AbstractNettyHandler
- All Implemented Interfaces:
io.netty.channel.ChannelHandler, io.netty.channel.ChannelInboundHandler, io.netty.channel.ChannelOutboundHandler, io.netty.handler.codec.http2.Http2LifecycleManager
- Direct Known Subclasses:
NettyClientHandler, NettyServerHandler
Base class for all Netty gRPC handlers. This class standardizes exception handling (always
shutdown the connection) as well as sending the initial connection window at startup.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static final class(package private) final classClass for handling flow control pinging and flow control window updates as necessary.static interfaceControls whether PINGs like those for BDP are permitted to be sent at the current time.Nested classes/interfaces inherited from class io.netty.handler.codec.ByteToMessageDecoder
io.netty.handler.codec.ByteToMessageDecoder.CumulatorNested classes/interfaces inherited from interface io.netty.channel.ChannelHandler
io.netty.channel.ChannelHandler.Sharable -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate booleanprivate static final longprivate io.netty.channel.ChannelHandlerContextprivate final AbstractNettyHandler.FlowControlPingerprivate static final longprivate final intprivate booleanprivate final com.google.common.base.TickerFields inherited from class GrpcHttp2ConnectionHandler
ADAPTIVE_CUMULATOR, ADAPTIVE_CUMULATOR_COMPOSE_MIN_SIZE_DEFAULT, channelUnusedFields inherited from class io.netty.handler.codec.ByteToMessageDecoder
COMPOSITE_CUMULATOR, MERGE_CUMULATOR -
Constructor Summary
ConstructorsConstructorDescriptionAbstractNettyHandler(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, boolean autoFlowControl, AbstractNettyHandler.PingLimiter pingLimiter, com.google.common.base.Ticker ticker) -
Method Summary
Modifier and TypeMethodDescriptionvoidchannelActive(io.netty.channel.ChannelHandlerContext ctx) protected final io.netty.channel.ChannelHandlerContextctx()final voidexceptionCaught(io.netty.channel.ChannelHandlerContext ctx, Throwable cause) (package private) AbstractNettyHandler.FlowControlPingervoidhandlerAdded(io.netty.channel.ChannelHandlerContext ctx) private voidSends initial connection window to the remote endpoint if necessary.(package private) voidsetAutoTuneFlowControl(boolean isOn) Methods inherited from class GrpcHttp2ConnectionHandler
getAuthority, getEagAttributes, getNegotiationLogger, handleProtocolNegotiationCompleted, handleProtocolNegotiationCompleted, notifyUnused, usingPre4_1_111_NettyMethods inherited from class io.netty.handler.codec.http2.Http2ConnectionHandler
bind, channelInactive, channelReadComplete, channelWritabilityChanged, close, closeStream, closeStreamLocal, closeStreamRemote, connect, connection, decode, decoder, deregister, disconnect, encoder, flush, frameWriter, goAway, gracefulShutdownTimeoutMillis, gracefulShutdownTimeoutMillis, handlerRemoved0, handleServerHeaderDecodeSizeError, isGracefulShutdownComplete, onConnectionError, onError, onHttpClientUpgrade, onHttpServerUpgrade, onStreamError, read, resetStream, writeMethods inherited from class io.netty.handler.codec.ByteToMessageDecoder
actualReadableBytes, callDecode, channelRead, decodeLast, discardSomeReadBytes, handlerRemoved, internalBuffer, isSingleDecode, setCumulator, setDiscardAfterReads, setSingleDecode, userEventTriggeredMethods inherited from class io.netty.channel.ChannelInboundHandlerAdapter
channelRegistered, channelUnregisteredMethods inherited from class io.netty.channel.ChannelHandlerAdapter
ensureNotSharable, isSharableMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.netty.channel.ChannelHandler
handlerRemoved
-
Field Details
-
GRACEFUL_SHUTDOWN_NO_TIMEOUT
private static final long GRACEFUL_SHUTDOWN_NO_TIMEOUT- See Also:
-
initialConnectionWindow
private final int initialConnectionWindow -
flowControlPing
-
autoTuneFlowControlOn
private boolean autoTuneFlowControlOn -
ctx
private io.netty.channel.ChannelHandlerContext ctx -
initialWindowSent
private boolean initialWindowSent -
ticker
private final com.google.common.base.Ticker ticker -
BDP_MEASUREMENT_PING
private static final long BDP_MEASUREMENT_PING- See Also:
-
-
Constructor Details
-
AbstractNettyHandler
AbstractNettyHandler(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, boolean autoFlowControl, AbstractNettyHandler.PingLimiter pingLimiter, com.google.common.base.Ticker ticker)
-
-
Method Details
-
handlerAdded
-
channelActive
-
exceptionCaught
public final void exceptionCaught(io.netty.channel.ChannelHandlerContext ctx, Throwable cause) throws Exception - Specified by:
exceptionCaughtin interfaceio.netty.channel.ChannelHandler- Specified by:
exceptionCaughtin interfaceio.netty.channel.ChannelInboundHandler- Overrides:
exceptionCaughtin classio.netty.handler.codec.http2.Http2ConnectionHandler- Throws:
Exception
-
ctx
protected final io.netty.channel.ChannelHandlerContext ctx() -
sendInitialConnectionWindow
private void sendInitialConnectionWindow() throws io.netty.handler.codec.http2.Http2ExceptionSends initial connection window to the remote endpoint if necessary.- Throws:
io.netty.handler.codec.http2.Http2Exception
-
flowControlPing
AbstractNettyHandler.FlowControlPinger flowControlPing() -
setAutoTuneFlowControl
void setAutoTuneFlowControl(boolean isOn)
-