Search in sources :

Example 1 with TransportConfigurationBuilder

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

the class JGroupsTransportBuilder method getValue.

@Override
public TransportConfiguration getValue() {
    ChannelFactory factory = this.factory.getValue();
    ProtocolStackConfiguration stack = factory.getProtocolStackConfiguration();
    org.wildfly.clustering.jgroups.spi.TransportConfiguration.Topology topology = stack.getTransport().getTopology();
    TransportConfigurationBuilder builder = new GlobalConfigurationBuilder().transport().clusterName(this.containerName).distributedSyncTimeout(this.lockTimeout).transport(new ChannelFactoryTransport(factory));
    if (topology != null) {
        builder.siteId(topology.getSite()).rackId(topology.getRack()).machineId(topology.getMachine());
    }
    return builder.create();
}
Also used : GlobalConfigurationBuilder(org.infinispan.configuration.global.GlobalConfigurationBuilder) 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) ChannelFactoryTransport(org.jboss.as.clustering.infinispan.ChannelFactoryTransport)

Example 2 with TransportConfigurationBuilder

use of org.infinispan.configuration.global.TransportConfigurationBuilder in project hibernate-orm by hibernate.

the class TestInfinispanRegionFactory method amendConfiguration.

protected void amendConfiguration(ConfigurationBuilderHolder holder) {
    holder.getGlobalConfigurationBuilder().globalJmxStatistics().allowDuplicateDomains(true);
    TransportConfigurationBuilder transport = holder.getGlobalConfigurationBuilder().transport();
    transport.nodeName(TestResourceTracker.getNextNodeName());
    transport.clusterName(TestResourceTracker.getCurrentTestName());
    // minimize number of threads using unlimited cached thread pool
    transport.remoteCommandThreadPool().threadPoolFactory(CachedThreadPoolExecutorFactory.create());
    transport.transportThreadPool().threadPoolFactory(CachedThreadPoolExecutorFactory.create());
    for (Map.Entry<String, ConfigurationBuilder> cfg : holder.getNamedConfigurationBuilders().entrySet()) {
        amendCacheConfiguration(cfg.getKey(), cfg.getValue());
    }
    // disable simple cache for testing as we need to insert interceptors
    if (!pendingPutsSimple) {
        holder.getNamedConfigurationBuilders().get(InfinispanRegionFactory.DEF_PENDING_PUTS_RESOURCE).simpleCache(false);
    }
}
Also used : TransportConfigurationBuilder(org.infinispan.configuration.global.TransportConfigurationBuilder) ConfigurationBuilder(org.infinispan.configuration.cache.ConfigurationBuilder) TransportConfigurationBuilder(org.infinispan.configuration.global.TransportConfigurationBuilder) Map(java.util.Map)

Aggregations

TransportConfigurationBuilder (org.infinispan.configuration.global.TransportConfigurationBuilder)2 Map (java.util.Map)1 ConfigurationBuilder (org.infinispan.configuration.cache.ConfigurationBuilder)1 GlobalConfigurationBuilder (org.infinispan.configuration.global.GlobalConfigurationBuilder)1 TransportConfiguration (org.infinispan.configuration.global.TransportConfiguration)1 ChannelFactoryTransport (org.jboss.as.clustering.infinispan.ChannelFactoryTransport)1 ChannelFactory (org.wildfly.clustering.jgroups.spi.ChannelFactory)1 ProtocolStackConfiguration (org.wildfly.clustering.jgroups.spi.ProtocolStackConfiguration)1