Details
-
Enhancement
-
Resolution: Done
-
Major
-
5.1.0.FINAL
-
None
Description
The use case for this is defining a cache for web session replication for a single application. The cache needs a unique file cache store location. The only way to modify the location is by copy each sub-builder except the loaders builder, and copying the loader properties manually. The ability to clear cache loaders of a builder would simplify this greatly.
e.g.
I could replace:
ConfigurationBuilder builder = new ConfigurationBuilder().name(config.name());
// Copy everything except loaders
builder.clustering().read(config.clustering())
.customInterceptors().read(config.customInterceptors())
.dataContainer().read(config.dataContainer())
.deadlockDetection().read(config.deadlockDetection())
.eviction().read(config.eviction())
.expiration().read(config.expiration())
.indexing().read(config.indexing())
.invocationBatching().read(config.invocationBatching())
.jmxStatistics().read(config.jmxStatistics())
.locking().read(config.locking())
.storeAsBinary().read(config.storeAsBinary())
.transaction().read(config.transaction())
.versioning().read(config.versioning())
;
if (!config.loaders().cacheLoaders().isEmpty()) {
builder.loaders().clearCacheLoaders();
// Our cache needs a unique passivation location
for (AbstractLoaderConfiguration loader: config.loaders().cacheLoaders())
}
with:
ConfigurationBuilder builder = new ConfigurationBuilder().read(config);
builder.loaders().clearCacheLoaders();
// Our cache needs a unique passivation location
for (AbstractLoaderConfiguration loader: config.loaders().cacheLoaders())