com.caucho.server.cache
Class AbstractCacheFilterChain

java.lang.Object
  extended by com.caucho.server.cache.AbstractCacheFilterChain
All Implemented Interfaces:
FilterChain
Direct Known Subclasses:
ProxyCacheFilterChain

public abstract class AbstractCacheFilterChain
extends java.lang.Object
implements FilterChain

Represents the final servlet in a filter chain.


Constructor Summary
AbstractCacheFilterChain()
           
 
Method Summary
abstract  boolean fillFromCache(CauchoRequest req, CauchoResponse response, AbstractCacheEntry abstractEntry)
          fillFromCache is called when the client needs the entire result, and the result is already in the cache.
abstract  void finishCaching(CauchoResponse res)
          Update the headers when the caching has finished.
abstract  void killCaching(CauchoResponse res)
          Cleanup the cache entry on a failed cache attempt.
abstract  AbstractCacheEntry startCaching(CauchoRequest req, CauchoResponse res, java.util.ArrayList<java.lang.String> keys, java.util.ArrayList<java.lang.String> values, java.lang.String contentType, java.lang.String charEncoding, long contentLength)
          Starts the caching after the headers have been sent.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.servlet.FilterChain
doFilter
 

Constructor Detail

AbstractCacheFilterChain

public AbstractCacheFilterChain()
Method Detail

fillFromCache

public abstract boolean fillFromCache(CauchoRequest req,
                                      CauchoResponse response,
                                      AbstractCacheEntry abstractEntry)
                               throws java.io.IOException
fillFromCache is called when the client needs the entire result, and the result is already in the cache.

Parameters:
req - the servlet request trying to get data from the cache
response - the servlet response which will receive data
entry - the cache entry to use
Throws:
java.io.IOException

startCaching

public abstract AbstractCacheEntry startCaching(CauchoRequest req,
                                                CauchoResponse res,
                                                java.util.ArrayList<java.lang.String> keys,
                                                java.util.ArrayList<java.lang.String> values,
                                                java.lang.String contentType,
                                                java.lang.String charEncoding,
                                                long contentLength)
Starts the caching after the headers have been sent.

Parameters:
req - the servlet request
req - the servlet response
keys - the saved header keys
values - the saved header values
contentType - the response content type
charEncoding - the response character encoding
Returns:
the output stream to store the cache value or null if uncacheable.

finishCaching

public abstract void finishCaching(CauchoResponse res)
Update the headers when the caching has finished.

Parameters:
okay - if true, the cache if valid

killCaching

public abstract void killCaching(CauchoResponse res)
Cleanup the cache entry on a failed cache attempt.