Package net.sf.ehcache.config
Class ConfigurationHelper
- java.lang.Object
-
- net.sf.ehcache.config.ConfigurationHelper
-
public final class ConfigurationHelper extends java.lang.ObjectThe configuration for ehcache.This class can be populated through:
- introspection by
ConfigurationFactoryor - programmatically
- Version:
- $Id$
- Author:
- Greg Luck
- introspection by
-
-
Constructor Summary
Constructors Constructor Description ConfigurationHelper(CacheManager cacheManager, Configuration configuration)Only Constructor
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description java.util.List<Ehcache>createCacheDecorators(Ehcache cache)Creates decorated ehcaches for the cache, if any configured in ehcache.xmlstatic CacheExceptionHandlercreateCacheExceptionHandler(CacheConfiguration.CacheExceptionHandlerFactoryConfiguration factoryConfiguration, java.lang.ClassLoader loader)Tries to create a CacheLoader from the configuration using the factory specified.CacheManagerEventListenercreateCacheManagerEventListener(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 nulljava.util.Map<java.lang.String,CacheManagerPeerProvider>createCachePeerProviders()Tries to load the class specified otherwise defaults to nulljava.util.SetcreateCaches()Creates unitialised caches for each cache configuration foundEhcachecreateDefaultCache()static java.util.List<Ehcache>createDefaultCacheDecorators(Ehcache cache, CacheConfiguration defaultCacheConfiguration, java.lang.ClassLoader loader)Creates default cache decorators specified in the default cache configuration if anyConfigurationgetConfigurationBean()java.lang.StringgetDiskStorePath()static java.lang.Class<?>getSearchAttributeType(SearchAttribute sa, java.lang.ClassLoader loader)Deprecated.internal use onlyintnumberOfCachesThatUseDiskStorage()Calculates the number of caches in the configuration that are diskPersistent
-
-
-
Constructor Detail
-
ConfigurationHelper
public ConfigurationHelper(CacheManager cacheManager, Configuration configuration)
Only Constructor- Parameters:
cacheManager-configuration-
-
-
Method Detail
-
createCacheExceptionHandler
public static CacheExceptionHandler createCacheExceptionHandler(CacheConfiguration.CacheExceptionHandlerFactoryConfiguration factoryConfiguration, java.lang.ClassLoader loader) throws CacheException
Tries to create a CacheLoader from the configuration using the factory specified.- Returns:
- The CacheExceptionHandler, or null if it could not be found.
- Throws:
CacheException
-
createCachePeerProviders
public java.util.Map<java.lang.String,CacheManagerPeerProvider> createCachePeerProviders()
Tries to load the class specified otherwise defaults to null- Returns:
- a map of CacheManagerPeerProviders
-
createCachePeerListeners
public java.util.Map<java.lang.String,CacheManagerPeerListener> createCachePeerListeners()
Tries to load the class specified otherwise defaults to null
-
createCacheManagerEventListener
public final CacheManagerEventListener createCacheManagerEventListener(CacheManager cacheManager) throws CacheException
Tries to load the class specified.- Parameters:
cacheManager-- Returns:
- If there is none returns null.
- Throws:
CacheException
-
getDiskStorePath
public final java.lang.String getDiskStorePath()
- Returns:
- the disk store path, or null if not set.
-
createDefaultCache
public final Ehcache createDefaultCache() throws CacheException
- Returns:
- the Default Cache
- Throws:
CacheException- if there is no default cache
-
createCaches
public final java.util.Set createCaches()
Creates unitialised caches for each cache configuration found- Returns:
- an empty set if there are none,
-
numberOfCachesThatUseDiskStorage
public final int numberOfCachesThatUseDiskStorage()
Calculates the number of caches in the configuration that are diskPersistent
-
createCacheDecorators
public java.util.List<Ehcache> createCacheDecorators(Ehcache cache)
Creates decorated ehcaches for the cache, if any configured in ehcache.xml- Parameters:
cache- the cache- Returns:
- List of the decorated ehcaches, if any configured in ehcache.xml otherwise returns empty list
-
createDefaultCacheDecorators
public static java.util.List<Ehcache> createDefaultCacheDecorators(Ehcache cache, CacheConfiguration defaultCacheConfiguration, java.lang.ClassLoader loader)
Creates default cache decorators specified in the default cache configuration if any- Parameters:
cache- the underlying cache that will be decorateddefaultCacheConfiguration- default cache configurationloader-- Returns:
- list of decorated caches
-
getSearchAttributeType
public static java.lang.Class<?> getSearchAttributeType(SearchAttribute sa, java.lang.ClassLoader loader)
Deprecated.internal use only- Parameters:
sa- search attribute- Returns:
- attribute type as class
-
getConfigurationBean
public final Configuration getConfigurationBean()
- Returns:
- the Configuration used
-
-