if (this.infinispanEmbeddedCacheManager.getCacheNames().contains(cacheName)) {
throw new IllegalStateException(
"Cannot use ConfigurationTemplateMode NONE: a cache named [" + cacheName
+ "] has already been defined.");
}
final Configuration newConfiguration = new Configuration();
final Configuration customizedNewConfiguration = this.infinispanEmbeddedCacheManager
.defineConfiguration(cacheName, newConfiguration);
this.configurationOverrides.applyOverridesTo(customizedNewConfiguration);
break;
case NAMED:
this.logger
.debug("ConfigurationTemplateMode is NAMED: starting with a named Configuration ["
+ cacheName + "]");
final Configuration namedConfiguration = new Configuration();
final Configuration customizedNamedConfiguration = this.infinispanEmbeddedCacheManager
.defineConfiguration(cacheName, cacheName, namedConfiguration);
this.configurationOverrides.applyOverridesTo(customizedNamedConfiguration);
break;
case DEFAULT:
this.logger
.debug("ConfigurationTemplateMode is DEFAULT: starting with default Configuration");
if (this.infinispanEmbeddedCacheManager.getCacheNames().contains(cacheName)) {
throw new IllegalStateException(
"Cannot use ConfigurationTemplateMode DEFAULT: a cache named [" + cacheName
+ "] has already been defined.");
}
final Configuration defaultConfiguration = this.infinispanEmbeddedCacheManager
.getDefaultConfiguration().clone();
final Configuration customizedDefaultConfiguration = this.infinispanEmbeddedCacheManager
.defineConfiguration(cacheName, defaultConfiguration);
this.configurationOverrides.applyOverridesTo(customizedDefaultConfiguration);
break;
default:
throw new IllegalStateException("Unknown ConfigurationTemplateMode: "