public final class DefaultConfiguration extends java.lang.Object implements Configuration, org.ehcache.core.HumanReadable
Configuration.| Constructor and Description |
|---|
DefaultConfiguration(java.lang.ClassLoader classLoader,
ServiceCreationConfiguration<?,?>... services)
Creates a new configuration with the specified class loader.
|
DefaultConfiguration(Configuration cfg)
Copy constructor
|
DefaultConfiguration(java.util.Map<java.lang.String,CacheConfiguration<?,?>> caches,
java.lang.ClassLoader classLoader,
ServiceCreationConfiguration<?,?>... services)
Creates a new configuration with the specified
cache configurations, class loader and
service configurations. |
| Modifier and Type | Method and Description |
|---|---|
void |
addCacheConfiguration(java.lang.String alias,
CacheConfiguration<?,?> config)
Adds a
CacheConfiguration tied to the provided alias. |
FluentConfigurationBuilder<?> |
derive()
Creates a builder seeded with this configuration.
|
java.util.Map<java.lang.String,CacheConfiguration<?,?>> |
getCacheConfigurations()
Mapping of aliases to
CacheConfigurations, used to configure the Caches
managed by the CacheManager. |
java.lang.ClassLoader |
getClassLoader()
The
ClassLoader for the CacheManager. |
java.util.Collection<ServiceCreationConfiguration<?,?>> |
getServiceCreationConfigurations()
|
java.lang.String |
readableString() |
void |
removeCacheConfiguration(java.lang.String alias)
Removes the
CacheConfiguration tied to the provided alias. |
<K,V> void |
replaceCacheConfiguration(java.lang.String alias,
CacheConfiguration<K,V> config,
CacheRuntimeConfiguration<K,V> runtimeConfiguration)
Replaces a
CacheConfiguration with a CacheRuntimeConfiguration for the provided alias. |
public DefaultConfiguration(Configuration cfg)
cfg - the configuration to copypublic DefaultConfiguration(java.lang.ClassLoader classLoader,
ServiceCreationConfiguration<?,?>... services)
This means no cache configurations nor service configurations.
classLoader - the class loader to useservices - an array of service configurationsaddCacheConfiguration(String, CacheConfiguration)public DefaultConfiguration(java.util.Map<java.lang.String,CacheConfiguration<?,?>> caches, java.lang.ClassLoader classLoader, ServiceCreationConfiguration<?,?>... services)
cache configurations, class loader and
service configurations.caches - a map from alias to cache configurationclassLoader - the class loader to use for user typesservices - an array of service configurationspublic java.util.Map<java.lang.String,CacheConfiguration<?,?>> getCacheConfigurations()
CacheConfigurations, used to configure the Caches
managed by the CacheManager.
The map must not be null but can be empty. It must be unmodifiable.
getCacheConfigurations in interface Configurationpublic java.util.Collection<ServiceCreationConfiguration<?,?>> getServiceCreationConfigurations()
ServiceCreationConfiguration initially used to bootstrap the CacheManager
and its Caches.
The collection must not be null but can be empty. Also it must be unmodifiable.
getServiceCreationConfigurations in interface Configurationpublic java.lang.ClassLoader getClassLoader()
ClassLoader for the CacheManager.
This ClassLoader will be used to instantiate cache manager level services
and for Caches that do not have a specific ClassLoader.
The ClassLoader must not be null.
getClassLoader in interface ConfigurationClassLoaderpublic FluentConfigurationBuilder<?> derive()
Configuration
The default implementation throws UnsupportedOperationException to indicate that configuration derivation
is not supported.
derive in interface ConfigurationFluentConfigurationBuilderpublic void addCacheConfiguration(java.lang.String alias,
CacheConfiguration<?,?> config)
CacheConfiguration tied to the provided alias.alias - the alias of the cacheconfig - the configuration of the cachepublic void removeCacheConfiguration(java.lang.String alias)
CacheConfiguration tied to the provided alias.alias - the alias for which to remove configurationpublic <K,V> void replaceCacheConfiguration(java.lang.String alias,
CacheConfiguration<K,V> config,
CacheRuntimeConfiguration<K,V> runtimeConfiguration)
CacheConfiguration with a CacheRuntimeConfiguration for the provided alias.K - the key typeV - the value typealias - the alias of the cacheconfig - the existing configurationruntimeConfiguration - the new configurationjava.lang.IllegalStateException - if the replace failspublic java.lang.String readableString()
readableString in interface org.ehcache.core.HumanReadable