Terracotta 10.15 | Ehcache API Developer Guide | Configuration Derivation | Principles
 
Principles
The configuration derivation feature allows you to create a new Ehcache configuration object via a transformation on an existing configuration object. This can be useful for:
*Pre-processing an externally sourced configuration, adding additional settings before creating the cache manager.
*Processing the configuration of an existing cache manager to generate a new configuration.
The basis of the configuration derivation API is the Configuration.derive() method that generates a builder seeded with the configurations values.
FluentConfigurationBuilder<?> derivedBuilder = configuration.derive(); //1
Configuration configurationCopy = derivedBuilder.build(); //2
1
Creates a builder seeded with the configuration’s state.
2
Configurations built using the builder are then functionally identical to the original configuration.