public class HttpResponseHandler extends SimpleChannelInboundHandler<FullHttpResponse>
FullHttpResponse
translated from HTTP/2 framesChannelHandler.Sharable
Constructor and Description |
---|
HttpResponseHandler() |
Modifier and Type | Method and Description |
---|---|
void |
awaitResponses(long timeout,
TimeUnit unit)
Wait (sequentially) for a time duration for each anticipated response
|
protected void |
channelRead0(ChannelHandlerContext ctx,
FullHttpResponse msg)
Please keep in mind that this method will be renamed to
messageReceived(ChannelHandlerContext, I) in 5.0. |
Map.Entry<ChannelFuture,ChannelPromise> |
put(int streamId,
ChannelFuture writeFuture,
ChannelPromise promise)
Create an association between an anticipated response stream id and a
ChannelPromise |
acceptInboundMessage, channelRead
channelActive, channelInactive, channelReadComplete, channelRegistered, channelUnregistered, channelWritabilityChanged, exceptionCaught, userEventTriggered
ensureNotSharable, handlerAdded, handlerRemoved, isSharable
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
handlerAdded, handlerRemoved
public Map.Entry<ChannelFuture,ChannelPromise> put(int streamId, ChannelFuture writeFuture, ChannelPromise promise)
ChannelPromise
streamId
- The stream for which a response is expectedwriteFuture
- A future that represent the request write operationpromise
- The promise object that will be used to wait/notify eventsstreamId
awaitResponses(long, java.util.concurrent.TimeUnit)
public void awaitResponses(long timeout, TimeUnit unit)
timeout
- Value of time to wait for each responseunit
- Units associated with timeout
put(int, io.netty.channel.ChannelFuture, io.netty.channel.ChannelPromise)
protected void channelRead0(ChannelHandlerContext ctx, FullHttpResponse msg) throws Exception
SimpleChannelInboundHandler
messageReceived(ChannelHandlerContext, I)
in 5.0.
Is called for each message of type I
.channelRead0
in class SimpleChannelInboundHandler<FullHttpResponse>
ctx
- the ChannelHandlerContext
which this SimpleChannelInboundHandler
belongs tomsg
- the message to handleException
- is thrown if an error occurredCopyright © 2008–2019 The Netty Project. All rights reserved.