com.caucho.server.cache
Class AbstractCacheFilterChain

java.lang.Object
  extended by com.caucho.server.dispatch.AbstractFilterChain
      extended by com.caucho.server.cache.AbstractCacheFilterChain
All Implemented Interfaces:
CometFilterChain, FilterChain
Direct Known Subclasses:
CacheFilterChain

public abstract class AbstractCacheFilterChain
extends AbstractFilterChain
implements FilterChain

Represents the final servlet in a filter chain.


Constructor Summary
AbstractCacheFilterChain()
           
 
Method Summary
abstract  boolean fillFromCache(CauchoRequest req, AbstractHttpResponse response, AbstractCacheEntry abstractEntry, boolean isTop)
          fillFromCache is called when the client needs the entire result, and the result is already in the cache.
abstract  void finishCaching(AbstractCacheEntry entry)
          Update the headers when the caching has finished.
abstract  void killCaching(AbstractCacheEntry entry)
          Cleanup the cache entry on a failed cache attempt.
abstract  AbstractCacheEntry startCaching(CauchoRequest req, AbstractHttpResponse 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 com.caucho.server.dispatch.AbstractFilterChain
doResume, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, 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,
                                      AbstractHttpResponse response,
                                      AbstractCacheEntry abstractEntry,
                                      boolean isTop)
                               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
isTop - if true, the not-modified should be sent to the browser
Throws:
java.io.IOException

startCaching

public abstract AbstractCacheEntry startCaching(CauchoRequest req,
                                                AbstractHttpResponse 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(AbstractCacheEntry entry)
Update the headers when the caching has finished.

Parameters:
okay - if true, the cache if valid

killCaching

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