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 EhcacheController
utility cache controller if you dont want to create your own...protected void
finalize()
void
Flush all caches.net.sf.ehcache.Cache
Note, this might be better to be used from GrouperCachenet.sf.ehcache.Cache
getCache
(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.CacheManager
get the mgrnet.sf.ehcache.config.Configuration
save 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.void
Initialize privilege cache.boolean
if configured via properties and not ehcache.xmlvoid
stop()
-
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:
flushCache
in 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:
initialize
in interfaceCacheController
- Since:
- 1.2.1
-
getStats
- Specified by:
getStats
in interfaceCacheController
- Returns:
- ehcache statistics for cache.
-