Search in sources :

Example 11 with GlobalConfigurationBuilder

use of org.infinispan.configuration.global.GlobalConfigurationBuilder in project wildfly by wildfly.

the class JGroupsTransportServiceConfigurator method get.

@Override
public TransportConfiguration get() {
    ChannelFactory factory = this.factory.get();
    Properties properties = new Properties();
    properties.put(JGroupsTransport.CHANNEL_CONFIGURATOR, new ChannelConfigurator(factory, this.containerName));
    ProtocolStackConfiguration stack = factory.getProtocolStackConfiguration();
    org.wildfly.clustering.jgroups.spi.TransportConfiguration.Topology topology = stack.getTransport().getTopology();
    TransportConfigurationBuilder builder = new GlobalConfigurationBuilder().transport().clusterName(this.cluster.get()).distributedSyncTimeout(this.lockTimeout).transport(new JGroupsTransport()).withProperties(properties);
    if (topology != null) {
        builder.siteId(topology.getSite()).rackId(topology.getRack()).machineId(topology.getMachine());
    }
    return builder.create();
}
Also used : ChannelConfigurator(org.jboss.as.clustering.infinispan.ChannelConfigurator) GlobalConfigurationBuilder(org.infinispan.configuration.global.GlobalConfigurationBuilder) JGroupsTransport(org.infinispan.remoting.transport.jgroups.JGroupsTransport) TransportConfigurationBuilder(org.infinispan.configuration.global.TransportConfigurationBuilder) ProtocolStackConfiguration(org.wildfly.clustering.jgroups.spi.ProtocolStackConfiguration) TransportConfiguration(org.infinispan.configuration.global.TransportConfiguration) ChannelFactory(org.wildfly.clustering.jgroups.spi.ChannelFactory) Properties(java.util.Properties)

Aggregations

GlobalConfigurationBuilder (org.infinispan.configuration.global.GlobalConfigurationBuilder)11 DefaultCacheManager (org.infinispan.manager.DefaultCacheManager)6 ConfigurationBuilder (org.infinispan.configuration.cache.ConfigurationBuilder)4 GlobalConfiguration (org.infinispan.configuration.global.GlobalConfiguration)4 TransportConfiguration (org.infinispan.configuration.global.TransportConfiguration)3 Configuration (org.infinispan.configuration.cache.Configuration)2 TransportConfigurationBuilder (org.infinispan.configuration.global.TransportConfigurationBuilder)2 ConfigurationBuilderHolder (org.infinispan.configuration.parsing.ConfigurationBuilderHolder)2 EmbeddedCacheManager (org.infinispan.manager.EmbeddedCacheManager)2 ChannelFactory (org.wildfly.clustering.jgroups.spi.ChannelFactory)2 ProtocolStackConfiguration (org.wildfly.clustering.jgroups.spi.ProtocolStackConfiguration)2 IOException (java.io.IOException)1 Serializable (java.io.Serializable)1 PrivilegedActionException (java.security.PrivilegedActionException)1 PrivilegedExceptionAction (java.security.PrivilegedExceptionAction)1 HashMap (java.util.HashMap)1 List (java.util.List)1 Map (java.util.Map)1 Objects.requireNonNull (java.util.Objects.requireNonNull)1 Properties (java.util.Properties)1