Package io.netty.handler.codec.http2
Class Http2ChannelDuplexHandler
- java.lang.Object
-
- io.netty.channel.ChannelHandlerAdapter
-
- io.netty.channel.ChannelInboundHandlerAdapter
-
- io.netty.channel.ChannelDuplexHandler
-
- io.netty.handler.codec.http2.Http2ChannelDuplexHandler
-
- All Implemented Interfaces:
io.netty.channel.ChannelHandler,io.netty.channel.ChannelInboundHandler,io.netty.channel.ChannelOutboundHandler
- Direct Known Subclasses:
Http2MultiplexHandler
public abstract class Http2ChannelDuplexHandler extends io.netty.channel.ChannelDuplexHandlerAChannelDuplexHandlerproviding additional functionality for HTTP/2. Specifically it allows to:- Create new outbound streams using
newStream(). - Iterate over all active streams using
forEachActiveStream(Http2FrameStreamVisitor).
The
Http2FrameCodecis required to be part of theChannelPipelinebefore this handler is added, or else anIllegalStateExceptionwill be thrown.
-
-
Constructor Summary
Constructors Constructor Description Http2ChannelDuplexHandler()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidforEachActiveStream(Http2FrameStreamVisitor streamVisitor)Allows to iterate over all currently active streams.voidhandlerAdded(io.netty.channel.ChannelHandlerContext ctx)protected voidhandlerAdded0(io.netty.channel.ChannelHandlerContext ctx)voidhandlerRemoved(io.netty.channel.ChannelHandlerContext ctx)protected voidhandlerRemoved0(io.netty.channel.ChannelHandlerContext ctx)Http2FrameStreamnewStream()Creates a newHttp2FrameStreamobject.-
Methods inherited from class io.netty.channel.ChannelDuplexHandler
bind, close, connect, deregister, disconnect, flush, read, write
-
-
-
-
Method Detail
-
handlerAdded
public final void handlerAdded(io.netty.channel.ChannelHandlerContext ctx) throws Exception- Specified by:
handlerAddedin interfaceio.netty.channel.ChannelHandler- Overrides:
handlerAddedin classio.netty.channel.ChannelHandlerAdapter- Throws:
Exception
-
handlerAdded0
protected void handlerAdded0(io.netty.channel.ChannelHandlerContext ctx) throws Exception- Throws:
Exception
-
handlerRemoved
public final void handlerRemoved(io.netty.channel.ChannelHandlerContext ctx) throws Exception- Specified by:
handlerRemovedin interfaceio.netty.channel.ChannelHandler- Overrides:
handlerRemovedin classio.netty.channel.ChannelHandlerAdapter- Throws:
Exception
-
handlerRemoved0
protected void handlerRemoved0(io.netty.channel.ChannelHandlerContext ctx) throws Exception- Throws:
Exception
-
newStream
public final Http2FrameStream newStream()
Creates a newHttp2FrameStreamobject.This method is thread-safe.
-
forEachActiveStream
protected final void forEachActiveStream(Http2FrameStreamVisitor streamVisitor) throws Http2Exception
Allows to iterate over all currently active streams.This method may only be called from the eventloop thread.
- Throws:
Http2Exception
-
-