org.riotfamily.cachius.spring
Class ControllerCacheHandler

java.lang.Object
  extended by org.riotfamily.cachius.servlet.SessionIdCacheHandler
      extended by org.riotfamily.cachius.servlet.ResponseCapturingHandler
          extended by org.riotfamily.cachius.servlet.ZippedResponseHandler
              extended by org.riotfamily.cachius.spring.ControllerCacheHandler
All Implemented Interfaces:
CacheHandler

public class ControllerCacheHandler
extends ZippedResponseHandler

Since:
6.5
Author:
Felix Gnass [fgnass at neteye dot de]

Field Summary
 
Fields inherited from interface org.riotfamily.cachius.CacheHandler
CACHE_ETERNALLY
 
Constructor Summary
ControllerCacheHandler(HttpServletRequest request, HttpServletResponse response, CacheableController controller, CacheKeyAugmentor cacheKeyAugmentor, ViewResolverHelper viewResolverHelper)
           
 
Method Summary
protected  String getCacheKeyInternal()
           
 long getLastModified()
          Returns the date (as timestamp) when the content was modified for the last time.
 long getTimeToLive()
          Returns the time in milliseconds that has to be elapsed since the last up-to-date check before another check is performed.
protected  void handleInternal(HttpServletResponse response)
           
protected  boolean responseShouldBeZipped()
           
 
Methods inherited from class org.riotfamily.cachius.servlet.ZippedResponseHandler
augmentCacheKey, clientAcceptsGzip, isZip, postProcess, responseCanBeZipped, setMinSize, shouldZip, userAgentHasGzipBugs
 
Methods inherited from class org.riotfamily.cachius.servlet.ResponseCapturingHandler
handleUncached, updateCacheItemInternal, writeCacheItemInternal
 
Methods inherited from class org.riotfamily.cachius.servlet.SessionIdCacheHandler
getCacheKey, getRequest, getSessionIdEncoder, updateCacheItem, writeCacheItem
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ControllerCacheHandler

public ControllerCacheHandler(HttpServletRequest request,
                              HttpServletResponse response,
                              CacheableController controller,
                              CacheKeyAugmentor cacheKeyAugmentor,
                              ViewResolverHelper viewResolverHelper)
Method Detail

getCacheKeyInternal

protected String getCacheKeyInternal()
Specified by:
getCacheKeyInternal in class SessionIdCacheHandler

getLastModified

public long getLastModified()
                     throws Exception
Description copied from interface: CacheHandler
Returns the date (as timestamp) when the content was modified for the last time. The CacheHandler.updateCacheItem(CacheItem) method will not be called unless this date is newer than the timestamp of the cached version.

Specified by:
getLastModified in interface CacheHandler
Overrides:
getLastModified in class SessionIdCacheHandler
Throws:
Exception

getTimeToLive

public long getTimeToLive()
Description copied from interface: CacheHandler
Returns the time in milliseconds that has to be elapsed since the last up-to-date check before another check is performed. Implementors may return CacheHandler.CACHE_ETERNALLY to indicate that the content should be cached eternally.

Specified by:
getTimeToLive in interface CacheHandler
Overrides:
getTimeToLive in class SessionIdCacheHandler

responseShouldBeZipped

protected boolean responseShouldBeZipped()
Specified by:
responseShouldBeZipped in class ZippedResponseHandler

handleInternal

protected void handleInternal(HttpServletResponse response)
                       throws Exception
Specified by:
handleInternal in class ResponseCapturingHandler
Throws:
Exception