|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.riotfamily.cachius.servlet.SessionIdCacheHandler
public abstract class SessionIdCacheHandler
Abstract CacheHandler that can cache content containing links with
jsessionId
s. The actual sessionIds are replaced by a special
token which in turn is replaced with the current sessionId upon rendering.
Field Summary |
---|
Fields inherited from interface org.riotfamily.cachius.CacheHandler |
---|
CACHE_ETERNALLY |
Constructor Summary | |
---|---|
SessionIdCacheHandler(HttpServletRequest request,
CacheKeyAugmentor cacheKeyAugmentor)
|
Method Summary | |
---|---|
protected void |
augmentCacheKey(StringBuffer key)
|
String |
getCacheKey()
Returns the key that is used to look up a previously cached version. |
protected abstract String |
getCacheKeyInternal()
|
long |
getLastModified()
Returns the date (as timestamp) when the content was modified for the last time. |
protected HttpServletRequest |
getRequest()
|
protected SessionIdEncoder |
getSessionIdEncoder()
|
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 |
postProcess(CacheItem cacheItem)
|
boolean |
updateCacheItem(CacheItem cacheItem)
Callback method that is invoked when no cached version exists or the cached content is not up-to-date. |
protected abstract boolean |
updateCacheItemInternal(CacheItem cacheItem)
|
void |
writeCacheItem(CacheItem cacheItem)
Callback method that is invoked when an up-to-date CacheItem exists. |
protected abstract void |
writeCacheItemInternal(CacheItem cacheItem)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.riotfamily.cachius.CacheHandler |
---|
handleUncached |
Constructor Detail |
---|
public SessionIdCacheHandler(HttpServletRequest request, CacheKeyAugmentor cacheKeyAugmentor)
Method Detail |
---|
protected HttpServletRequest getRequest()
protected SessionIdEncoder getSessionIdEncoder()
public final String getCacheKey()
CacheHandler
getCacheKey
in interface CacheHandler
protected abstract String getCacheKeyInternal()
protected void augmentCacheKey(StringBuffer key)
public long getLastModified() throws Exception
CacheHandler
CacheHandler.updateCacheItem(CacheItem)
method will not be
called unless this date is newer than the timestamp of the cached
version.
getLastModified
in interface CacheHandler
Exception
public long getTimeToLive()
CacheHandler
CacheHandler.CACHE_ETERNALLY
to indicate that the content should be
cached eternally.
getTimeToLive
in interface CacheHandler
public final boolean updateCacheItem(CacheItem cacheItem) throws Exception
CacheHandler
CacheItem.getWriter()
or
CacheItem.getOutputStream()
and write their content into it.
updateCacheItem
in interface CacheHandler
true
if the CacheItem should be updated or
false
if it should be discarded.
Exception
protected abstract boolean updateCacheItemInternal(CacheItem cacheItem) throws Exception
Exception
protected void postProcess(CacheItem cacheItem) throws Exception
Exception
public final void writeCacheItem(CacheItem cacheItem) throws IOException
CacheHandler
CacheItem.writeTo(...)
to write the cached content to its destination.
writeCacheItem
in interface CacheHandler
IOException
protected abstract void writeCacheItemInternal(CacheItem cacheItem) throws IOException
IOException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |