Clone a new cache from an existing configuration

WARNING - TOPIC NOT WRITTEN - TOPIC ID: 1505

This topic has not yet been written. The content below is from the topic description.
We can also use default cache configuration (or any other cache configuration) as a starting point for creation of a new cache. For example, lets say that my-config-file.xml specifies a replicated cache as a default and that we want to create a distributed cache with a specific L1 lifespan while at the same time retaining all other aspects of a default cache in my-config-file.xml. Therefore, we start with a clone instance of default Configuration object and then we set cache mode and L1 lifespan accordingly. As a final step we define/register this configuration with a manager.   EmbeddedCacheManager manager = new DefaultCacheManager("my-config-file.xml"); Configuration c = manager.getDefaultConfiguration().clone(); c.setCacheMode(CacheMode.DIST_SYNC); c.setL1Lifespan(60000L);       String newCacheName = "distributedWithL1"; manager.defineConfiguration(newCacheName, c); Cache cache = manager.getCache(newCacheName);