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 modifiers
    static 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

    Methods inherited from class lazyj.cache.ExpirationCache

    get, getKeys, getRefreshTime, getValues, overwrite, put, refresh, remove, size

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • callbackOnExpiry

      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.
      Overrides:
      callbackOnExpiry in class lazyj.cache.ExpirationCache<java.lang.String,​CachingStructure>
      Parameters:
      key - key that is removed
      cs - value for the key that is removed
    • getCacheContent

      public static java.util.List<CachingStructure> 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 request
      sCacheKeyModifier -
      vbContent -
      lLifetime -
      sContentType -
      Returns:
      the newly created structure