org.littleshoot.proxy
Class ProxyHttpResponseEncoder

java.lang.Object
  extended by org.jboss.netty.handler.codec.oneone.OneToOneEncoder
      extended by org.jboss.netty.handler.codec.http.HttpMessageEncoder
          extended by org.jboss.netty.handler.codec.http.HttpResponseEncoder
              extended by org.littleshoot.proxy.ProxyHttpResponseEncoder
All Implemented Interfaces:
org.jboss.netty.channel.ChannelDownstreamHandler, org.jboss.netty.channel.ChannelHandler

public class ProxyHttpResponseEncoder
extends org.jboss.netty.handler.codec.http.HttpResponseEncoder

HTTP response encoder for the proxy.


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.jboss.netty.channel.ChannelHandler
org.jboss.netty.channel.ChannelHandler.Sharable
 
Constructor Summary
ProxyHttpResponseEncoder()
          Creates a new HTTP response encoder that doesn't include responses in the cache.
ProxyHttpResponseEncoder(boolean transparent)
          Creates a new HTTP response encoder that intercepts the encoding to include any relevant responses in the cache.
ProxyHttpResponseEncoder(ProxyCacheManager cacheManager)
          Creates a new HTTP response encoder that intercepts the encoding to include any relevant responses in the cache.
ProxyHttpResponseEncoder(ProxyCacheManager cacheManager, boolean transparent)
          Creates a new HTTP response encoder that intercepts the encoding to include any relevant responses in the cache.
 
Method Summary
protected  Object encode(org.jboss.netty.channel.ChannelHandlerContext ctx, org.jboss.netty.channel.Channel channel, Object msg)
           
 
Methods inherited from class org.jboss.netty.handler.codec.http.HttpResponseEncoder
encodeInitialLine
 
Methods inherited from class org.jboss.netty.handler.codec.oneone.OneToOneEncoder
doEncode, handleDownstream
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProxyHttpResponseEncoder

public ProxyHttpResponseEncoder()
Creates a new HTTP response encoder that doesn't include responses in the cache.


ProxyHttpResponseEncoder

public ProxyHttpResponseEncoder(ProxyCacheManager cacheManager)
Creates a new HTTP response encoder that intercepts the encoding to include any relevant responses in the cache.

Parameters:
cacheManager - The class that manages the cache.

ProxyHttpResponseEncoder

public ProxyHttpResponseEncoder(boolean transparent)
Creates a new HTTP response encoder that intercepts the encoding to include any relevant responses in the cache.

Parameters:
transparent - Whether or not this should act as a transparent proxy.

ProxyHttpResponseEncoder

public ProxyHttpResponseEncoder(ProxyCacheManager cacheManager,
                                boolean transparent)
Creates a new HTTP response encoder that intercepts the encoding to include any relevant responses in the cache.

Parameters:
cacheManager - The class that manages the cache.
transparent - Whether or not this should act as a transparent proxy.
Method Detail

encode

protected Object encode(org.jboss.netty.channel.ChannelHandlerContext ctx,
                        org.jboss.netty.channel.Channel channel,
                        Object msg)
                 throws Exception
Overrides:
encode in class org.jboss.netty.handler.codec.http.HttpMessageEncoder
Throws:
Exception


Copyright © 2009-2013 LittleShoot. All Rights Reserved.