|
ehcache | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.ehcache.config.Configuration
public final class Configuration
A bean, used by BeanUtils, to set configuration from an XML configuration file.
Nested Class Summary | |
---|---|
static class |
Configuration.Monitoring
Represents whether monitoring should be enabled or not. |
class |
Configuration.RuntimeCfg
Runtime configuration as being used by the CacheManager |
Field Summary | |
---|---|
static boolean |
DEFAULT_DYNAMIC_CONFIG
Default value for dynamicConfig |
static long |
DEFAULT_MAX_BYTES_OFF_HEAP
Default value for maxBytesLocalOffHeap when not explicitly set |
static long |
DEFAULT_MAX_BYTES_ON_DISK
Default value for maxBytesLocalDisk when not explicitly set |
static long |
DEFAULT_MAX_BYTES_ON_HEAP
Default value for maxBytesLocalHeap when not explicitly set |
static Configuration.Monitoring |
DEFAULT_MONITORING
Default value for monitoring |
static SizeOfPolicyConfiguration |
DEFAULT_SIZEOF_POLICY_CONFIGURATION
Default sizeOfPolicy configuration |
static FactoryConfiguration |
DEFAULT_TRANSACTION_MANAGER_LOOKUP_CONFIG
Default transactionManagerLookupConfiguration |
static int |
DEFAULT_TRANSACTION_TIMEOUT
Default value for defaultTransactionTimeoutInSeconds |
Constructor Summary | |
---|---|
Configuration()
Empty constructor, which is used by ConfigurationFactory , and can be also used programmatically. |
Method Summary | |
---|---|
void |
addCache(CacheConfiguration cacheConfiguration)
Allows BeanHandler to add Cache Configurations to the configuration. |
void |
addCacheManagerEventListenerFactory(FactoryConfiguration cacheManagerEventListenerFactoryConfiguration)
Allows BeanHandler to add the CacheManagerEventListener to the configuration. |
void |
addCacheManagerPeerListenerFactory(FactoryConfiguration factory)
Adds a CacheManagerPeerListener through FactoryConfiguration. |
void |
addCacheManagerPeerProviderFactory(FactoryConfiguration factory)
Adds a CacheManagerPeerProvider through FactoryConfiguration. |
void |
addDefaultCache(CacheConfiguration defaultCacheConfiguration)
Allows BeanHandler to add a default configuration to the configuration. |
void |
addDiskStore(DiskStoreConfiguration diskStoreConfigurationParameter)
Allows BeanHandler to add disk store location to the configuration. |
void |
addManagementRESTService(ManagementRESTServiceConfiguration managementRESTServiceConfiguration)
Allows BeanHandler to add a ManagementRESTService configuration to the configuration |
boolean |
addPropertyChangeListener(PropertyChangeListener listener)
Adds a PropertyChangeListener for this configuration |
void |
addSizeOfPolicy(SizeOfPolicyConfiguration sizeOfPolicy)
Sets the default SizeOfPolicyConfiguration for this cache manager. |
void |
addTerracottaConfig(TerracottaClientConfiguration terracottaConfiguration)
Allows BeanHandler to add a Terracotta configuration to the configuration |
void |
addTransactionManagerLookup(FactoryConfiguration transactionManagerLookupParameter)
Allows BeanHandler to add transaction manager lookup to the configuration. |
Configuration |
cache(CacheConfiguration cacheConfiguration)
Builder to add a new cache through its config |
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. |
Configuration |
cacheManagerPeerListenerFactory(FactoryConfiguration factory)
Builder method to add a peer listener through a factory. |
Configuration |
cacheManagerPeerProviderFactory(FactoryConfiguration factory)
Builder method to add a peer provider through a factory. |
void |
cleanup()
|
Configuration |
defaultCache(CacheConfiguration defaultCacheConfiguration)
Builder method to set the default cache configuration, this can only be used once. |
Configuration |
defaultTransactionTimeoutInSeconds(int defaultTransactionTimeoutInSeconds)
Builder to set the default transaction timeout. |
Configuration |
diskStore(DiskStoreConfiguration diskStoreConfigurationParameter)
Builder to add a disk store to the cache manager, only one disk store can be added. |
Configuration |
dynamicConfig(boolean dynamicConfig)
Builder to set the dynamic config capability |
Map<String,CacheConfiguration> |
getCacheConfigurations()
Gets a Map of cache configurations, keyed by name. |
Set<String> |
getCacheConfigurationsKeySet()
Gets a Map of cacheConfigurations. |
FactoryConfiguration |
getCacheManagerEventListenerFactoryConfiguration()
Gets the CacheManagerEventListener factory configuration. |
List<FactoryConfiguration> |
getCacheManagerPeerListenerFactoryConfigurations()
Gets the CacheManagerPeerListener factory configuration. |
List<FactoryConfiguration> |
getCacheManagerPeerProviderFactoryConfiguration()
Gets the CacheManagerPeerProvider factory configuration. |
ClassLoader |
getClassLoader()
|
ConfigurationSource |
getConfigurationSource()
Gets a description of the source from which this configuration was created. |
CacheConfiguration |
getDefaultCacheConfiguration()
|
int |
getDefaultTransactionTimeoutInSeconds()
Get default transaction timeout |
DiskStoreConfiguration |
getDiskStoreConfiguration()
Gets the disk store configuration. |
boolean |
getDynamicConfig()
Get flag for dynamicConfig |
ManagementRESTServiceConfiguration |
getManagementRESTService()
Gets the ManagementRESTServiceConfiguration |
long |
getMaxBytesLocalDisk()
Maximum amount of bytes the CacheManager will use on the Disk Tier. |
String |
getMaxBytesLocalDiskAsString()
|
long |
getMaxBytesLocalHeap()
Maximum amount of bytes the CacheManager will use on the heap |
String |
getMaxBytesLocalHeapAsString()
|
long |
getMaxBytesLocalOffHeap()
Maximum amount of bytes the CacheManager will use on the OffHeap Tier. |
String |
getMaxBytesLocalOffHeapAsString()
|
Configuration.Monitoring |
getMonitoring()
Get monitoring type, should not be null |
String |
getName()
CacheManager name |
SizeOfPolicyConfiguration |
getSizeOfPolicyConfiguration()
Gets the SizeOf policy configuration. |
TerracottaClientConfiguration |
getTerracottaConfiguration()
Gets the TerracottaClientConfiguration |
long |
getTotalConfiguredOffheap()
|
FactoryConfiguration |
getTransactionManagerLookupConfiguration()
Gets the transaction manager lookup configuration. |
boolean |
getUpdateCheck()
Deprecated. |
boolean |
isMaxBytesLocalDiskSet()
Checks whether the user explicitly set the maxBytesOnDisk |
boolean |
isMaxBytesLocalHeapSet()
Checks whether the user explicitly set the maxBytesOnHeap |
boolean |
isMaxBytesLocalOffHeapSet()
Checks whether the user explicitly set the maxBytesOffHeat |
Configuration |
managementRESTService(ManagementRESTServiceConfiguration cfg)
Builder method to REST management capabilities to the cache manager through a dedicated configuration, this can only be used once. |
Configuration |
maxBytesLocalDisk(long amount,
MemoryUnit memoryUnit)
Sets the maxOnDisk size |
Configuration |
maxBytesLocalHeap(long amount,
MemoryUnit memoryUnit)
Sets the maxOnHeap size for the cache being configured |
Configuration |
maxBytesLocalOffHeap(long amount,
MemoryUnit memoryUnit)
Sets the maximum size for the OffHeap tier for all the caches this CacheManagers holds. |
Configuration |
monitoring(Configuration.Monitoring monitoring)
Builder to set the monitoring approach |
Configuration |
name(String name)
Builder to set the cache manager name. |
boolean |
removePropertyChangeListener(PropertyChangeListener listener)
Removes a PropertyChangeListener for this configuration |
void |
setClassLoader(ClassLoader loader)
Set the classloader for the cache manager (and it's associated caches) to use when creating application objects (eg. |
void |
setDefaultCacheConfiguration(CacheConfiguration defaultCacheConfiguration)
|
void |
setDefaultTransactionTimeoutInSeconds(int defaultTransactionTimeoutInSeconds)
Allows BeanHandler to set the default transaction timeout. |
void |
setDynamicConfig(boolean dynamicConfig)
Allows BeanHandler to set the dynamic configuration flag |
void |
setMaxBytesLocalDisk(Long maxBytesOnDisk)
Sets maximum amount of bytes the CacheManager will use on the Disk Tier. |
void |
setMaxBytesLocalDisk(String maxBytesOnDisk)
Sets maximum amount of bytes the CacheManager will use on the Disk Tier. |
void |
setMaxBytesLocalHeap(Long maxBytesOnHeap)
Sets the maximum amount of bytes the cache manager being configured will use on the OnHeap tier |
void |
setMaxBytesLocalHeap(String maxBytesOnHeap)
Sets maximum amount of bytes the CacheManager will use on the Disk Tier. |
void |
setMaxBytesLocalOffHeap(Long maxBytesOffHeap)
Sets maximum amount of bytes the CacheManager will use on the OffHeap Tier. |
void |
setMaxBytesLocalOffHeap(String maxBytesOffHeap)
Sets maximum amount of bytes the CacheManager will use on the OffHeap Tier. |
void |
setMonitoring(String monitoring)
Allows BeanHandler to set the monitoring flag |
void |
setName(String name)
Allows BeanHandler to set the CacheManager name. |
void |
setSource(ConfigurationSource configurationSource)
Sets the configuration source. |
void |
setUpdateCheck(boolean updateCheck)
Deprecated. |
Configuration.RuntimeCfg |
setupFor(CacheManager cacheManager,
String fallbackName)
Freezes part of the configuration that need to be, and runs validation checks on the Configuration. |
Configuration |
sizeOfPolicy(SizeOfPolicyConfiguration sizeOfPolicyConfiguration)
Builder to set the default SizeOfPolicyConfiguration for this cache manager. |
Configuration |
source(ConfigurationSource configurationSource)
Builder to set the configuration source. |
Configuration |
terracotta(TerracottaClientConfiguration terracottaConfiguration)
Builder method to Terracotta capabilities to the cache manager through a dedicated configuration, this can only be used once. |
Configuration |
transactionManagerLookup(FactoryConfiguration transactionManagerLookupParameter)
Builder to add a transaction manager lookup class to the cache manager, only one of these can be added. |
Configuration |
updateCheck(boolean updateCheck)
Deprecated. |
Collection<ConfigError> |
validate()
Validates the current configuration |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final boolean DEFAULT_DYNAMIC_CONFIG
public static final int DEFAULT_TRANSACTION_TIMEOUT
public static final long DEFAULT_MAX_BYTES_ON_HEAP
public static final long DEFAULT_MAX_BYTES_OFF_HEAP
public static final long DEFAULT_MAX_BYTES_ON_DISK
public static final Configuration.Monitoring DEFAULT_MONITORING
public static final SizeOfPolicyConfiguration DEFAULT_SIZEOF_POLICY_CONFIGURATION
public static final FactoryConfiguration DEFAULT_TRANSACTION_MANAGER_LOOKUP_CONFIG
Constructor Detail |
---|
public Configuration()
ConfigurationFactory
, 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 |
---|
public Configuration.RuntimeCfg setupFor(CacheManager cacheManager, String fallbackName) throws InvalidConfigurationException
cacheManager
- the CacheManager instance being configured
InvalidConfigurationException
- With all the associated errorspublic Collection<ConfigError> validate()
public boolean isMaxBytesLocalDiskSet()
setMaxBytesLocalDisk(Long)
public boolean isMaxBytesLocalOffHeapSet()
setMaxBytesLocalOffHeap(Long)
public boolean isMaxBytesLocalHeapSet()
setMaxBytesLocalHeap(Long)
public final Configuration name(String name)
ObjectName
rules for unquoted value.
This means the following characters are illegal: ',', '=', ':', '"', '*' and '?'.
name
- the name to set
setName(String)
public final void setName(String name)
ObjectName
rules for unquoted value.
This means the following characters are illegal: ',', '=', ':', '"', '*' and '?'.
public final String getName()
@Deprecated public final Configuration updateCheck(boolean updateCheck)
updateCheck
- true
if the update check should be turned on; or false
otherwise
@Deprecated public final void setUpdateCheck(boolean updateCheck)
@Deprecated public final boolean getUpdateCheck()
public final Configuration defaultTransactionTimeoutInSeconds(int defaultTransactionTimeoutInSeconds)
defaultTransactionTimeoutInSeconds
- the default transaction timeout in seconds
public final void setDefaultTransactionTimeoutInSeconds(int defaultTransactionTimeoutInSeconds)
public final int getDefaultTransactionTimeoutInSeconds()
public final Configuration monitoring(Configuration.Monitoring monitoring)
monitoring
- an non-null instance of Configuration.Monitoring
public final void setMonitoring(String monitoring)
public final Configuration.Monitoring getMonitoring()
public final Configuration dynamicConfig(boolean dynamicConfig)
dynamicConfig
- true
if dynamic config should be enabled; or false
otherwise.
public final void setDynamicConfig(boolean dynamicConfig)
public final boolean getDynamicConfig()
public long getMaxBytesLocalHeap()
public void setMaxBytesLocalHeap(String maxBytesOnHeap)
maxBytesOnHeap
- String representation of the size.MemoryUnit.parseSizeInBytes(String)
public String getMaxBytesLocalHeapAsString()
public void setMaxBytesLocalHeap(Long maxBytesOnHeap)
maxBytesOnHeap
- amount of bytespublic Configuration maxBytesLocalHeap(long amount, MemoryUnit memoryUnit)
amount
- the amount of unitmemoryUnit
- the actual unit
setMaxBytesLocalHeap(Long)
public long getMaxBytesLocalOffHeap()
public void setMaxBytesLocalOffHeap(String maxBytesOffHeap)
maxBytesOffHeap
- String representation of the size.MemoryUnit.parseSizeInBytes(String)
public String getMaxBytesLocalOffHeapAsString()
public long getTotalConfiguredOffheap()
public void setMaxBytesLocalOffHeap(Long maxBytesOffHeap)
maxBytesOffHeap
- max bytes on disk in bytes. Needs be be greater than 0public Configuration maxBytesLocalOffHeap(long amount, MemoryUnit memoryUnit)
amount
- the amount of unitmemoryUnit
- the actual unit
public long getMaxBytesLocalDisk()
public void setMaxBytesLocalDisk(String maxBytesOnDisk)
maxBytesOnDisk
- String representation of the size.MemoryUnit.parseSizeInBytes(String)
public String getMaxBytesLocalDiskAsString()
public void setMaxBytesLocalDisk(Long maxBytesOnDisk)
maxBytesOnDisk
- max bytes on disk in bytes. Needs be be greater than 0public Configuration maxBytesLocalDisk(long amount, MemoryUnit memoryUnit)
amount
- the amount of unitmemoryUnit
- the actual unit
setMaxBytesLocalDisk(Long)
public final Configuration diskStore(DiskStoreConfiguration diskStoreConfigurationParameter) throws ObjectExistsException
diskStoreConfigurationParameter
- the disk store configuration to use
ObjectExistsException
- if the disk store has already been configuredpublic final void addDiskStore(DiskStoreConfiguration diskStoreConfigurationParameter) throws ObjectExistsException
ObjectExistsException
public final Configuration sizeOfPolicy(SizeOfPolicyConfiguration sizeOfPolicyConfiguration)
sizeOfPolicyConfiguration
- the SizeOfPolicy Configuration
public final void addSizeOfPolicy(SizeOfPolicyConfiguration sizeOfPolicy)
sizeOfPolicy
- the SizeOfPolicy Configurationpublic final Configuration transactionManagerLookup(FactoryConfiguration transactionManagerLookupParameter) throws ObjectExistsException
transactionManagerLookupParameter
- the transaction manager lookup class to use
ObjectExistsException
- if the transaction manager lookup has already been configuredpublic final void addTransactionManagerLookup(FactoryConfiguration transactionManagerLookupParameter) throws ObjectExistsException
ObjectExistsException
public final Configuration cacheManagerEventListenerFactory(FactoryConfiguration cacheManagerEventListenerFactoryConfiguration)
public final void addCacheManagerEventListenerFactory(FactoryConfiguration cacheManagerEventListenerFactoryConfiguration)
public final Configuration cacheManagerPeerProviderFactory(FactoryConfiguration factory)
public final void addCacheManagerPeerProviderFactory(FactoryConfiguration factory)
public final Configuration cacheManagerPeerListenerFactory(FactoryConfiguration factory)
public final void addCacheManagerPeerListenerFactory(FactoryConfiguration factory)
public final Configuration terracotta(TerracottaClientConfiguration terracottaConfiguration) throws ObjectExistsException
ObjectExistsException
- if the Terracotta config has already been configuredpublic final void addTerracottaConfig(TerracottaClientConfiguration terracottaConfiguration) throws ObjectExistsException
ObjectExistsException
public final Configuration managementRESTService(ManagementRESTServiceConfiguration cfg) throws ObjectExistsException
ObjectExistsException
- if the REST management config has already been configuredpublic final void addManagementRESTService(ManagementRESTServiceConfiguration managementRESTServiceConfiguration) throws ObjectExistsException
ObjectExistsException
public final Configuration defaultCache(CacheConfiguration defaultCacheConfiguration) throws ObjectExistsException
ObjectExistsException
- if the default cache config has already been configuredpublic final void addDefaultCache(CacheConfiguration defaultCacheConfiguration) throws ObjectExistsException
ObjectExistsException
public final Configuration cache(CacheConfiguration cacheConfiguration) throws ObjectExistsException
ObjectExistsException
- if a cache with the same name already exists, or if the name conflicts with the name of the default cachepublic final void addCache(CacheConfiguration cacheConfiguration) throws ObjectExistsException
ObjectExistsException
public final Set<String> getCacheConfigurationsKeySet()
public final CacheConfiguration getDefaultCacheConfiguration()
public final void setDefaultCacheConfiguration(CacheConfiguration defaultCacheConfiguration)
defaultCacheConfiguration
- public final DiskStoreConfiguration getDiskStoreConfiguration()
public final SizeOfPolicyConfiguration getSizeOfPolicyConfiguration()
public final FactoryConfiguration getTransactionManagerLookupConfiguration()
public final List<FactoryConfiguration> getCacheManagerPeerProviderFactoryConfiguration()
public final List<FactoryConfiguration> getCacheManagerPeerListenerFactoryConfigurations()
public final ManagementRESTServiceConfiguration getManagementRESTService()
public final FactoryConfiguration getCacheManagerEventListenerFactoryConfiguration()
public final TerracottaClientConfiguration getTerracottaConfiguration()
public final Map<String,CacheConfiguration> getCacheConfigurations()
public final Configuration source(ConfigurationSource configurationSource)
public final void setSource(ConfigurationSource configurationSource)
configurationSource
- an informative description of the source, preferably
including the resource name and location.public final ConfigurationSource getConfigurationSource()
public boolean addPropertyChangeListener(PropertyChangeListener listener)
PropertyChangeListener
for this configuration
listener
- the listener instance
public boolean removePropertyChangeListener(PropertyChangeListener listener)
PropertyChangeListener
for this configuration
listener
- the listener to be removed
public ClassLoader getClassLoader()
public void setClassLoader(ClassLoader loader)
loader
- the classloader to usepublic void cleanup()
|
ehcache | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |