-
1. Re: How to configure transport using ConfigurationBuilder?
galder.zamarreno Jan 13, 2012 7:40 AM (in response to jmfaerman)By overriding how the cache manager is created, i.e.
/** * Overrides the default embedded cache manager. */ @Produces @ApplicationScoped public EmbeddedCacheManager defaultCacheManager() { return new DefaultCacheManager( new GlobalConfigurationBuilder().transport().defaultTransport().build(), new ConfigurationBuilder().eviction().maxEntries(7).build()); }
-
2. Re: How to configure transport using ConfigurationBuilder?
jmfaerman Jan 16, 2012 10:34 AM (in response to galder.zamarreno)Thanks!
-
3. Re: How to configure transport using ConfigurationBuilder?
jmfaerman Jan 18, 2012 8:08 AM (in response to jmfaerman)What if i need to produce only the Configuration, as in the CDI quickstart?
@GreetingCache
@ConfigureCache("greeting-cache")
@Produces
public Configuration greetingCache() {
return new ConfigurationBuilder()
.eviction().strategy(EvictionStrategy.FIFO).maxEntries(4)
.build();
}
What i would like is to set the cache mode of this Configuration do Replicated / Distributed. For that i need to set transport...
Is there anywhere i could read about this Configuration objects ( GlobalConfiguration, Configuratiom, etc) ?
-
4. Re: How to configure transport using ConfigurationBuilder?
galder.zamarreno Jan 19, 2012 5:09 AM (in response to jmfaerman)See https://docs.jboss.org/author/display/ISPN51/CDI+Support
Well, it's just a matter of combining that piece of code and the one before in a single class. So that, a cache manager is built with the right transport and your cache, with your cache annotation and name, has the right cache mode.
If still not happy with the examples available, the Infinispan source code, in the cdi/extension module contains plenty of tests with examples.