org.jboss.netty.handler.codec.http
类 HttpChunkAggregator
java.lang.Object
org.jboss.netty.channel.SimpleChannelUpstreamHandler
org.jboss.netty.handler.codec.http.HttpChunkAggregator
- 所有已实现的接口:
- ChannelHandler, ChannelUpstreamHandler
public class HttpChunkAggregator
- extends SimpleChannelUpstreamHandler
A ChannelHandler that aggregates an HttpMessage
and its following HttpChunks into a single HttpMessage with
no following HttpChunks. It is useful when you don't want to take
care of HTTP messages whose transfer encoding is 'chunked'. Insert this
handler after HttpMessageDecoder in the ChannelPipeline:
ChannelPipeline p = ...;
...
p.addLast("decoder", new HttpRequestDecoder());
p.addLast("aggregator", new HttpChunkAggregator(1048576));
...
p.addLast("encoder", new HttpResponseEncoder());
p.addLast("handler", new HttpRequestHandler());
| 从类 org.jboss.netty.channel.SimpleChannelUpstreamHandler 继承的方法 |
channelBound, channelClosed, channelConnected, channelDisconnected, channelInterestChanged, channelOpen, channelUnbound, childChannelClosed, childChannelOpen, exceptionCaught, handleUpstream, writeComplete |
| 从类 java.lang.Object 继承的方法 |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
HttpChunkAggregator
public HttpChunkAggregator(int maxContentLength)
- Creates a new instance.
- 参数:
maxContentLength - the maximum length of the aggregated content.
If the length of the aggregated content exceeds this value,
a TooLongFrameException will be raised.
messageReceived
public void messageReceived(ChannelHandlerContext ctx,
MessageEvent e)
throws java.lang.Exception
- 从类
SimpleChannelUpstreamHandler 复制的描述
- 当一个从远端发来的消息对象(如:
ChannelBuffer)被接收时调用.
- 覆盖:
- 类
SimpleChannelUpstreamHandler 中的 messageReceived
- 抛出:
java.lang.Exception