org.infinispan.server.hotrod.configuration.HotRodServerConfigurationBuilder Java Examples
The following examples show how to use
org.infinispan.server.hotrod.configuration.HotRodServerConfigurationBuilder.
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: InfinispanServerExtension.java From infinispan-spring-boot with Apache License 2.0 | 6 votes |
public void start() { if (hotRodServer == null) { TestResourceTracker.setThreadTestName("InfinispanServer"); ConfigurationBuilder configurationBuilder = new ConfigurationBuilder(); EmbeddedCacheManager ecm = TestCacheManagerFactory.createCacheManager( new GlobalConfigurationBuilder().nonClusteredDefault().defaultCacheName("default"), configurationBuilder); for (String cacheName : initialCaches) { ecm.createCache(cacheName, new ConfigurationBuilder().build()); } HotRodServerConfigurationBuilder serverBuilder = new HotRodServerConfigurationBuilder(); serverBuilder.adminOperationsHandler(new EmbeddedServerAdminOperationHandler()); hotRodServer = HotRodTestingUtil.startHotRodServer(ecm, host, port, serverBuilder); } }
Example #2
Source File: Infinispan10Driver.java From hazelcast-simulator with Apache License 2.0 | 6 votes |
@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 #3
Source File: Infinispan9Driver.java From hazelcast-simulator with Apache License 2.0 | 6 votes |
@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); } }