net.sf.ehcache.config

Class Configuration

public final class Configuration extends Object

A bean, used by BeanUtils, to set configuration from an XML configuration file.

Version: $Id: Configuration.java 52 2006-04-24 14:50:03Z gregluck $

Author: Greg Luck

Constructor Summary
Configuration()
Empty constructor, which is used by ConfigurationFactory, and can be also sued programmatically.
Method Summary
voidaddCache(CacheConfiguration cacheConfiguration)
Allows BeanHandler to add Cache Configurations to the configuration.
voidaddCacheManagerEventListenerFactory(FactoryConfiguration cacheManagerEventListenerFactoryConfiguration)
Allows BeanHandler to add the CacheManagerEventListener to the configuration.
voidaddCacheManagerPeerListenerFactory(FactoryConfiguration factory)
Adds a CachePeerProviderFactoryConfiguration. cachePeerListenerFactory class="net.sf.ehcache.distribution.RMICacheManagerPeerListenerFactory" properties="hostName=localhost, port=5000"
voidaddCacheManagerPeerProviderFactory(FactoryConfiguration factory)
Adds a CachePeerProviderFactoryConfiguration.
voidaddDefaultCache(CacheConfiguration defaultCacheConfiguration)
Allows BeanHandler to add a default configuration to the configuration.
voidaddDiskStore(DiskStoreConfiguration diskStoreConfigurationParameter)
Allows BeanHandler to add disk store location to the configuration.
MapgetCacheConfigurations()
Gets a Map of cache configurations, keyed by name.
SetgetCacheConfigurationsKeySet()
Gets a Map of cacheConfigurations.
FactoryConfigurationgetCacheManagerEventListenerFactoryConfiguration()
Gets the CacheManagerEventListener factory configuration.
FactoryConfigurationgetCacheManagerPeerListenerFactoryConfiguration()
Gets the CacheManagerPeerListener factory configuration.
FactoryConfigurationgetCacheManagerPeerProviderFactoryConfiguration()
Gets the CacheManagerPeerProvider factory configuration.
StringgetConfigurationSource()
Gets a description of the source from which this configuration was created.
CacheConfigurationgetDefaultCacheConfiguration()
DiskStoreConfigurationgetDiskStoreConfiguration()
Gets the disk store configuration.
voidsetDefaultCacheConfiguration(CacheConfiguration defaultCacheConfiguration)
voidsetSource(String configurationSource)
Sets the configuration source.

Constructor Detail

Configuration

public Configuration()
Empty constructor, which is used by ConfigurationFactory, and can be also sued programmatically.

If you are using it programmtically you need to call the relevant add and setter methods in this class to populate everything.

Method Detail

addCache

public final void addCache(CacheConfiguration cacheConfiguration)
Allows BeanHandler to add Cache Configurations to the configuration.

addCacheManagerEventListenerFactory

public final void addCacheManagerEventListenerFactory(FactoryConfiguration cacheManagerEventListenerFactoryConfiguration)
Allows BeanHandler to add the CacheManagerEventListener to the configuration.

addCacheManagerPeerListenerFactory

public final void addCacheManagerPeerListenerFactory(FactoryConfiguration factory)
Adds a CachePeerProviderFactoryConfiguration. cachePeerListenerFactory class="net.sf.ehcache.distribution.RMICacheManagerPeerListenerFactory" properties="hostName=localhost, port=5000"

addCacheManagerPeerProviderFactory

public final void addCacheManagerPeerProviderFactory(FactoryConfiguration factory)
Adds a CachePeerProviderFactoryConfiguration.

addDefaultCache

public final void addDefaultCache(CacheConfiguration defaultCacheConfiguration)
Allows BeanHandler to add a default configuration to the configuration.

addDiskStore

public final void addDiskStore(DiskStoreConfiguration diskStoreConfigurationParameter)
Allows BeanHandler to add disk store location to the configuration.

getCacheConfigurations

public final Map getCacheConfigurations()
Gets a Map of cache configurations, keyed by name.

getCacheConfigurationsKeySet

public final Set getCacheConfigurationsKeySet()
Gets a Map of cacheConfigurations.

getCacheManagerEventListenerFactoryConfiguration

public final FactoryConfiguration getCacheManagerEventListenerFactoryConfiguration()
Gets the CacheManagerEventListener factory configuration.

getCacheManagerPeerListenerFactoryConfiguration

public final FactoryConfiguration getCacheManagerPeerListenerFactoryConfiguration()
Gets the CacheManagerPeerListener factory configuration.

getCacheManagerPeerProviderFactoryConfiguration

public final FactoryConfiguration getCacheManagerPeerProviderFactoryConfiguration()
Gets the CacheManagerPeerProvider factory configuration.

getConfigurationSource

public final String getConfigurationSource()
Gets a description of the source from which this configuration was created.

getDefaultCacheConfiguration

public final CacheConfiguration getDefaultCacheConfiguration()

Returns: the configuration's default cache configuration

getDiskStoreConfiguration

public final DiskStoreConfiguration getDiskStoreConfiguration()
Gets the disk store configuration.

setDefaultCacheConfiguration

public final void setDefaultCacheConfiguration(CacheConfiguration defaultCacheConfiguration)

Parameters: defaultCacheConfiguration

setSource

public final void setSource(String configurationSource)
Sets the configuration source.

Parameters: configurationSource an informative description of the source, preferably including the resource name and location.