edu.wisc.my.webproxy.beans.cache.ehcache
Class EhPageCache

java.lang.Object
  extended by edu.wisc.my.webproxy.beans.cache.ehcache.EhPageCache
All Implemented Interfaces:
PageCache

public class EhPageCache
extends Object
implements PageCache

PageCache using EhCache

Version:
$Revision$
Author:
Eric Dalquist

Constructor Summary
EhPageCache()
           
 
Method Summary
 void cachePage(String key, CacheEntry entry, boolean persistent)
          Caches a page with the specified key and persistence flag.
 CacheEntry getCachedPage(String key)
          Retrieves the cache entry for the specified key.
 CacheEntry getCachedPage(String key, boolean useExpired)
          Retrieves the cache entry for the specified key.
 CacheEntry getCachedPage(String key, int maxCacheAge)
          Retrieves the cache entry for the specified key.
 net.sf.ehcache.Ehcache getEhcache()
           
 void setCacheSecondsToLiveDefault(int cacheSecondsToLiveDefault)
           
 void setEhcache(net.sf.ehcache.Ehcache ehcache)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EhPageCache

public EhPageCache()
Method Detail

getEhcache

public net.sf.ehcache.Ehcache getEhcache()

setEhcache

public void setEhcache(net.sf.ehcache.Ehcache ehcache)

cachePage

public void cachePage(String key,
                      CacheEntry entry,
                      boolean persistent)
Description copied from interface: PageCache
Caches a page with the specified key and persistence flag.

Specified by:
cachePage in interface PageCache
Parameters:
key - The key to cache the data for.
entry - The cache entry to store.
persistent - If true the entry will be stored in the persistent cache and be avaialble between restarts.

getCachedPage

public CacheEntry getCachedPage(String key)
Description copied from interface: PageCache
Retrieves the cache entry for the specified key. If the entry is expired null is returned. The expirationDate field of the CacheEntry object is used for determining expiration.

Specified by:
getCachedPage in interface PageCache
Parameters:
key - The key to retrieve the entry for.
Returns:
Then entry for the key, null if no entry exists or it has expired.

getCachedPage

public CacheEntry getCachedPage(String key,
                                boolean useExpired)
Description copied from interface: PageCache
Retrieves the cache entry for the specified key. If the entry is expired but still exists in the cache it is stil returned.

Specified by:
getCachedPage in interface PageCache
Parameters:
key - The key to retrieve the entry for.
useExpired - Flag to use the entry if it expired or not.
Returns:
The entry for the key, null if no entry exists for the key.

getCachedPage

public CacheEntry getCachedPage(String key,
                                int maxCacheAge)
Description copied from interface: PageCache
Retrieves the cache entry for the specified key. If the entry is older than the number of seconds specified by maxCacheAge null is returned.

Specified by:
getCachedPage in interface PageCache
Parameters:
key - The key to retrieve the entry for.
maxCacheAge - The maximum age of the entry in seconds.
Returns:
The entry for the key, null if no entry exists or if the entry is older than the specified max age.

setCacheSecondsToLiveDefault

public void setCacheSecondsToLiveDefault(int cacheSecondsToLiveDefault)
Parameters:
cacheSecondsToLiveDefault - the cacheSecondsToLiveDefault to set


Copyright © 2010 Jasig. All Rights Reserved.