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:
ChannelHandler
,ChannelInboundHandler
,ChannelOutboundHandler
- Direct Known Subclasses:
Http2MultiplexHandler
public abstract class Http2ChannelDuplexHandler extends ChannelDuplexHandler
AChannelDuplexHandler
providing additional functionality for HTTP/2. Specifically it allows to:- Create new outbound streams using
newStream()
. - Iterate over all active streams using
forEachActiveStream(Http2FrameStreamVisitor)
.
The
Http2FrameCodec
is required to be part of theChannelPipeline
before this handler is added, or else anIllegalStateException
will be thrown.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface io.netty.channel.ChannelHandler
ChannelHandler.Sharable
-
-
Constructor Summary
Constructors Constructor Description Http2ChannelDuplexHandler()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
forEachActiveStream(Http2FrameStreamVisitor streamVisitor)
Allows to iterate over all currently active streams.void
handlerAdded(ChannelHandlerContext ctx)
Do nothing by default, sub-classes may override this method.protected void
handlerAdded0(ChannelHandlerContext ctx)
void
handlerRemoved(ChannelHandlerContext ctx)
Do nothing by default, sub-classes may override this method.protected void
handlerRemoved0(ChannelHandlerContext ctx)
Http2FrameStream
newStream()
Creates a newHttp2FrameStream
object.-
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, userEventTriggered
-
Methods inherited from class io.netty.channel.ChannelHandlerAdapter
ensureNotSharable, isSharable
-
-
-
-
Method Detail
-
handlerAdded
public final void handlerAdded(ChannelHandlerContext ctx) throws java.lang.Exception
Description copied from class:ChannelHandlerAdapter
Do nothing by default, sub-classes may override this method.- Specified by:
handlerAdded
in interfaceChannelHandler
- Overrides:
handlerAdded
in classChannelHandlerAdapter
- Throws:
java.lang.Exception
-
handlerAdded0
protected void handlerAdded0(ChannelHandlerContext ctx) throws java.lang.Exception
- Throws:
java.lang.Exception
-
handlerRemoved
public final void handlerRemoved(ChannelHandlerContext ctx) throws java.lang.Exception
Description copied from class:ChannelHandlerAdapter
Do nothing by default, sub-classes may override this method.- Specified by:
handlerRemoved
in interfaceChannelHandler
- Overrides:
handlerRemoved
in classChannelHandlerAdapter
- Throws:
java.lang.Exception
-
handlerRemoved0
protected void handlerRemoved0(ChannelHandlerContext ctx) throws java.lang.Exception
- Throws:
java.lang.Exception
-
newStream
public final Http2FrameStream newStream()
Creates a newHttp2FrameStream
object.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
-
-