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
A
ChannelDuplexHandler 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 the ChannelPipeline before this handler is added,
or else an IllegalStateException will be thrown.
-
Nested Class Summary
Nested classes/interfaces inherited from interface ChannelHandler
ChannelHandler.Sharable -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected final voidforEachActiveStream(Http2FrameStreamVisitor streamVisitor) Allows to iterate over all currently active streams.final voidDo nothing by default, sub-classes may override this method.protected voidfinal voidDo nothing by default, sub-classes may override this method.protected voidfinal Http2FrameStreamCreates a newHttp2FrameStreamobject.Methods inherited from class ChannelDuplexHandler
bind, close, connect, deregister, disconnect, flush, read, writeMethods inherited from class ChannelInboundHandlerAdapter
channelActive, channelInactive, channelRead, channelReadComplete, channelRegistered, channelUnregistered, channelWritabilityChanged, exceptionCaught, userEventTriggeredMethods inherited from class ChannelHandlerAdapter
ensureNotSharable, isSharable
-
Constructor Details
-
Http2ChannelDuplexHandler
public Http2ChannelDuplexHandler()
-
-
Method Details
-
handlerAdded
Description copied from class:ChannelHandlerAdapterDo nothing by default, sub-classes may override this method.- Specified by:
handlerAddedin interfaceChannelHandler- Overrides:
handlerAddedin classChannelHandlerAdapter- Throws:
Exception
-
handlerAdded0
- Throws:
Exception
-
handlerRemoved
Description copied from class:ChannelHandlerAdapterDo nothing by default, sub-classes may override this method.- Specified by:
handlerRemovedin interfaceChannelHandler- Overrides:
handlerRemovedin classChannelHandlerAdapter- Throws:
Exception
-
handlerRemoved0
- Throws:
Exception
-
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
-