use of org.infinispan.server.core.admin.embeddedserver.EmbeddedServerAdminOperationHandler in project infinispan by infinispan.
the class RemoteCacheAdminTest method addHotRodServer.
@Override
protected HotRodServer addHotRodServer(ConfigurationBuilder builder) {
GlobalConfigurationBuilder gcb = GlobalConfigurationBuilder.defaultClusteredBuilder();
gcb.defaultCacheName("default");
gcb.addModule(PrivateGlobalConfigurationBuilder.class).serverMode(true);
gcb.serialization().addContextInitializer(contextInitializer());
EmbeddedCacheManager cm = addClusterEnabledCacheManager(gcb, builder);
cm.defineConfiguration("template", builder.build());
cm.defineConfiguration(DefaultTemplate.DIST_ASYNC.getTemplateName(), builder.build());
HotRodServerConfigurationBuilder serverBuilder = new HotRodServerConfigurationBuilder();
serverBuilder.adminOperationsHandler(new EmbeddedServerAdminOperationHandler());
HotRodServer server = HotRodClientTestingUtil.startHotRodServer(cm, serverBuilder);
servers.add(server);
return server;
}
use of org.infinispan.server.core.admin.embeddedserver.EmbeddedServerAdminOperationHandler in project infinispan by infinispan.
the class JCacheTwoCachesExpirationTest method createCacheManagers.
@Override
protected void createCacheManagers() throws Throwable {
createClusteredCaches(2, "expiry", getExpiryCacheConfig());
cacheManagers.forEach(cm -> replaceComponent(cm, TimeService.class, controlledTimeService, true));
hotRodServer1 = HotRodClientTestingUtil.startHotRodServer(cacheManagers.get(0), new HotRodServerConfigurationBuilder().adminOperationsHandler(new EmbeddedServerAdminOperationHandler()));
hotRodServer2 = HotRodClientTestingUtil.startHotRodServer(cacheManagers.get(1), new HotRodServerConfigurationBuilder().adminOperationsHandler(new EmbeddedServerAdminOperationHandler()));
testSpecificClassLoader = new JCacheTestingUtil.TestClassLoader(JCacheTwoCachesExpirationTest.class.getClassLoader());
CachingProvider cachingProvider = Caching.getCachingProvider(testSpecificClassLoader);
Properties properties = new Properties();
properties.put("infinispan.client.hotrod.server_list", hotRodServer1.getHost() + ":" + hotRodServer1.getPort());
rcm1 = createCacheManager(cachingProvider, properties, "manager1", testSpecificClassLoader);
cache1 = createCache(rcm1, "expiry");
// Using the same URI + ClassLoader will give us the existing instance
assertSame(rcm1, createCacheManager(cachingProvider, properties, "manager1", testSpecificClassLoader));
properties = new Properties();
properties.put("infinispan.client.hotrod.server_list", hotRodServer2.getHost() + ":" + hotRodServer2.getPort());
rcm2 = createCacheManager(cachingProvider, properties, "manager2", testSpecificClassLoader);
cache2 = createCache(rcm2, "expiry");
assertNotSame(cache1, cache2);
}
use of org.infinispan.server.core.admin.embeddedserver.EmbeddedServerAdminOperationHandler in project infinispan by infinispan.
the class IndexedCacheNonIndexedEntityTest method createCacheManager.
@Override
protected EmbeddedCacheManager createCacheManager() throws Exception {
cacheManager = TestCacheManagerFactory.createCacheManager(new ConfigurationBuilder());
HotRodServerConfigurationBuilder serverBuilder = new HotRodServerConfigurationBuilder();
serverBuilder.adminOperationsHandler(new EmbeddedServerAdminOperationHandler());
hotRodServer = HotRodClientTestingUtil.startHotRodServer(cacheManager, serverBuilder);
org.infinispan.client.hotrod.configuration.ConfigurationBuilder clientBuilder = newRemoteConfigurationBuilder();
clientBuilder.addServer().host("127.0.0.1").port(hotRodServer.getPort());
remoteCacheManager = new RemoteCacheManager(clientBuilder.build());
RemoteCache<String, String> metadataCache = remoteCacheManager.getCache(PROTOBUF_METADATA_CACHE_NAME);
metadataCache.put("file.proto", createProtoFile());
assertFalse(metadataCache.containsKey(ProtobufMetadataManagerConstants.ERRORS_KEY_SUFFIX));
return cacheManager;
}
use of org.infinispan.server.core.admin.embeddedserver.EmbeddedServerAdminOperationHandler in project infinispan by infinispan.
the class SpringRemoteCacheManagerTest method setupRemoteCacheFactory.
@BeforeClass
public void setupRemoteCacheFactory() {
HotRodServerConfigurationBuilder serverBuilder = new HotRodServerConfigurationBuilder();
serverBuilder.adminOperationsHandler(new EmbeddedServerAdminOperationHandler());
hotrodServer = HotRodTestingUtil.startHotRodServer(cacheManager, ServerTestingUtil.findFreePort(), serverBuilder);
ConfigurationBuilder builder = new ConfigurationBuilder();
builder.addServer().host("localhost").port(hotrodServer.getPort());
remoteCacheManager = new RemoteCacheManager(builder.build());
}
use of org.infinispan.server.core.admin.embeddedserver.EmbeddedServerAdminOperationHandler in project infinispan by infinispan.
the class SpringRemoteCacheManagerWithReadWriteTimeoutTest method setupRemoteCacheFactory.
@BeforeClass
public void setupRemoteCacheFactory() {
HotRodServerConfigurationBuilder serverBuilder = new HotRodServerConfigurationBuilder();
serverBuilder.adminOperationsHandler(new EmbeddedServerAdminOperationHandler());
hotrodServer = HotRodTestingUtil.startHotRodServer(cacheManager, ServerTestingUtil.findFreePort(), serverBuilder);
ConfigurationBuilder builder = new ConfigurationBuilder();
builder.addServer().host("localhost").port(hotrodServer.getPort());
remoteCacheManager = new RemoteCacheManager(builder.build());
}
Aggregations