Class Http2Handler
- java.lang.Object
-
- io.netty.channel.ChannelHandlerAdapter
-
- io.netty.channel.ChannelInboundHandlerAdapter
-
- org.asynchttpclient.netty.handler.AsyncHttpClientHandler
-
- org.asynchttpclient.netty.handler.Http2Handler
-
- All Implemented Interfaces:
io.netty.channel.ChannelHandler,io.netty.channel.ChannelInboundHandler
@Sharable public final class Http2Handler extends AsyncHttpClientHandler
HTTP/2 channel handler for stream child channels created byHttp2MultiplexHandler.Each HTTP/2 stream is represented as a child channel. This handler is attached to each stream child channel and processes
Http2HeadersFrame(response status + headers) andHttp2DataFrame(response body) frames directly for maximum performance — no HTTP/1.1 object conversion overhead.Follows the same structure as
HttpHandlerand reuses the same interceptor chain, body part factory, and lifecycle methods fromAsyncHttpClientHandler.
-
-
Field Summary
-
Fields inherited from class org.asynchttpclient.netty.handler.AsyncHttpClientHandler
channelManager, config, logger, requestSender
-
-
Constructor Summary
Constructors Constructor Description Http2Handler(AsyncHttpClientConfig config, ChannelManager channelManager, NettyRequestSender requestSender)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidhandleChannelInactive(NettyResponseFuture<?> future)voidhandleException(NettyResponseFuture<?> future, Throwable error)voidhandleRead(io.netty.channel.Channel channel, NettyResponseFuture<?> future, Object e)Handles incoming frames on the HTTP/2 stream child channel.-
Methods inherited from class org.asynchttpclient.netty.handler.AsyncHttpClientHandler
channelActive, channelInactive, channelRead, channelReadComplete, exceptionCaught
-
Methods inherited from class io.netty.channel.ChannelInboundHandlerAdapter
channelRegistered, channelUnregistered, channelWritabilityChanged, userEventTriggered
-
Methods inherited from class io.netty.channel.ChannelHandlerAdapter
ensureNotSharable, handlerAdded, handlerRemoved, isSharable
-
-
-
-
Constructor Detail
-
Http2Handler
public Http2Handler(AsyncHttpClientConfig config, ChannelManager channelManager, NettyRequestSender requestSender)
-
-
Method Detail
-
handleRead
public void handleRead(io.netty.channel.Channel channel, NettyResponseFuture<?> future, Object e) throws ExceptionHandles incoming frames on the HTTP/2 stream child channel. Dispatches to the appropriate handler based on frame type.- Specified by:
handleReadin classAsyncHttpClientHandler- Throws:
Exception
-
handleException
public void handleException(NettyResponseFuture<?> future, Throwable error)
- Specified by:
handleExceptionin classAsyncHttpClientHandler
-
handleChannelInactive
public void handleChannelInactive(NettyResponseFuture<?> future)
- Specified by:
handleChannelInactivein classAsyncHttpClientHandler
-
-