| 
 | |||||||||
| 上一个类 下一个类 | 框架 无框架 | ||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | ||||||||
java.lang.Objectorg.jboss.netty.channel.SimpleChannelHandler
org.jboss.netty.handler.codec.http.HttpContentEncoder
public abstract class HttpContentEncoder

Encodes the content of the outbound HttpResponse and HttpChunk.
 The original content is replaced with the new content encoded by the
 EncoderEmbedder, which is created by newContentEncoder(String).
 Once encoding 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
 encoded content.  If there is no supported encoding in the
 corresponding HttpRequest's "Accept-Encoding" header,
 newContentEncoder(String) should return null so that no
 encoding occurs (i.e. pass-through).
 
 Please note that this is an abstract class.  You have to extend this class
 and implement newContentEncoder(String) and getTargetContentEncoding(String)
 properly to make this class functional.  For example, refer to the source
 code of HttpContentCompressor.
 
 This handler must be placed after HttpMessageEncoder in the pipeline
 so that this handler can intercept HTTP responses before HttpMessageEncoder
 converts them into ChannelBuffers.
| 嵌套类摘要 | 
|---|
| 从接口 org.jboss.netty.channel.ChannelHandler 继承的嵌套类/接口 | 
|---|
| ChannelHandler.Sharable | 
| 方法摘要 | |
|---|---|
|  void | messageReceived(ChannelHandlerContext ctx,
                MessageEvent e)当一个远程消息对象(如: ChannelBuffer)被接收时调用. | 
|  void | writeRequested(ChannelHandlerContext ctx,
               MessageEvent e)当 Channel.write(Object)被调用时调用. | 
| 从类 java.lang.Object 继承的方法 | 
|---|
| equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| 方法详细信息 | 
|---|
public void messageReceived(ChannelHandlerContext ctx,
                            MessageEvent e)
                     throws java.lang.Exception
SimpleChannelHandler 复制的描述ChannelBuffer)被接收时调用.
SimpleChannelHandler 中的 messageReceivedjava.lang.Exception
public void writeRequested(ChannelHandlerContext ctx,
                           MessageEvent e)
                    throws java.lang.Exception
SimpleChannelHandler 复制的描述Channel.write(Object)被调用时调用.
SimpleChannelHandler 中的 writeRequestedjava.lang.Exception| 
 | |||||||||
| 上一个类 下一个类 | 框架 无框架 | ||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | ||||||||