public final class ConfigurationHelper
extends java.lang.Object
ConfigurationFactory
or
Modifier and Type | Field and Description |
---|---|
private CacheManager |
cacheManager |
private Configuration |
configuration |
private static org.slf4j.Logger |
LOG |
Constructor and Description |
---|
ConfigurationHelper(CacheManager cacheManager,
Configuration configuration)
Only Constructor
|
Modifier and Type | Method and Description |
---|---|
private Ehcache |
applyCacheExceptionHandler(CacheConfiguration cacheConfiguration,
Ehcache cache) |
(package private) Ehcache |
createCache(CacheConfiguration cacheConfiguration)
Create a cache given a cache configuration
|
java.util.List<Ehcache> |
createCacheDecorators(Ehcache cache)
Creates decorated ehcaches for the cache, if any configured in ehcache.xml
|
static CacheExceptionHandler |
createCacheExceptionHandler(CacheConfiguration.CacheExceptionHandlerFactoryConfiguration factoryConfiguration)
Tries to create a CacheLoader from the configuration using the factory
specified.
|
(package private) Ehcache |
createCacheFromName(java.lang.String name)
Creates a cache from configuration where the configuration cache name matches the given name
|
CacheManagerEventListener |
createCacheManagerEventListener(CacheManager cacheManager)
Tries to load the class specified.
|
java.util.Map<java.lang.String,CacheManagerPeerListener> |
createCachePeerListeners()
Tries to load the class specified otherwise defaults to null
|
java.util.Map<java.lang.String,CacheManagerPeerProvider> |
createCachePeerProviders()
Tries to load the class specified otherwise defaults to null
|
java.util.Set |
createCaches()
Creates unitialised caches for each cache configuration found
|
private static Ehcache |
createDecoratedCache(Ehcache cache,
CacheConfiguration.CacheDecoratorFactoryConfiguration factoryConfiguration,
boolean forDefaultCache)
Creates the decorated cache from the decorator config specified.
|
Ehcache |
createDefaultCache() |
static java.util.List<Ehcache> |
createDefaultCacheDecorators(Ehcache cache,
CacheConfiguration defaultCacheConfiguration)
Creates default cache decorators specified in the default cache configuration if any
|
Configuration |
getConfigurationBean() |
java.lang.String |
getDiskStorePath() |
int |
numberOfCachesThatUseDiskStorage()
Calculates the number of caches in the configuration that are diskPersistent
|
private static final org.slf4j.Logger LOG
private final Configuration configuration
private final CacheManager cacheManager
public ConfigurationHelper(CacheManager cacheManager, Configuration configuration)
cacheManager
- configuration
- public static CacheExceptionHandler createCacheExceptionHandler(CacheConfiguration.CacheExceptionHandlerFactoryConfiguration factoryConfiguration) throws CacheException
CacheException
public java.util.Map<java.lang.String,CacheManagerPeerProvider> createCachePeerProviders()
public java.util.Map<java.lang.String,CacheManagerPeerListener> createCachePeerListeners()
public final CacheManagerEventListener createCacheManagerEventListener(CacheManager cacheManager) throws CacheException
cacheManager
- CacheException
public final java.lang.String getDiskStorePath()
public final Ehcache createDefaultCache() throws CacheException
CacheException
- if there is no default cachepublic final java.util.Set createCaches()
public final int numberOfCachesThatUseDiskStorage()
final Ehcache createCacheFromName(java.lang.String name)
final Ehcache createCache(CacheConfiguration cacheConfiguration)
cacheConfiguration
- private Ehcache applyCacheExceptionHandler(CacheConfiguration cacheConfiguration, Ehcache cache)
public java.util.List<Ehcache> createCacheDecorators(Ehcache cache)
cache
- the cachepublic static java.util.List<Ehcache> createDefaultCacheDecorators(Ehcache cache, CacheConfiguration defaultCacheConfiguration)
cache
- the underlying cache that will be decorateddefaultCacheConfiguration
- default cache configurationprivate static Ehcache createDecoratedCache(Ehcache cache, CacheConfiguration.CacheDecoratorFactoryConfiguration factoryConfiguration, boolean forDefaultCache)
public final Configuration getConfigurationBean()