Package io.grpc.netty
Class ProtocolNegotiators.WaitUntilActiveHandler
java.lang.Object
io.netty.channel.ChannelHandlerAdapter
io.netty.channel.ChannelInboundHandlerAdapter
io.netty.channel.ChannelDuplexHandler
io.grpc.netty.ProtocolNegotiators.ProtocolNegotiationHandler
io.grpc.netty.ProtocolNegotiators.WaitUntilActiveHandler
- All Implemented Interfaces:
io.netty.channel.ChannelHandler
,io.netty.channel.ChannelInboundHandler
,io.netty.channel.ChannelOutboundHandler
- Enclosing class:
ProtocolNegotiators
static final class ProtocolNegotiators.WaitUntilActiveHandler
extends ProtocolNegotiators.ProtocolNegotiationHandler
Waits for the channel to be active, and then installs the next Handler. Using this allows
subsequent handlers to assume the channel is active and ready to send. Additionally, this a
ProtocolNegotiationEvent
, with the connection addresses.-
Nested Class Summary
Nested classes/interfaces inherited from interface io.netty.channel.ChannelHandler
io.netty.channel.ChannelHandler.Sharable
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionWaitUntilActiveHandler
(io.netty.channel.ChannelHandler next, ChannelLogger negotiationLogger) -
Method Summary
Modifier and TypeMethodDescriptionvoid
channelActive
(io.netty.channel.ChannelHandlerContext ctx) protected void
protocolNegotiationEventTriggered
(io.netty.channel.ChannelHandlerContext ctx) private void
replaceOnActive
(io.netty.channel.ChannelHandlerContext ctx) Methods inherited from class io.grpc.netty.ProtocolNegotiators.ProtocolNegotiationHandler
fireProtocolNegotiationEvent, getProtocolNegotiationEvent, handlerAdded, handlerAdded0, replaceProtocolNegotiationEvent, userEventTriggered, userEventTriggered0
Methods inherited from class io.netty.channel.ChannelDuplexHandler
bind, close, connect, deregister, disconnect, flush, read, write
Methods inherited from class io.netty.channel.ChannelInboundHandlerAdapter
channelInactive, channelRead, channelReadComplete, channelRegistered, channelUnregistered, channelWritabilityChanged, exceptionCaught
Methods inherited from class io.netty.channel.ChannelHandlerAdapter
ensureNotSharable, handlerRemoved, 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 Details
-
protocolNegotiationEventReceived
boolean protocolNegotiationEventReceived
-
-
Constructor Details
-
WaitUntilActiveHandler
WaitUntilActiveHandler(io.netty.channel.ChannelHandler next, ChannelLogger negotiationLogger)
-
-
Method Details
-
channelActive
- Specified by:
channelActive
in interfaceio.netty.channel.ChannelInboundHandler
- Overrides:
channelActive
in classio.netty.channel.ChannelInboundHandlerAdapter
- Throws:
Exception
-
protocolNegotiationEventTriggered
protected void protocolNegotiationEventTriggered(io.netty.channel.ChannelHandlerContext ctx) - Overrides:
protocolNegotiationEventTriggered
in classProtocolNegotiators.ProtocolNegotiationHandler
-
replaceOnActive
private void replaceOnActive(io.netty.channel.ChannelHandlerContext ctx)
-