Class EhcacheController
java.lang.Object
edu.internet2.middleware.grouper.cache.EhcacheController
- All Implemented Interfaces:
CacheController
Base class for common cache operations.
- Since:
- 1.2.1
- Version:
- $Id: EhcacheController.java,v 1.13 2009-08-11 20:34:18 mchyzer Exp $
-
Method Summary
Modifier and TypeMethodDescriptionstatic EhcacheControllerutility cache controller if you dont want to create your own...protected voidfinalize()voidFlush all caches.net.sf.ehcache.CacheNote, this might be better to be used from GrouperCachenet.sf.ehcache.CachegetCache(String name, boolean useDefaultIfNotInConfigFile, int defaultMaxElementsInMemory, boolean defaultEternal, int defaultTimeToIdleSeconds, int defaultTimeToLiveSeconds, boolean defaultOverflowToDisk) Note, this might be better to be used from GrouperCachenet.sf.ehcache.CacheManagerget the mgrnet.sf.ehcache.config.Configurationsave the configgetGrouperCache(String name) Retrieve a grouper cache (like a generic Map)getGrouperCache(String name, boolean useDefaultIfNotInConfigFile, int defaultMaxElementsInMemory, boolean defaultEternal, int defaultTimeToIdleSeconds, int defaultTimeToLiveSeconds, boolean defaultOverflowToDisk) Retrieve a GrouperCache which is a generic Map cache.voidInitialize privilege cache.booleanif configured via properties and not ehcache.xmlvoidstop()
-
Method Details
-
getconfiguration
public net.sf.ehcache.config.Configuration getconfiguration()save the config- Returns:
- the configuration
-
isConfiguredViaProperties
public boolean isConfiguredViaProperties()if configured via properties and not ehcache.xml- Returns:
- the configuredViaProperties
-
getCacheManager
public net.sf.ehcache.CacheManager getCacheManager()get the mgr- Returns:
- the mge
-
ehcacheController
utility cache controller if you dont want to create your own...- Returns:
- ehcache controller
-
finalize
-
stop
public void stop()- See Also:
-
flushCache
public void flushCache()Flush all caches.- Specified by:
flushCachein interfaceCacheController- Since:
- 1.2.1
-
getGrouperCache
Retrieve a grouper cache (like a generic Map)- Parameters:
name- should be unique, prefix with fully qualified classname- Returns:
- Cache name.
- Throws:
IllegalStateException- if cache not found.- Since:
- 1.2.1
-
getGrouperCache
public GrouperCache getGrouperCache(String name, boolean useDefaultIfNotInConfigFile, int defaultMaxElementsInMemory, boolean defaultEternal, int defaultTimeToIdleSeconds, int defaultTimeToLiveSeconds, boolean defaultOverflowToDisk) throws IllegalStateException Retrieve a GrouperCache which is a generic Map cache. Note the defaults are only used in the first invocation of the cache retrieval.- Parameters:
name- should be unique, prefix with fully qualified classnameuseDefaultIfNotInConfigFile- use the defaults if not in the config filedefaultMaxElementsInMemory- if not in config file, this is max elements in memorydefaultEternal- if not in config file, true to never expire stuffdefaultTimeToIdleSeconds- if not in config file, time where if not accessed, will expiredefaultTimeToLiveSeconds- if not in config file, time where even if accessed, will expiredefaultOverflowToDisk- if not in config file, if it should go to disk in overflow- Returns:
- Cache name.
- Throws:
IllegalStateException- if cache not found.- Since:
- 1.2.1
-
getCache
Note, this might be better to be used from GrouperCache- Parameters:
name- should be unique, prefix with fully qualified classname- Returns:
- Cache name.
- Throws:
IllegalStateException- if cache not found.- Since:
- 1.2.1
-
getCache
public net.sf.ehcache.Cache getCache(String name, boolean useDefaultIfNotInConfigFile, int defaultMaxElementsInMemory, boolean defaultEternal, int defaultTimeToIdleSeconds, int defaultTimeToLiveSeconds, boolean defaultOverflowToDisk) throws IllegalStateException Note, this might be better to be used from GrouperCache- Parameters:
name- should be unique, prefix with fully qualified classnameuseDefaultIfNotInConfigFile- use the defaults if not in the config filedefaultMaxElementsInMemory- if not in config file, this is max elements in memorydefaultEternal- if not in config file, true to never expire stuffdefaultTimeToIdleSeconds- if not in config file, time where if not accessed, will expiredefaultTimeToLiveSeconds- if not in config file, time where even if accessed, will expiredefaultOverflowToDisk- if not in config file, if it should go to disk in overflow- Returns:
- Cache name.
- Throws:
IllegalStateException- if cache not found.- Since:
- 1.2.1
-
initialize
public void initialize()Initialize privilege cache.- Specified by:
initializein interfaceCacheController- Since:
- 1.2.1
-
getStats
- Specified by:
getStatsin interfaceCacheController- Returns:
- ehcache statistics for cache.
-