Search in sources :

Example 1 with HotRodServerConfigurationBuilder

use of org.infinispan.server.hotrod.configuration.HotRodServerConfigurationBuilder in project hazelcast-simulator by hazelcast.

the class InfinispanDriver method startVendorInstance.

@Override
public void startVendorInstance() throws Exception {
    String workerType = get("WORKER_TYPE");
    if ("javaclient".equals(workerType)) {
        Properties hotrodProperties = new Properties();
        hotrodProperties.setProperty("infinispan.client.hotrod.server_list", get("server_list"));
        Configuration configuration = new ConfigurationBuilder().withProperties(hotrodProperties).build();
        RemoteCacheManager remoteCacheManager = new RemoteCacheManager(configuration);
        this.cacheContainer = remoteCacheManager;
        remoteCacheManager.start();
    } else {
        DefaultCacheManager defaultCacheManager = new DefaultCacheManager("infinispan.xml");
        this.cacheContainer = defaultCacheManager;
        defaultCacheManager.start();
        HotRodServerConfiguration hotRodServerConfiguration = new HotRodServerConfigurationBuilder().host(get("PRIVATE_ADDRESS")).port(11222).build();
        this.hotRodServer = new HotRodServer();
        hotRodServer.start(hotRodServerConfiguration, defaultCacheManager);
    }
}
Also used : ConfigurationBuilder(org.infinispan.client.hotrod.configuration.ConfigurationBuilder) HotRodServerConfigurationBuilder(org.infinispan.server.hotrod.configuration.HotRodServerConfigurationBuilder) RemoteCacheManager(org.infinispan.client.hotrod.RemoteCacheManager) DefaultCacheManager(org.infinispan.manager.DefaultCacheManager) Configuration(org.infinispan.client.hotrod.configuration.Configuration) HotRodServerConfiguration(org.infinispan.server.hotrod.configuration.HotRodServerConfiguration) HotRodServer(org.infinispan.server.hotrod.HotRodServer) HotRodServerConfiguration(org.infinispan.server.hotrod.configuration.HotRodServerConfiguration) HotRodServerConfigurationBuilder(org.infinispan.server.hotrod.configuration.HotRodServerConfigurationBuilder) Properties(java.util.Properties)

Aggregations

Properties (java.util.Properties)1 RemoteCacheManager (org.infinispan.client.hotrod.RemoteCacheManager)1 Configuration (org.infinispan.client.hotrod.configuration.Configuration)1 ConfigurationBuilder (org.infinispan.client.hotrod.configuration.ConfigurationBuilder)1 DefaultCacheManager (org.infinispan.manager.DefaultCacheManager)1 HotRodServer (org.infinispan.server.hotrod.HotRodServer)1 HotRodServerConfiguration (org.infinispan.server.hotrod.configuration.HotRodServerConfiguration)1 HotRodServerConfigurationBuilder (org.infinispan.server.hotrod.configuration.HotRodServerConfigurationBuilder)1