[infinispan-dev] How to add programmatic config to an exisitng xml configured cache

Galder Zamarreño galder at redhat.com
Wed Feb 26 03:45:07 EST 2014


Hi Faseela,

Can you create a unit test demonstrating this (including the config.xml file)?

There are plenty of examples in [1].

Cheers,

[1] https://github.com/infinispan/infinispan/tree/master/core/src/test/java/org/infinispan/configuration

On 20 Feb 2014, at 10:11, Faseela K <faseela.k at ericsson.com> wrote:

> Hi,
>  
>   I have some infinispan configurations available in "config.xml".
>   After loading this configuration, I want to append some more configurations programmatically, using Configuration Builder.
>   I am doing something like this :
>  
>                         Configuration template = null;
>                 ConfigurationBuilder builder = new ConfigurationBuilder();
>  
>                 DefaultCacheManager manager = new DefaultCacheManager(
>                                 "config.xml");
>                 template = manager.getCacheConfiguration("evictionCache");
>                 builder.read(template);
>                 builder.loaders().passivation(false).shared(false).preload(true)
>                                 .addFileCacheStore().fetchPersistentState(true)
>                                 .purgerThreads(3).purgeSynchronously(true)
>                                 .ignoreModifications(false).purgeOnStartup(false)
>                                 .location("tmp").async()
>                                 .enabled(true).flushLockTimeout(15000).threadPoolSize(5)
>                                 .singletonStore().enabled(true).pushStateWhenCoordinator(true)
>                                 .pushStateTimeout(20000);
>  
>                 manager.defineConfiguration("abcd", builder.build());
>  
>   The problem with this code is, it's overwriting the evictionCache configuration.
>   Can somebody help me to fix this issue?
>  
> Thanks,
> Faseela
>  
> _______________________________________________
> infinispan-dev mailing list
> infinispan-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/infinispan-dev


--
Galder Zamarreño
galder at redhat.com
twitter.com/galderz

Project Lead, Escalante
http://escalante.io

Engineer, Infinispan
http://infinispan.org




More information about the infinispan-dev mailing list