Package lazyj
Class PageCache
java.lang.Object
lazyj.cache.ExpirationCache<java.lang.String,CachingStructure>
lazyj.PageCache
- All Implemented Interfaces:
lazyj.cache.CacheElement<java.lang.String,CachingStructure>
public final class PageCache extends lazyj.cache.ExpirationCache<java.lang.String,CachingStructure>
This is the page cache.
- Since:
- 2006-10-04
- Author:
- costing
-
Method Summary
Modifier and Type Method Description protected void
callbackOnExpiry(java.lang.String key, CachingStructure cs)
Cleanup thread, takes an entry that has expired, removes it from the cache and checks if it deserves a bonus.static void
clear()
Clear all the cache structures (in case of major changes to the templates ...)static CachingStructure
get(javax.servlet.http.HttpServletRequest request, java.lang.String sCacheKeyModifier)
Get the contents generating the key on the fly from the request and the extra modifiersstatic java.util.List<CachingStructure>
getCacheContent()
Get the entrire contents of the cache.static CachingStructure
put(javax.servlet.http.HttpServletRequest request, java.lang.String sCacheKeyModifier, byte[] vbContent, long lLifetime, java.lang.String sContentType)
Cache some arbitrary contents
-
Method Details
-
callbackOnExpiry
Cleanup thread, takes an entry that has expired, removes it from the cache and checks if it deserves a bonus.- Overrides:
callbackOnExpiry
in classlazyj.cache.ExpirationCache<java.lang.String,CachingStructure>
- Parameters:
key
- key that is removedcs
- value for the key that is removed
-
getCacheContent
Get the entrire contents of the cache.- Returns:
- a List of CachingStructure objects that is the entire contents of the memory cache.
-
get
public static CachingStructure get(javax.servlet.http.HttpServletRequest request, java.lang.String sCacheKeyModifier)Get the contents generating the key on the fly from the request and the extra modifiers- Parameters:
request
-sCacheKeyModifier
-- Returns:
- the structure, if exists, or null
-
clear
public static void clear()Clear all the cache structures (in case of major changes to the templates ...)- Since:
- 1.0.2
-
put
public static CachingStructure put(javax.servlet.http.HttpServletRequest request, java.lang.String sCacheKeyModifier, byte[] vbContent, long lLifetime, java.lang.String sContentType)Cache some arbitrary contents- Parameters:
request
- incoming requestsCacheKeyModifier
-vbContent
-lLifetime
-sContentType
-- Returns:
- the newly created structure
-