org.riotfamily.cachius.servlet
Class ResponseCapturingHandler

java.lang.Object
  extended by org.riotfamily.cachius.servlet.SessionIdCacheHandler
      extended by org.riotfamily.cachius.servlet.ResponseCapturingHandler
All Implemented Interfaces:
CacheHandler
Direct Known Subclasses:
ZippedResponseHandler

public abstract class ResponseCapturingHandler
extends SessionIdCacheHandler

Abstract CacheHandler that creates a response wrapper and captures everything that is written to the response's OutputStream or Writer.


Field Summary
 
Fields inherited from interface org.riotfamily.cachius.CacheHandler
CACHE_ETERNALLY
 
Constructor Summary
ResponseCapturingHandler(HttpServletRequest request, HttpServletResponse response, CacheKeyAugmentor cacheKeyAugmentor)
           
 
Method Summary
protected abstract  void handleInternal(HttpServletResponse response)
           
 void handleUncached()
          Callback method that is invoked when no CacheItem could be created.
protected  boolean updateCacheItemInternal(CacheItem cacheItem)
           
protected  void writeCacheItemInternal(CacheItem cacheItem)
           
 
Methods inherited from class org.riotfamily.cachius.servlet.SessionIdCacheHandler
augmentCacheKey, getCacheKey, getCacheKeyInternal, getLastModified, getRequest, getSessionIdEncoder, getTimeToLive, postProcess, updateCacheItem, writeCacheItem
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResponseCapturingHandler

public ResponseCapturingHandler(HttpServletRequest request,
                                HttpServletResponse response,
                                CacheKeyAugmentor cacheKeyAugmentor)
Method Detail

updateCacheItemInternal

protected boolean updateCacheItemInternal(CacheItem cacheItem)
                                   throws Exception
Specified by:
updateCacheItemInternal in class SessionIdCacheHandler
Throws:
Exception

handleUncached

public void handleUncached()
                    throws Exception
Description copied from interface: CacheHandler
Callback method that is invoked when no CacheItem could be created. This can be the case when either CacheHandler.getCacheKey() returns null, the cache is disabled or an unexpected error occurred.

Throws:
Exception

handleInternal

protected abstract void handleInternal(HttpServletResponse response)
                                throws Exception
Throws:
Exception

writeCacheItemInternal

protected final void writeCacheItemInternal(CacheItem cacheItem)
                                     throws IOException
Specified by:
writeCacheItemInternal in class SessionIdCacheHandler
Throws:
IOException