Package net.sf.ehcache.config
Class Configuration
- java.lang.Object
-
- net.sf.ehcache.config.Configuration
-
public final class Configuration extends java.lang.ObjectA bean, used by BeanUtils, to set configuration from an XML configuration file.- Version:
- $Id$
- Author:
- Greg Luck
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classConfiguration.MonitoringRepresents whether monitoring should be enabled or not.classConfiguration.RuntimeCfgRuntime configuration as being used by the CacheManager
-
Field Summary
Fields Modifier and Type Field Description static booleanDEFAULT_DYNAMIC_CONFIGDefault value for dynamicConfigstatic longDEFAULT_MAX_BYTES_OFF_HEAPDefault value for maxBytesLocalOffHeap when not explicitly setstatic longDEFAULT_MAX_BYTES_ON_DISKDefault value for maxBytesLocalDisk when not explicitly setstatic longDEFAULT_MAX_BYTES_ON_HEAPDeprecated.UseDEFAULT_MAX_BYTES_OFF_HEAPinsteadstatic Configuration.MonitoringDEFAULT_MONITORINGDefault value for monitoringstatic SizeOfPolicyConfigurationDEFAULT_SIZEOF_POLICY_CONFIGURATIONDefault sizeOfPolicy configurationstatic FactoryConfigurationDEFAULT_TRANSACTION_MANAGER_LOOKUP_CONFIGDefault transactionManagerLookupConfigurationstatic intDEFAULT_TRANSACTION_TIMEOUTDefault value for defaultTransactionTimeoutInSeconds
-
Constructor Summary
Constructors Constructor Description Configuration()Empty constructor, which is used byConfigurationFactory, and can be also used programmatically.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description 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 CacheManagerPeerListener through FactoryConfiguration.voidaddCacheManagerPeerProviderFactory(FactoryConfiguration factory)Adds a CacheManagerPeerProvider through FactoryConfiguration.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.voidaddManagementRESTService(ManagementRESTServiceConfiguration managementRESTServiceConfiguration)Allows BeanHandler to add a ManagementRESTService configuration to the configurationbooleanaddPropertyChangeListener(java.beans.PropertyChangeListener listener)Adds aPropertyChangeListenerfor this configurationvoidaddSizeOfPolicy(SizeOfPolicyConfiguration sizeOfPolicy)Sets the default SizeOfPolicyConfiguration for this cache manager.voidaddTerracottaConfig(TerracottaClientConfiguration terracottaConfiguration)Allows BeanHandler to add a Terracotta configuration to the configurationvoidaddTransactionManagerLookup(FactoryConfiguration transactionManagerLookupParameter)Allows BeanHandler to add transaction manager lookup to the configuration.Configurationcache(CacheConfiguration cacheConfiguration)Builder to add a new cache through its configConfigurationcacheManagerEventListenerFactory(FactoryConfiguration cacheManagerEventListenerFactoryConfiguration)Builder to set the event lister through a factory, only one of these can be added and subsequent calls are ignored.ConfigurationcacheManagerPeerListenerFactory(FactoryConfiguration factory)Builder method to add a peer listener through a factory.ConfigurationcacheManagerPeerProviderFactory(FactoryConfiguration factory)Builder method to add a peer provider through a factory.voidcleanup()ConfigurationdefaultCache(CacheConfiguration defaultCacheConfiguration)Builder method to set the default cache configuration, this can only be used once.ConfigurationdefaultTransactionTimeoutInSeconds(int defaultTransactionTimeoutInSeconds)Builder to set the default transaction timeout.ConfigurationdiskStore(DiskStoreConfiguration diskStoreConfigurationParameter)Builder to add a disk store to the cache manager, only one disk store can be added.ConfigurationdynamicConfig(boolean dynamicConfig)Builder to set the dynamic config capabilityjava.util.Map<java.lang.String,CacheConfiguration>getCacheConfigurations()Gets a Map of cache configurations, keyed by name.java.util.Set<java.lang.String>getCacheConfigurationsKeySet()Gets a Map of cacheConfigurations.FactoryConfigurationgetCacheManagerEventListenerFactoryConfiguration()Gets the CacheManagerEventListener factory configuration.java.util.List<FactoryConfiguration>getCacheManagerPeerListenerFactoryConfigurations()Gets the CacheManagerPeerListener factory configuration.java.util.List<FactoryConfiguration>getCacheManagerPeerProviderFactoryConfiguration()Gets the CacheManagerPeerProvider factory configuration.java.lang.ClassLoadergetClassLoader()ConfigurationSourcegetConfigurationSource()Gets a description of the source from which this configuration was created.CacheConfigurationgetDefaultCacheConfiguration()intgetDefaultTransactionTimeoutInSeconds()Get default transaction timeoutDiskStoreConfigurationgetDiskStoreConfiguration()Gets the disk store configuration.booleangetDynamicConfig()Get flag for dynamicConfigManagementRESTServiceConfigurationgetManagementRESTService()Gets the ManagementRESTServiceConfigurationlonggetMaxBytesLocalDisk()Maximum amount of bytes the CacheManager will use on the Disk Tier.java.lang.StringgetMaxBytesLocalDiskAsString()longgetMaxBytesLocalHeap()Deprecated.UsegetMaxBytesLocalOffHeap()insteadjava.lang.StringgetMaxBytesLocalHeapAsString()Deprecated.UsegetMaxBytesLocalOffHeapAsString()insteadlonggetMaxBytesLocalOffHeap()Maximum amount of bytes the CacheManager will use on the OffHeap Tier.java.lang.StringgetMaxBytesLocalOffHeapAsString()Configuration.MonitoringgetMonitoring()Get monitoring type, should not be nulljava.lang.StringgetName()CacheManager nameSizeOfPolicyConfigurationgetSizeOfPolicyConfiguration()Gets the SizeOf policy configuration.TerracottaClientConfigurationgetTerracottaConfiguration()Gets the TerracottaClientConfigurationlonggetTotalConfiguredOffheap()FactoryConfigurationgetTransactionManagerLookupConfiguration()Gets the transaction manager lookup configuration.booleangetUpdateCheck()Deprecated.booleanisMaxBytesLocalDiskSet()Checks whether the user explicitly set the maxBytesOnDiskbooleanisMaxBytesLocalHeapSet()Deprecated.UseisMaxBytesLocalOffHeapSet()insteadbooleanisMaxBytesLocalOffHeapSet()Checks whether the user explicitly set the maxBytesOffHeatConfigurationmanagementRESTService(ManagementRESTServiceConfiguration cfg)Builder method to REST management capabilities to the cache manager through a dedicated configuration, this can only be used once.ConfigurationmaxBytesLocalDisk(long amount, MemoryUnit memoryUnit)Sets the maxOnDisk sizeConfigurationmaxBytesLocalHeap(long amount, MemoryUnit memoryUnit)Deprecated.UsemaxBytesLocalOffHeap(long, MemoryUnit)insteadConfigurationmaxBytesLocalOffHeap(long amount, MemoryUnit memoryUnit)Sets the maximum size for the OffHeap tier for all the caches this CacheManagers holds.Configurationmonitoring(Configuration.Monitoring monitoring)Builder to set the monitoring approachConfigurationname(java.lang.String name)Builder to set the cache manager name.booleanremovePropertyChangeListener(java.beans.PropertyChangeListener listener)Removes aPropertyChangeListenerfor this configurationvoidsetClassLoader(java.lang.ClassLoader loader)Set the classloader for the cache manager (and it's associated caches) to use when creating application objects (eg.voidsetDefaultCacheConfiguration(CacheConfiguration defaultCacheConfiguration)voidsetDefaultTransactionTimeoutInSeconds(int defaultTransactionTimeoutInSeconds)Allows BeanHandler to set the default transaction timeout.voidsetDynamicConfig(boolean dynamicConfig)Allows BeanHandler to set the dynamic configuration flagvoidsetMaxBytesLocalDisk(java.lang.Long maxBytesOnDisk)Sets maximum amount of bytes the CacheManager will use on the Disk Tier.voidsetMaxBytesLocalDisk(java.lang.String maxBytesOnDisk)Sets maximum amount of bytes the CacheManager will use on the Disk Tier.voidsetMaxBytesLocalHeap(java.lang.Long maxBytesOnHeap)Deprecated.UsesetMaxBytesLocalOffHeap(Long)} insteadvoidsetMaxBytesLocalHeap(java.lang.String maxBytesOnHeap)Deprecated.UsesetMaxBytesLocalOffHeap(String)insteadvoidsetMaxBytesLocalOffHeap(java.lang.Long maxBytesOffHeap)Sets maximum amount of bytes the CacheManager will use on the OffHeap Tier.voidsetMaxBytesLocalOffHeap(java.lang.String maxBytesOffHeap)Sets maximum amount of bytes the CacheManager will use on the OffHeap Tier.voidsetMonitoring(java.lang.String monitoring)Allows BeanHandler to set the monitoring flagvoidsetName(java.lang.String name)Allows BeanHandler to set the CacheManager name.voidsetSource(ConfigurationSource configurationSource)Sets the configuration source.voidsetUpdateCheck(boolean updateCheck)Deprecated.Configuration.RuntimeCfgsetupFor(CacheManager cacheManager, java.lang.String fallbackName)Freezes part of the configuration that need to be, and runs validation checks on the Configuration.ConfigurationsizeOfPolicy(SizeOfPolicyConfiguration sizeOfPolicyConfiguration)Builder to set the default SizeOfPolicyConfiguration for this cache manager.Configurationsource(ConfigurationSource configurationSource)Builder to set the configuration source.Configurationterracotta(TerracottaClientConfiguration terracottaConfiguration)Builder method to Terracotta capabilities to the cache manager through a dedicated configuration, this can only be used once.ConfigurationtransactionManagerLookup(FactoryConfiguration transactionManagerLookupParameter)Builder to add a transaction manager lookup class to the cache manager, only one of these can be added.ConfigurationupdateCheck(boolean updateCheck)Deprecated.java.util.Collection<ConfigError>validate()Validates the current configuration
-
-
-
Field Detail
-
DEFAULT_DYNAMIC_CONFIG
public static final boolean DEFAULT_DYNAMIC_CONFIG
Default value for dynamicConfig- See Also:
- Constant Field Values
-
DEFAULT_TRANSACTION_TIMEOUT
public static final int DEFAULT_TRANSACTION_TIMEOUT
Default value for defaultTransactionTimeoutInSeconds- See Also:
- Constant Field Values
-
DEFAULT_MAX_BYTES_ON_HEAP
@Deprecated public static final long DEFAULT_MAX_BYTES_ON_HEAP
Deprecated.UseDEFAULT_MAX_BYTES_OFF_HEAPinsteadDefault value for maxBytesLocalHeap when not explicitly set- See Also:
- Constant Field Values
-
DEFAULT_MAX_BYTES_OFF_HEAP
public static final long DEFAULT_MAX_BYTES_OFF_HEAP
Default value for maxBytesLocalOffHeap when not explicitly set- See Also:
- Constant Field Values
-
DEFAULT_MAX_BYTES_ON_DISK
public static final long DEFAULT_MAX_BYTES_ON_DISK
Default value for maxBytesLocalDisk when not explicitly set- See Also:
- Constant Field Values
-
DEFAULT_MONITORING
public static final Configuration.Monitoring DEFAULT_MONITORING
Default value for monitoring
-
DEFAULT_SIZEOF_POLICY_CONFIGURATION
public static final SizeOfPolicyConfiguration DEFAULT_SIZEOF_POLICY_CONFIGURATION
Default sizeOfPolicy configuration
-
DEFAULT_TRANSACTION_MANAGER_LOOKUP_CONFIG
public static final FactoryConfiguration DEFAULT_TRANSACTION_MANAGER_LOOKUP_CONFIG
Default transactionManagerLookupConfiguration
-
-
Constructor Detail
-
Configuration
public Configuration()
Empty constructor, which is used byConfigurationFactory, and can be also used 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
-
setupFor
public Configuration.RuntimeCfg setupFor(CacheManager cacheManager, java.lang.String fallbackName) throws InvalidConfigurationException
Freezes part of the configuration that need to be, and runs validation checks on the Configuration.- Parameters:
cacheManager- the CacheManager instance being configured- Throws:
InvalidConfigurationException- With all the associated errors
-
validate
public java.util.Collection<ConfigError> validate()
Validates the current configuration- Returns:
- the list of errors withing that configuration
-
isMaxBytesLocalDiskSet
public boolean isMaxBytesLocalDiskSet()
Checks whether the user explicitly set the maxBytesOnDisk- Returns:
- true if set by user, false otherwise
- See Also:
setMaxBytesLocalDisk(Long)
-
isMaxBytesLocalOffHeapSet
public boolean isMaxBytesLocalOffHeapSet()
Checks whether the user explicitly set the maxBytesOffHeat- Returns:
- true if set by user, false otherwise
- See Also:
setMaxBytesLocalOffHeap(Long)
-
isMaxBytesLocalHeapSet
@Deprecated public boolean isMaxBytesLocalHeapSet()
Deprecated.UseisMaxBytesLocalOffHeapSet()insteadChecks whether the user explicitly set the maxBytesOnHeap- Returns:
- true if set by user, false otherwise
- See Also:
setMaxBytesLocalHeap(Long)
-
name
public final Configuration name(java.lang.String name)
Builder to set the cache manager name.Cache manager names have constraints on the characters they can use:
- cache managers that are registered as MBeans must obey the
ObjectNamerules for unquoted value. This means the following characters are illegal: ',', '=', ':', '"', '*' and '?'.
- Parameters:
name- the name to set- Returns:
- this configuration instance
- See Also:
setName(String)
- cache managers that are registered as MBeans must obey the
-
setName
public final void setName(java.lang.String name)
Allows BeanHandler to set the CacheManager name.Cache manager names have constraints on the characters they can use:
- cache managers that are registered as MBeans must obey the
ObjectNamerules for unquoted value. This means the following characters are illegal: ',', '=', ':', '"', '*' and '?'.
- cache managers that are registered as MBeans must obey the
-
getName
public final java.lang.String getName()
CacheManager name
-
updateCheck
@Deprecated public final Configuration updateCheck(boolean updateCheck)
Deprecated.Builder to set the state of the automated update check.- Parameters:
updateCheck-trueif the update check should be turned on; orfalseotherwise- Returns:
- this configuration instance
-
setUpdateCheck
@Deprecated public final void setUpdateCheck(boolean updateCheck)
Deprecated.Allows BeanHandler to set the updateCheck flag.
-
getUpdateCheck
@Deprecated public final boolean getUpdateCheck()
Deprecated.Get flag for updateCheck
-
defaultTransactionTimeoutInSeconds
public final Configuration defaultTransactionTimeoutInSeconds(int defaultTransactionTimeoutInSeconds)
Builder to set the default transaction timeout.- Parameters:
defaultTransactionTimeoutInSeconds- the default transaction timeout in seconds- Returns:
- this configuration instance
-
setDefaultTransactionTimeoutInSeconds
public final void setDefaultTransactionTimeoutInSeconds(int defaultTransactionTimeoutInSeconds)
Allows BeanHandler to set the default transaction timeout.
-
getDefaultTransactionTimeoutInSeconds
public final int getDefaultTransactionTimeoutInSeconds()
Get default transaction timeout- Returns:
- default transaction timeout in seconds
-
monitoring
public final Configuration monitoring(Configuration.Monitoring monitoring)
Builder to set the monitoring approach- Parameters:
monitoring- an non-null instance ofConfiguration.Monitoring- Returns:
- this configuration instance
-
setMonitoring
public final void setMonitoring(java.lang.String monitoring)
Allows BeanHandler to set the monitoring flag
-
getMonitoring
public final Configuration.Monitoring getMonitoring()
Get monitoring type, should not be null
-
dynamicConfig
public final Configuration dynamicConfig(boolean dynamicConfig)
Builder to set the dynamic config capability- Parameters:
dynamicConfig-trueif dynamic config should be enabled; orfalseotherwise.- Returns:
- this configuration instance
-
setDynamicConfig
public final void setDynamicConfig(boolean dynamicConfig)
Allows BeanHandler to set the dynamic configuration flag
-
getDynamicConfig
public final boolean getDynamicConfig()
Get flag for dynamicConfig
-
getMaxBytesLocalHeap
@Deprecated public long getMaxBytesLocalHeap()
Deprecated.UsegetMaxBytesLocalOffHeap()insteadMaximum amount of bytes the CacheManager will use on the heap- Returns:
- amount of bytes, 0 is unbound
-
setMaxBytesLocalHeap
@Deprecated public void setMaxBytesLocalHeap(java.lang.String maxBytesOnHeap)
Deprecated.UsesetMaxBytesLocalOffHeap(String)insteadSets maximum amount of bytes the CacheManager will use on the Disk Tier.- Parameters:
maxBytesOnHeap- String representation of the size.- See Also:
MemoryUnit.parseSizeInBytes(String)
-
getMaxBytesLocalHeapAsString
@Deprecated public java.lang.String getMaxBytesLocalHeapAsString()
Deprecated.UsegetMaxBytesLocalOffHeapAsString()instead- Returns:
- Original input for maxBytesLocalHeap
-
setMaxBytesLocalHeap
@Deprecated public void setMaxBytesLocalHeap(java.lang.Long maxBytesOnHeap)
Deprecated.UsesetMaxBytesLocalOffHeap(Long)} insteadSets the maximum amount of bytes the cache manager being configured will use on the OnHeap tier- Parameters:
maxBytesOnHeap- amount of bytes
-
maxBytesLocalHeap
@Deprecated public Configuration maxBytesLocalHeap(long amount, MemoryUnit memoryUnit)
Deprecated.UsemaxBytesLocalOffHeap(long, MemoryUnit)insteadSets the maxOnHeap size for the cache being configured- Parameters:
amount- the amount of unitmemoryUnit- the actual unit- Returns:
- this
- See Also:
setMaxBytesLocalHeap(Long)
-
getMaxBytesLocalOffHeap
public long getMaxBytesLocalOffHeap()
Maximum amount of bytes the CacheManager will use on the OffHeap Tier.- Returns:
- amount in bytes
-
setMaxBytesLocalOffHeap
public void setMaxBytesLocalOffHeap(java.lang.String maxBytesOffHeap)
Sets maximum amount of bytes the CacheManager will use on the OffHeap Tier.- Parameters:
maxBytesOffHeap- String representation of the size.- See Also:
MemoryUnit.parseSizeInBytes(String)
-
getMaxBytesLocalOffHeapAsString
public java.lang.String getMaxBytesLocalOffHeapAsString()
- Returns:
- Original input for maxBytesLocalOffHeap
-
getTotalConfiguredOffheap
public long getTotalConfiguredOffheap()
- Returns:
- Total amount offheap configured by current caches
-
setMaxBytesLocalOffHeap
public void setMaxBytesLocalOffHeap(java.lang.Long maxBytesOffHeap)
Sets maximum amount of bytes the CacheManager will use on the OffHeap Tier.- Parameters:
maxBytesOffHeap- max bytes on disk in bytes. Needs be be greater than 0
-
maxBytesLocalOffHeap
public Configuration maxBytesLocalOffHeap(long amount, MemoryUnit memoryUnit)
Sets the maximum size for the OffHeap tier for all the caches this CacheManagers holds.- Parameters:
amount- the amount of unitmemoryUnit- the actual unit- Returns:
- this
-
getMaxBytesLocalDisk
public long getMaxBytesLocalDisk()
Maximum amount of bytes the CacheManager will use on the Disk Tier.- Returns:
- amount in bytes
-
setMaxBytesLocalDisk
public void setMaxBytesLocalDisk(java.lang.String maxBytesOnDisk)
Sets maximum amount of bytes the CacheManager will use on the Disk Tier.- Parameters:
maxBytesOnDisk- String representation of the size.- See Also:
MemoryUnit.parseSizeInBytes(String)
-
getMaxBytesLocalDiskAsString
public java.lang.String getMaxBytesLocalDiskAsString()
- Returns:
- Original input for maxBytesLocalDisk
-
setMaxBytesLocalDisk
public void setMaxBytesLocalDisk(java.lang.Long maxBytesOnDisk)
Sets maximum amount of bytes the CacheManager will use on the Disk Tier.- Parameters:
maxBytesOnDisk- max bytes on disk in bytes. Needs be be greater than 0
-
maxBytesLocalDisk
public Configuration maxBytesLocalDisk(long amount, MemoryUnit memoryUnit)
Sets the maxOnDisk size- Parameters:
amount- the amount of unitmemoryUnit- the actual unit- Returns:
- this
- See Also:
setMaxBytesLocalDisk(Long)
-
diskStore
public final Configuration diskStore(DiskStoreConfiguration diskStoreConfigurationParameter) throws ObjectExistsException
Builder to add a disk store to the cache manager, only one disk store can be added.- Parameters:
diskStoreConfigurationParameter- the disk store configuration to use- Returns:
- this configuration instance
- Throws:
ObjectExistsException- if the disk store has already been configured
-
addDiskStore
public final void addDiskStore(DiskStoreConfiguration diskStoreConfigurationParameter) throws ObjectExistsException
Allows BeanHandler to add disk store location to the configuration.- Throws:
ObjectExistsException
-
sizeOfPolicy
public final Configuration sizeOfPolicy(SizeOfPolicyConfiguration sizeOfPolicyConfiguration)
Builder to set the default SizeOfPolicyConfiguration for this cache manager.- Parameters:
sizeOfPolicyConfiguration- the SizeOfPolicy Configuration- Returns:
- this configuration instance
-
addSizeOfPolicy
public final void addSizeOfPolicy(SizeOfPolicyConfiguration sizeOfPolicy)
Sets the default SizeOfPolicyConfiguration for this cache manager.- Parameters:
sizeOfPolicy- the SizeOfPolicy Configuration
-
transactionManagerLookup
public final Configuration transactionManagerLookup(FactoryConfiguration transactionManagerLookupParameter) throws ObjectExistsException
Builder to add a transaction manager lookup class to the cache manager, only one of these can be added.- Parameters:
transactionManagerLookupParameter- the transaction manager lookup class to use- Returns:
- this configuration instance
- Throws:
ObjectExistsException- if the transaction manager lookup has already been configured
-
addTransactionManagerLookup
public final void addTransactionManagerLookup(FactoryConfiguration transactionManagerLookupParameter) throws ObjectExistsException
Allows BeanHandler to add transaction manager lookup to the configuration.- Throws:
ObjectExistsException
-
cacheManagerEventListenerFactory
public final Configuration cacheManagerEventListenerFactory(FactoryConfiguration cacheManagerEventListenerFactoryConfiguration)
Builder to set the event lister through a factory, only one of these can be added and subsequent calls are ignored.- Returns:
- this configuration instance
-
addCacheManagerEventListenerFactory
public final void addCacheManagerEventListenerFactory(FactoryConfiguration cacheManagerEventListenerFactoryConfiguration)
Allows BeanHandler to add the CacheManagerEventListener to the configuration.
-
cacheManagerPeerProviderFactory
public final Configuration cacheManagerPeerProviderFactory(FactoryConfiguration factory)
Builder method to add a peer provider through a factory.- Returns:
- this configuration instance
-
addCacheManagerPeerProviderFactory
public final void addCacheManagerPeerProviderFactory(FactoryConfiguration factory)
Adds a CacheManagerPeerProvider through FactoryConfiguration.
-
cacheManagerPeerListenerFactory
public final Configuration cacheManagerPeerListenerFactory(FactoryConfiguration factory)
Builder method to add a peer listener through a factory.- Returns:
- this configuration instance
-
addCacheManagerPeerListenerFactory
public final void addCacheManagerPeerListenerFactory(FactoryConfiguration factory)
Adds a CacheManagerPeerListener through FactoryConfiguration.
-
terracotta
public final Configuration terracotta(TerracottaClientConfiguration terracottaConfiguration) throws ObjectExistsException
Builder method to Terracotta capabilities to the cache manager through a dedicated configuration, this can only be used once.- Returns:
- this configuration instance
- Throws:
ObjectExistsException- if the Terracotta config has already been configured
-
addTerracottaConfig
public final void addTerracottaConfig(TerracottaClientConfiguration terracottaConfiguration) throws ObjectExistsException
Allows BeanHandler to add a Terracotta configuration to the configuration- Throws:
ObjectExistsException
-
managementRESTService
public final Configuration managementRESTService(ManagementRESTServiceConfiguration cfg) throws ObjectExistsException
Builder method to REST management capabilities to the cache manager through a dedicated configuration, this can only be used once.- Returns:
- this configuration instance
- Throws:
ObjectExistsException- if the REST management config has already been configured
-
addManagementRESTService
public final void addManagementRESTService(ManagementRESTServiceConfiguration managementRESTServiceConfiguration) throws ObjectExistsException
Allows BeanHandler to add a ManagementRESTService configuration to the configuration- Throws:
ObjectExistsException
-
defaultCache
public final Configuration defaultCache(CacheConfiguration defaultCacheConfiguration) throws ObjectExistsException
Builder method to set the default cache configuration, this can only be used once.- Returns:
- this configuration instance
- Throws:
ObjectExistsException- if the default cache config has already been configured
-
addDefaultCache
public final void addDefaultCache(CacheConfiguration defaultCacheConfiguration) throws ObjectExistsException
Allows BeanHandler to add a default configuration to the configuration.- Throws:
ObjectExistsException
-
cache
public final Configuration cache(CacheConfiguration cacheConfiguration) throws ObjectExistsException
Builder to add a new cache through its config- Returns:
- this configuration instance
- Throws:
ObjectExistsException- if a cache with the same name already exists, or if the name conflicts with the name of the default cache
-
addCache
public final void addCache(CacheConfiguration cacheConfiguration) throws ObjectExistsException
Allows BeanHandler to add Cache Configurations to the configuration.- Throws:
ObjectExistsException
-
getCacheConfigurationsKeySet
public final java.util.Set<java.lang.String> getCacheConfigurationsKeySet()
Gets a Map of cacheConfigurations.
-
getDefaultCacheConfiguration
public final CacheConfiguration getDefaultCacheConfiguration()
- Returns:
- the configuration's default cache configuration
-
setDefaultCacheConfiguration
public final void setDefaultCacheConfiguration(CacheConfiguration defaultCacheConfiguration)
- Parameters:
defaultCacheConfiguration-
-
getDiskStoreConfiguration
public final DiskStoreConfiguration getDiskStoreConfiguration()
Gets the disk store configuration.
-
getSizeOfPolicyConfiguration
public final SizeOfPolicyConfiguration getSizeOfPolicyConfiguration()
Gets the SizeOf policy configuration.
-
getTransactionManagerLookupConfiguration
public final FactoryConfiguration getTransactionManagerLookupConfiguration()
Gets the transaction manager lookup configuration.
-
getCacheManagerPeerProviderFactoryConfiguration
public final java.util.List<FactoryConfiguration> getCacheManagerPeerProviderFactoryConfiguration()
Gets the CacheManagerPeerProvider factory configuration.
-
getCacheManagerPeerListenerFactoryConfigurations
public final java.util.List<FactoryConfiguration> getCacheManagerPeerListenerFactoryConfigurations()
Gets the CacheManagerPeerListener factory configuration.
-
getManagementRESTService
public final ManagementRESTServiceConfiguration getManagementRESTService()
Gets the ManagementRESTServiceConfiguration
-
getCacheManagerEventListenerFactoryConfiguration
public final FactoryConfiguration getCacheManagerEventListenerFactoryConfiguration()
Gets the CacheManagerEventListener factory configuration.
-
getTerracottaConfiguration
public final TerracottaClientConfiguration getTerracottaConfiguration()
Gets the TerracottaClientConfiguration
-
getCacheConfigurations
public final java.util.Map<java.lang.String,CacheConfiguration> getCacheConfigurations()
Gets a Map of cache configurations, keyed by name.
-
source
public final Configuration source(ConfigurationSource configurationSource)
Builder to set the configuration source.- Returns:
- this configuration instance
-
setSource
public final void setSource(ConfigurationSource configurationSource)
Sets the configuration source.- Parameters:
configurationSource- an informative description of the source, preferably including the resource name and location.
-
getConfigurationSource
public final ConfigurationSource getConfigurationSource()
Gets a description of the source from which this configuration was created.
-
addPropertyChangeListener
public boolean addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Adds aPropertyChangeListenerfor this configuration- Parameters:
listener- the listener instance- Returns:
- true if added, false otherwise
-
removePropertyChangeListener
public boolean removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Removes aPropertyChangeListenerfor this configuration- Parameters:
listener- the listener to be removed- Returns:
- true if removed, false otherwise
-
getClassLoader
public java.lang.ClassLoader getClassLoader()
-
setClassLoader
public void setClassLoader(java.lang.ClassLoader loader)
Set the classloader for the cache manager (and it's associated caches) to use when creating application objects (eg. cache values, event listeners, etc). The default classloading behavior is to prefer Thread.currentThread().getContextClassLoader() and fallback to the classloader that loaded ehcache itself.- Parameters:
loader- the classloader to use
-
cleanup
public void cleanup()
-
-