public class HttpServerExpectContinueHandler extends ChannelInboundHandlerAdapter
HttpResponse发送到包含'expect:100-continue'标头的HttpRequest 。
它只能用于不安装HttpObjectAggregator的应用程序。
默认情况下,它接受所有期望。
由于HttpServerExpectContinueHandler预计HttpRequest s应在HttpServerCodec之后添加,但在可能发送HttpResponse的任何其他处理程序之前添加。
ChannelPipelinep = ...; ... p.addLast("serverCodec", newHttpServerCodec()); p.addLast("respondExpectContinue", newHttpServerExpectContinueHandler()); ... p.addLast("handler", new HttpRequestHandler());
ChannelHandler.Sharable| Constructor and Description |
|---|
HttpServerExpectContinueHandler() |
| Modifier and Type | Method and Description |
|---|---|
protected HttpResponse |
acceptMessage(HttpRequest request)
为 HttpRequest生成一个HttpResponse ,它定义了一个期望值。
|
void |
channelRead(ChannelHandlerContext ctx, java.lang.Object msg)
|
protected HttpResponse |
rejectResponse(HttpRequest request)
返回相应4XX HttpResponse对于给定HttpRequest 。
|
channelActive, channelInactive, channelReadComplete, channelRegistered, channelUnregistered, channelWritabilityChanged, exceptionCaught, userEventTriggeredensureNotSharable, handlerAdded, handlerRemoved, isSharableclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waithandlerAdded, handlerRemovedprotected HttpResponse acceptMessage(HttpRequest request)
protected HttpResponse rejectResponse(HttpRequest request)
HttpResponse对于给定HttpRequest 。
public void channelRead(ChannelHandlerContext ctx, java.lang.Object msg) throws java.lang.Exception
ChannelInboundHandlerAdapter
ChannelHandlerContext.fireChannelRead(Object)转发到ChannelPipeline中的下一个ChannelInboundHandler 。
子类可以重写此方法来更改行为。
channelRead接口
ChannelInboundHandler
channelRead在课堂上
ChannelInboundHandlerAdapter
java.lang.Exception
Copyright © 2008–2018 The Netty Project. All rights reserved.