-
1. Re: Question on configuration
kevinpollet Aug 23, 2011 8:13 AM (in response to viniciuscarvalho)Hi,
The GlobalConfiguration has to be defined at the CacheManager level.
Here you have different ways to achieve this.
- Override the default cache manager initialized with the GlobalConfiguration
- Create a specific cache manager for your cache initialized with the GlobalConfiguration
For example something like that will work (in this example a specific cache manager is used):
public class Config { @Clustered @Infinispan("clustered") @Produces public Configuration clusteredConfiguration() { return new Configuration().fluent() .clustering().mode(Configuration.CacheMode.REPL_ASYNC) .build(); } @Clustered @Produces @ApplicationScoped public EmbeddedCacheManager specificCacheManager() { return new DefaultCacheManager(GlobalConfiguration.getClusteredDefault().fluent() .transport().clusterName("shared-cache-cluster").addProperty("configurationFile", "jgroups-tcp.xml") .build()); } }
For further details look at the documentation: https://docs.jboss.org/author/display/ISPN/CDI+Support
Hope this help.
--Kevin
-
2. Re: Question on configuration
javart1 Aug 25, 2011 10:34 AM (in response to viniciuscarvalho)Add the following to your imports:
import org.infinispan.remoting.transport.jgroups.JGroupsTransport;
Then add the following to your configuration:
globalcfg.fluent().transport().clusterName("cluster1")
.addProperty("configurationFile", "jgroups-udp.xml")
.transportClass(JGroupsTransport.class)
Be sure to use a cluster name that is appropriate for your enviroment. Also select the jgroups configuration file that works on your network.