public class HttpChunkAggregator extends SimpleChannelUpstreamHandler
ChannelHandler
that aggregates an HttpMessage
and its following HttpChunk
s into a single HttpMessage
with
no following HttpChunk
s. 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", newHttpRequestDecoder
()); p.addLast("aggregator", newHttpChunkAggregator
(1048576)); ... p.addLast("encoder", newHttpResponseEncoder
()); p.addLast("handler", new HttpRequestHandler());
ChannelHandler.Sharable
Constructor and Description |
---|
HttpChunkAggregator(int maxContentLength)
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
void |
messageReceived(ChannelHandlerContext ctx,
MessageEvent e)
Invoked when a message object (e.g:
ChannelBuffer ) was received
from a remote peer. |
channelBound, channelClosed, channelConnected, channelDisconnected, channelInterestChanged, channelOpen, channelUnbound, childChannelClosed, childChannelOpen, exceptionCaught, handleUpstream, writeComplete
public HttpChunkAggregator(int maxContentLength)
maxContentLength
- the maximum length of the aggregated content.
If the length of the aggregated content exceeds this value,
a TooLongFrameException
will be raised.public void messageReceived(ChannelHandlerContext ctx, MessageEvent e) throws Exception
SimpleChannelUpstreamHandler
ChannelBuffer
) was received
from a remote peer.messageReceived
in class SimpleChannelUpstreamHandler
Exception
Copyright © 2008-2012 JBoss, a division of Red Hat, Inc.. All Rights Reserved.