org.infinispan.server.hotrod.HotRodServer Java Examples

The following examples show how to use org.infinispan.server.hotrod.HotRodServer. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: Infinispan10Driver.java    From hazelcast-simulator with Apache License 2.0 6 votes vote down vote up
@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"));
        ConfigurationBuilder configurationBuilder = new ConfigurationBuilder().withProperties(hotrodProperties);
        Configuration configuration = configurationBuilder.build();
        RemoteCacheManager remoteCacheManager = new RemoteCacheManager(configuration);
        this.cacheContainer = remoteCacheManager;
    } else {
        DefaultCacheManager defaultCacheManager = new DefaultCacheManager("infinispan.xml");
        this.cacheContainer = defaultCacheManager;
        HotRodServerConfiguration hotRodServerConfiguration = new HotRodServerConfigurationBuilder()
                .host(get("PRIVATE_ADDRESS")).port(11222).build();
        this.hotRodServer = new HotRodServer();
        hotRodServer.start(hotRodServerConfiguration, defaultCacheManager);
    }
}
 
Example #2
Source File: Infinispan9Driver.java    From hazelcast-simulator with Apache License 2.0 6 votes vote down vote up
@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"));
        ConfigurationBuilder configurationBuilder = new ConfigurationBuilder().withProperties(hotrodProperties);
        Configuration configuration = configurationBuilder.build();
        RemoteCacheManager remoteCacheManager = new RemoteCacheManager(configuration);
        this.cacheContainer = remoteCacheManager;
    } else {
        DefaultCacheManager defaultCacheManager = new DefaultCacheManager("infinispan.xml");
        this.cacheContainer = defaultCacheManager;
        HotRodServerConfiguration hotRodServerConfiguration = new HotRodServerConfigurationBuilder()
                .host(get("PRIVATE_ADDRESS")).port(11222).build();
        this.hotRodServer = new HotRodServer();
        hotRodServer.start(hotRodServerConfiguration, defaultCacheManager);
    }
}