Package io.grpc.netty
Class ProtocolNegotiators.ProtocolNegotiationHandler
- java.lang.Object
-
- io.netty.channel.ChannelHandlerAdapter
-
- io.netty.channel.ChannelInboundHandlerAdapter
-
- io.netty.channel.ChannelDuplexHandler
-
- io.grpc.netty.ProtocolNegotiators.ProtocolNegotiationHandler
-
- All Implemented Interfaces:
io.netty.channel.ChannelHandler
,io.netty.channel.ChannelInboundHandler
,io.netty.channel.ChannelOutboundHandler
- Direct Known Subclasses:
InternalProtocolNegotiators.ProtocolNegotiationHandler
,ProtocolNegotiators.ClientTlsHandler
,ProtocolNegotiators.ProxyProtocolNegotiationHandler
,ProtocolNegotiators.WaitUntilActiveHandler
- Enclosing class:
- ProtocolNegotiators
static class ProtocolNegotiators.ProtocolNegotiationHandler extends io.netty.channel.ChannelDuplexHandler
ProtocolNegotiationHandler is a convenience handler that makes it easy to follow the rules for protocol negotiation. Handlers should strongly consider extending this handler.
-
-
Field Summary
Fields Modifier and Type Field Description private ChannelLogger
negotiationLogger
private java.lang.String
negotiatorName
private io.netty.channel.ChannelHandler
next
private ProtocolNegotiationEvent
pne
-
Constructor Summary
Constructors Modifier Constructor Description protected
ProtocolNegotiationHandler(io.netty.channel.ChannelHandler next, ChannelLogger negotiationLogger)
protected
ProtocolNegotiationHandler(io.netty.channel.ChannelHandler next, java.lang.String negotiatorName, ChannelLogger negotiationLogger)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
fireProtocolNegotiationEvent(io.netty.channel.ChannelHandlerContext ctx)
protected ProtocolNegotiationEvent
getProtocolNegotiationEvent()
void
handlerAdded(io.netty.channel.ChannelHandlerContext ctx)
protected void
handlerAdded0(io.netty.channel.ChannelHandlerContext ctx)
protected void
protocolNegotiationEventTriggered(io.netty.channel.ChannelHandlerContext ctx)
protected void
replaceProtocolNegotiationEvent(ProtocolNegotiationEvent pne)
void
userEventTriggered(io.netty.channel.ChannelHandlerContext ctx, java.lang.Object evt)
protected void
userEventTriggered0(io.netty.channel.ChannelHandlerContext ctx, java.lang.Object evt)
-
Methods inherited from class io.netty.channel.ChannelDuplexHandler
bind, close, connect, deregister, disconnect, flush, read, write
-
Methods inherited from class io.netty.channel.ChannelInboundHandlerAdapter
channelActive, channelInactive, channelRead, channelReadComplete, channelRegistered, channelUnregistered, channelWritabilityChanged, exceptionCaught
-
Methods inherited from class io.netty.channel.ChannelHandlerAdapter
ensureNotSharable, handlerRemoved, isSharable
-
-
-
-
Field Detail
-
next
private final io.netty.channel.ChannelHandler next
-
negotiatorName
private final java.lang.String negotiatorName
-
pne
private ProtocolNegotiationEvent pne
-
negotiationLogger
private final ChannelLogger negotiationLogger
-
-
Constructor Detail
-
ProtocolNegotiationHandler
protected ProtocolNegotiationHandler(io.netty.channel.ChannelHandler next, java.lang.String negotiatorName, ChannelLogger negotiationLogger)
-
ProtocolNegotiationHandler
protected ProtocolNegotiationHandler(io.netty.channel.ChannelHandler next, ChannelLogger negotiationLogger)
-
-
Method Detail
-
handlerAdded
public final void handlerAdded(io.netty.channel.ChannelHandlerContext ctx) throws java.lang.Exception
- Specified by:
handlerAdded
in interfaceio.netty.channel.ChannelHandler
- Overrides:
handlerAdded
in classio.netty.channel.ChannelHandlerAdapter
- Throws:
java.lang.Exception
-
handlerAdded0
@ForOverride protected void handlerAdded0(io.netty.channel.ChannelHandlerContext ctx) throws java.lang.Exception
- Throws:
java.lang.Exception
-
userEventTriggered
public final void userEventTriggered(io.netty.channel.ChannelHandlerContext ctx, java.lang.Object evt) throws java.lang.Exception
- Specified by:
userEventTriggered
in interfaceio.netty.channel.ChannelInboundHandler
- Overrides:
userEventTriggered
in classio.netty.channel.ChannelInboundHandlerAdapter
- Throws:
java.lang.Exception
-
userEventTriggered0
protected void userEventTriggered0(io.netty.channel.ChannelHandlerContext ctx, java.lang.Object evt) throws java.lang.Exception
- Throws:
java.lang.Exception
-
protocolNegotiationEventTriggered
@ForOverride protected void protocolNegotiationEventTriggered(io.netty.channel.ChannelHandlerContext ctx)
-
getProtocolNegotiationEvent
protected final ProtocolNegotiationEvent getProtocolNegotiationEvent()
-
replaceProtocolNegotiationEvent
protected final void replaceProtocolNegotiationEvent(ProtocolNegotiationEvent pne)
-
fireProtocolNegotiationEvent
protected final void fireProtocolNegotiationEvent(io.netty.channel.ChannelHandlerContext ctx)
-
-