org.jasig.portal.utils.cache
Class CacheManagementHelper

java.lang.Object
  extended by org.jasig.portal.utils.cache.CacheManagementHelper

public class CacheManagementHelper
extends Object

This class exposes some limited functions around the provided CacheManager.

Author:
Nicholas Blair, npblair@wisc.edu

Nested Class Summary
static class CacheManagementHelper.CacheStatistics
           
 
Field Summary
protected  org.apache.commons.logging.Log logger
           
 
Constructor Summary
CacheManagementHelper()
           
 
Method Summary
 void clearAllCaches()
          Call clearCache(String) on ALL caches.
 void clearCache(String cacheName)
          Call Cache.removeAll() on the specified cache, if it exists and is alive.
 Map<String,CacheManagementHelper.CacheStatistics> getAllCacheStatistics()
           
 net.sf.ehcache.Statistics getCacheStatistics(String cacheName)
           
 void setCacheManager(net.sf.ehcache.CacheManager cacheManager)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected final org.apache.commons.logging.Log logger
Constructor Detail

CacheManagementHelper

public CacheManagementHelper()
Method Detail

setCacheManager

public void setCacheManager(net.sf.ehcache.CacheManager cacheManager)
Parameters:
cacheManager - the cacheManager to set

getAllCacheStatistics

public Map<String,CacheManagementHelper.CacheStatistics> getAllCacheStatistics()

getCacheStatistics

public net.sf.ehcache.Statistics getCacheStatistics(String cacheName)
Parameters:
cacheName -
Returns:
the CacheManagementHelper.CacheStatistics for the specified cache; returns null of cache is not alive or doesn't exist
See Also:
Status.STATUS_ALIVE, Cache.getStatus(), Cache.getStatistics()

clearCache

public void clearCache(String cacheName)
Call Cache.removeAll() on the specified cache, if it exists and is alive.

Parameters:
cacheName -
See Also:
Status.STATUS_ALIVE, Cache.getStatus()

clearAllCaches

public void clearAllCaches()
Call clearCache(String) on ALL caches.



Copyright © 2010 Jasig. All Rights Reserved.