public class EhCacheCacheProvider extends Object implements CacheProvider, GuiceServletContextListener.CleanupCapable
| Constructor and Description |
|---|
EhCacheCacheProvider(String configPath,
String filterPath,
boolean jmxEnabled,
boolean withCacheStats,
GuiceServletContextListener.CleanupHandler cleanupHandler) |
| Modifier and Type | Method and Description |
|---|---|
void |
cleanup()
Perform a shutdown of the underlying cache manager.
|
<K,V> Cache<K,V> |
createCache(String name)
Create a named single instance cache in this cache manager, if the cache
already exists, return it if the name is null, a new anonymous cache is
created
|
protected net.sf.ehcache.config.Configuration |
getConfiguration(String configPath)
Read the cache configuration from the specified resource.
|
@Inject public EhCacheCacheProvider(String configPath, String filterPath, boolean jmxEnabled, boolean withCacheStats, GuiceServletContextListener.CleanupHandler cleanupHandler) throws IOException
configPath - the path to the EhCache configuration filefilterPath - the path to the EhCache SizeOf engine filter filejmxEnabled - true if JMX should be enabled for EhCache, false otherwisewithCacheStats - true if cache statistics should be enabled globally, false otherwisecleanupHandler - cleanup handler with which to register to ensure proper cache shutdown via
cleanup()IOException - if there was an issue parsing the given configurationprotected net.sf.ehcache.config.Configuration getConfiguration(String configPath) throws IOException
configPath - the path to the configuration fileIOException - if there was an error parsing the given configurationpublic void cleanup()
cleanup in interface GuiceServletContextListener.CleanupCapablepublic <K,V> Cache<K,V> createCache(String name)
createCache in interface CacheProviderK - The Key type for the cacheV - The pay-load typename - The non-null name of the cache.Copyright © 2007-2014 The Apache Software Foundation. All Rights Reserved.