Package org.ehcache.config.builders
Class ConfigurationBuilder
java.lang.Object
org.ehcache.core.config.CoreConfigurationBuilder<ConfigurationBuilder>
org.ehcache.config.builders.ConfigurationBuilder
- All Implemented Interfaces:
org.ehcache.config.Builder<org.ehcache.config.Configuration>,org.ehcache.config.FluentConfigurationBuilder<ConfigurationBuilder>
public final class ConfigurationBuilder
extends org.ehcache.core.config.CoreConfigurationBuilder<ConfigurationBuilder>
The
ConfigurationBuilder enables building Configurations using a fluent style.-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedprotectedConfigurationBuilder(ConfigurationBuilder builder, ClassLoader classLoader) protectedConfigurationBuilder(ConfigurationBuilder builder, Collection<org.ehcache.spi.service.ServiceCreationConfiguration<?, ?>> serviceConfigurations) protectedConfigurationBuilder(ConfigurationBuilder builder, Map<String, org.ehcache.config.CacheConfiguration<?, ?>> caches) protectedConfigurationBuilder(ConfigurationBuilder builder, org.ehcache.config.ResourcePools sharedResourcePools) -
Method Summary
Modifier and TypeMethodDescriptionDeprecated.addService(org.ehcache.spi.service.ServiceCreationConfiguration<?, ?> serviceConfiguration) Deprecated.in favor ofCoreConfigurationBuilder.withService(ServiceCreationConfiguration)booleancontainsCache(String alias) Deprecated.in favor ofCoreConfigurationBuilder.getCache(String)protected ConfigurationBuildernewBuilderWith(ClassLoader classLoader) protected ConfigurationBuildernewBuilderWith(Collection<org.ehcache.spi.service.ServiceCreationConfiguration<?, ?>> serviceConfigurations) protected ConfigurationBuildernewBuilderWith(Map<String, org.ehcache.config.CacheConfiguration<?, ?>> caches) protected ConfigurationBuildernewBuilderWith(org.ehcache.config.ResourcePools sharedResourcePools) static ConfigurationBuilderCreate a new 'empty' configuration builder.static ConfigurationBuildernewConfigurationBuilder(org.ehcache.config.Configuration seed) Create a configuration builder seeded from the given configuration.removeCache(String alias) Deprecated.in favor ofCoreConfigurationBuilder.withoutCache(String)removeService(org.ehcache.spi.service.ServiceCreationConfiguration<?, ?> serviceConfiguration) Deprecated.in favor ofFluentConfigurationBuilder.withoutServices(Class)orCoreConfigurationBuilder.withoutServices(Class, Predicate)Methods inherited from class org.ehcache.core.config.CoreConfigurationBuilder
build, getCache, getClassLoader, getServices, updateCache, updateCaches, updateServices, updateSharedResources, withCache, withClassLoader, withDefaultClassLoader, withoutCache, withoutServices, withService, withSharedResourcesMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.ehcache.config.FluentConfigurationBuilder
getService, withCache, withoutServices, withService, withSharedResources
-
Constructor Details
-
ConfigurationBuilder
protected ConfigurationBuilder() -
ConfigurationBuilder
protected ConfigurationBuilder(ConfigurationBuilder builder, Map<String, org.ehcache.config.CacheConfiguration<?, ?>> caches) -
ConfigurationBuilder
protected ConfigurationBuilder(ConfigurationBuilder builder, Collection<org.ehcache.spi.service.ServiceCreationConfiguration<?, ?>> serviceConfigurations) -
ConfigurationBuilder
-
ConfigurationBuilder
protected ConfigurationBuilder(ConfigurationBuilder builder, org.ehcache.config.ResourcePools sharedResourcePools)
-
-
Method Details
-
newConfigurationBuilder
Create a new 'empty' configuration builder.- Returns:
- a new empty configuration builder
-
newConfigurationBuilder
Create a configuration builder seeded from the given configuration.Calling
CoreConfigurationBuilder.build()on the returned builder will produce a functionally equivalent configuration toseed.- Parameters:
seed- configuration to duplicate- Returns:
- a new configuration builder
-
addCache
@Deprecated public ConfigurationBuilder addCache(String alias, org.ehcache.config.CacheConfiguration<?, ?> config) throws IllegalArgumentExceptionDeprecated.in favor ofCoreConfigurationBuilder.withCache(String, CacheConfiguration)Add a cache configuration with the given alias.If a cache with the given alias already exists then an
IllegalArgumentExceptionwill be thrown.- Parameters:
alias- cache alias to be addedconfig- cache configuration- Returns:
- an updated builder
- Throws:
IllegalArgumentException
-
removeCache
Deprecated.in favor ofCoreConfigurationBuilder.withoutCache(String)Removes the cache with the given alias.- Parameters:
alias- cache alias to be removed- Returns:
- an updated builder
-
addService
@Deprecated public ConfigurationBuilder addService(org.ehcache.spi.service.ServiceCreationConfiguration<?, ?> serviceConfiguration) Deprecated.in favor ofCoreConfigurationBuilder.withService(ServiceCreationConfiguration)Adds the given service to this configuration.If a a service creation configuration of the same concrete type is already present then an
IllegalArgumentExceptionwill be thrown.- Parameters:
serviceConfiguration- service creation configuration- Returns:
- an updated builder
-
removeService
@Deprecated public ConfigurationBuilder removeService(org.ehcache.spi.service.ServiceCreationConfiguration<?, ?> serviceConfiguration) Deprecated.in favor ofFluentConfigurationBuilder.withoutServices(Class)orCoreConfigurationBuilder.withoutServices(Class, Predicate)Removes the given service configuration.- Parameters:
serviceConfiguration- service creation configuration- Returns:
- an updated builder
-
containsCache
Deprecated.in favor ofCoreConfigurationBuilder.getCache(String)Returnstrueif a cache configuration is associated with the given alias.- Parameters:
alias- cache configuration alias- Returns:
trueif the given alias is present
-
newBuilderWith
protected ConfigurationBuilder newBuilderWith(Map<String, org.ehcache.config.CacheConfiguration<?, ?>> caches) - Overrides:
newBuilderWithin classorg.ehcache.core.config.CoreConfigurationBuilder<ConfigurationBuilder>
-
newBuilderWith
protected ConfigurationBuilder newBuilderWith(Collection<org.ehcache.spi.service.ServiceCreationConfiguration<?, ?>> serviceConfigurations) - Overrides:
newBuilderWithin classorg.ehcache.core.config.CoreConfigurationBuilder<ConfigurationBuilder>
-
newBuilderWith
- Overrides:
newBuilderWithin classorg.ehcache.core.config.CoreConfigurationBuilder<ConfigurationBuilder>
-
newBuilderWith
- Overrides:
newBuilderWithin classorg.ehcache.core.config.CoreConfigurationBuilder<ConfigurationBuilder>
-
CoreConfigurationBuilder.withCache(String, CacheConfiguration)