- java.lang.Object
-
- io.netty5.handler.codec.http2.Http2ChannelDuplexHandler
-
- All Implemented Interfaces:
ChannelHandler
- Direct Known Subclasses:
Http2MultiplexHandler
@UnstableApi public abstract class Http2ChannelDuplexHandler extends Object implements ChannelHandler
AChannelHandler
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.
-
-
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)
Gets called after theChannelHandler
was added to the actual context and it's ready to handle events.protected void
handlerAdded0(ChannelHandlerContext ctx)
void
handlerRemoved(ChannelHandlerContext ctx)
Gets called after theChannelHandler
was removed from the actual context and it doesn't handle events anymore.protected void
handlerRemoved0(ChannelHandlerContext ctx)
Http2FrameStream
newStream()
Creates a newHttp2FrameStream
object.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.netty5.channel.ChannelHandler
bind, channelActive, channelExceptionCaught, channelInactive, channelInboundEvent, channelRead, channelReadComplete, channelRegistered, channelShutdown, channelUnregistered, channelWritabilityChanged, close, connect, deregister, disconnect, flush, isSharable, pendingOutboundBytes, read, register, sendOutboundEvent, shutdown, write
-
-
-
-
Method Detail
-
handlerAdded
public final void handlerAdded(ChannelHandlerContext ctx) throws Exception
Description copied from interface:ChannelHandler
Gets called after theChannelHandler
was added to the actual context and it's ready to handle events.- Specified by:
handlerAdded
in interfaceChannelHandler
- Throws:
Exception
-
handlerAdded0
protected void handlerAdded0(ChannelHandlerContext ctx) throws Exception
- Throws:
Exception
-
handlerRemoved
public final void handlerRemoved(ChannelHandlerContext ctx) throws Exception
Description copied from interface:ChannelHandler
Gets called after theChannelHandler
was removed from the actual context and it doesn't handle events anymore.- Specified by:
handlerRemoved
in interfaceChannelHandler
- Throws:
Exception
-
handlerRemoved0
protected void handlerRemoved0(ChannelHandlerContext ctx) throws Exception
- Throws:
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
-
-