org.jboss.netty.handler.codec.http
类 HttpContentDecoder

java.lang.Object
  继承者 org.jboss.netty.channel.SimpleChannelUpstreamHandler
      继承者 org.jboss.netty.handler.codec.http.HttpContentDecoder
所有已实现的接口:
ChannelHandler, ChannelUpstreamHandler
直接已知子类:
HttpContentDecompressor

public abstract class HttpContentDecoder
extends SimpleChannelUpstreamHandler

Decodes the content of the received HttpRequest and HttpChunk. The original content is replaced with the new content decoded by the DecoderEmbedder, which is created by newContentDecoder(String). Once decoding is finished, the value of the 'Content-Encoding' header is set to the target content encoding, as returned by getTargetContentEncoding(String). Also, the 'Content-Length' header is updated to the length of the decoded content. If the content encoding of the original is not supported by the decoder, newContentDecoder(String) should return null so that no decoding occurs (i.e. pass-through).

Please note that this is an abstract class. You have to extend this class and implement newContentDecoder(String) properly to make this class functional. For example, refer to the source code of HttpContentDecompressor.

This handler must be placed after HttpMessageDecoder in the pipeline so that this handler can intercept HTTP requests after HttpMessageDecoder converts ChannelBuffers into HTTP requests.


嵌套类摘要
 
从接口 org.jboss.netty.channel.ChannelHandler 继承的嵌套类/接口
ChannelHandler.Sharable
 
方法摘要
 void messageReceived(ChannelHandlerContext ctx, MessageEvent e)
          当一个从远端发来的消息对象(如: ChannelBuffer)被接收时调用.
 
从类 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
 

方法详细信息

messageReceived

public void messageReceived(ChannelHandlerContext ctx,
                            MessageEvent e)
                     throws java.lang.Exception
从类 SimpleChannelUpstreamHandler 复制的描述
当一个从远端发来的消息对象(如: ChannelBuffer)被接收时调用.

覆盖:
SimpleChannelUpstreamHandler 中的 messageReceived
抛出:
java.lang.Exception