[infinispan-issues] [JBoss JIRA] (ISPN-1777) Add LoadersConfigurationBuilder.clearCacheLoaders() method
Paul Ferraro (JIRA)
jira-events at lists.jboss.org
Sun Jan 22 17:56:18 EST 2012
[ https://issues.jboss.org/browse/ISPN-1777?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Paul Ferraro updated ISPN-1777:
-------------------------------
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()) {
this.addCacheLoader(builder.loaders(), loader, manager)
.async().read(loader.async())
.singletonStore().read(loader.singletonStore())
;
}
}
with:
ConfigurationBuilder builder = new ConfigurationBuilder().read(config);
builder.loaders().clearCacheLoaders();
// Our cache needs a unique passivation location
for (AbstractLoaderConfiguration loader: config.loaders().cacheLoaders()) {
this.addCacheLoader(builder.loaders(), loader, manager)
.async().read(loader.async())
.singletonStore().read(loader.singletonStore())
;
}
was:
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().enable().storeKeysAsBinary(false).storeValuesAsBinary(true)
.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()) {
this.addCacheLoader(builder.loaders(), loader, manager)
.async().read(loader.async())
.singletonStore().read(loader.singletonStore())
;
}
}
with:
ConfigurationBuilder builder = new ConfigurationBuilder().read(config);
builder.loaders().clearCacheLoaders();
// Our cache needs a unique passivation location
for (AbstractLoaderConfiguration loader: config.loaders().cacheLoaders()) {
this.addCacheLoader(builder.loaders(), loader, manager)
.async().read(loader.async())
.singletonStore().read(loader.singletonStore())
;
}
> Add LoadersConfigurationBuilder.clearCacheLoaders() method
> ----------------------------------------------------------
>
> Key: ISPN-1777
> URL: https://issues.jboss.org/browse/ISPN-1777
> Project: Infinispan
> Issue Type: Feature Request
> Components: Configuration
> Affects Versions: 5.1.0.CR4
> Reporter: Paul Ferraro
> Assignee: Manik Surtani
>
> 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()) {
> this.addCacheLoader(builder.loaders(), loader, manager)
> .async().read(loader.async())
> .singletonStore().read(loader.singletonStore())
> ;
> }
> }
> with:
> ConfigurationBuilder builder = new ConfigurationBuilder().read(config);
> builder.loaders().clearCacheLoaders();
> // Our cache needs a unique passivation location
> for (AbstractLoaderConfiguration loader: config.loaders().cacheLoaders()) {
> this.addCacheLoader(builder.loaders(), loader, manager)
> .async().read(loader.async())
> .singletonStore().read(loader.singletonStore())
> ;
> }
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the infinispan-issues
mailing list