Search in sources :

Example 6 with EmbeddedServerAdminOperationHandler

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;
}
Also used : PrivateGlobalConfigurationBuilder(org.infinispan.configuration.internal.PrivateGlobalConfigurationBuilder) GlobalConfigurationBuilder(org.infinispan.configuration.global.GlobalConfigurationBuilder) PrivateGlobalConfigurationBuilder(org.infinispan.configuration.internal.PrivateGlobalConfigurationBuilder) EmbeddedServerAdminOperationHandler(org.infinispan.server.core.admin.embeddedserver.EmbeddedServerAdminOperationHandler) HotRodServer(org.infinispan.server.hotrod.HotRodServer) HotRodServerConfigurationBuilder(org.infinispan.server.hotrod.configuration.HotRodServerConfigurationBuilder) EmbeddedCacheManager(org.infinispan.manager.EmbeddedCacheManager)

Example 7 with EmbeddedServerAdminOperationHandler

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);
}
Also used : EmbeddedServerAdminOperationHandler(org.infinispan.server.core.admin.embeddedserver.EmbeddedServerAdminOperationHandler) TimeService(org.infinispan.commons.time.TimeService) JCacheTestingUtil(org.infinispan.jcache.util.JCacheTestingUtil) HotRodServerConfigurationBuilder(org.infinispan.server.hotrod.configuration.HotRodServerConfigurationBuilder) Properties(java.util.Properties) CachingProvider(javax.cache.spi.CachingProvider)

Example 8 with EmbeddedServerAdminOperationHandler

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;
}
Also used : ConfigurationBuilder(org.infinispan.configuration.cache.ConfigurationBuilder) HotRodServerConfigurationBuilder(org.infinispan.server.hotrod.configuration.HotRodServerConfigurationBuilder) HotRodClientTestingUtil.newRemoteConfigurationBuilder(org.infinispan.client.hotrod.test.HotRodClientTestingUtil.newRemoteConfigurationBuilder) RemoteCacheManager(org.infinispan.client.hotrod.RemoteCacheManager) HotRodClientTestingUtil.killRemoteCacheManager(org.infinispan.client.hotrod.test.HotRodClientTestingUtil.killRemoteCacheManager) EmbeddedServerAdminOperationHandler(org.infinispan.server.core.admin.embeddedserver.EmbeddedServerAdminOperationHandler) HotRodServerConfigurationBuilder(org.infinispan.server.hotrod.configuration.HotRodServerConfigurationBuilder)

Example 9 with EmbeddedServerAdminOperationHandler

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());
}
Also used : HotRodServerConfigurationBuilder(org.infinispan.server.hotrod.configuration.HotRodServerConfigurationBuilder) ConfigurationBuilder(org.infinispan.client.hotrod.configuration.ConfigurationBuilder) RemoteCacheManager(org.infinispan.client.hotrod.RemoteCacheManager) EmbeddedServerAdminOperationHandler(org.infinispan.server.core.admin.embeddedserver.EmbeddedServerAdminOperationHandler) HotRodServerConfigurationBuilder(org.infinispan.server.hotrod.configuration.HotRodServerConfigurationBuilder) BeforeClass(org.testng.annotations.BeforeClass)

Example 10 with EmbeddedServerAdminOperationHandler

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());
}
Also used : HotRodServerConfigurationBuilder(org.infinispan.server.hotrod.configuration.HotRodServerConfigurationBuilder) ConfigurationBuilder(org.infinispan.client.hotrod.configuration.ConfigurationBuilder) RemoteCacheManager(org.infinispan.client.hotrod.RemoteCacheManager) EmbeddedServerAdminOperationHandler(org.infinispan.server.core.admin.embeddedserver.EmbeddedServerAdminOperationHandler) HotRodServerConfigurationBuilder(org.infinispan.server.hotrod.configuration.HotRodServerConfigurationBuilder) BeforeClass(org.testng.annotations.BeforeClass)

Aggregations

EmbeddedServerAdminOperationHandler (org.infinispan.server.core.admin.embeddedserver.EmbeddedServerAdminOperationHandler)13 HotRodServerConfigurationBuilder (org.infinispan.server.hotrod.configuration.HotRodServerConfigurationBuilder)13 GlobalConfigurationBuilder (org.infinispan.configuration.global.GlobalConfigurationBuilder)5 EmbeddedCacheManager (org.infinispan.manager.EmbeddedCacheManager)5 PrivateGlobalConfigurationBuilder (org.infinispan.configuration.internal.PrivateGlobalConfigurationBuilder)4 HotRodServer (org.infinispan.server.hotrod.HotRodServer)4 RemoteCacheManager (org.infinispan.client.hotrod.RemoteCacheManager)3 ConfigurationBuilder (org.infinispan.configuration.cache.ConfigurationBuilder)3 BeforeClass (org.testng.annotations.BeforeClass)3 ConfigurationBuilder (org.infinispan.client.hotrod.configuration.ConfigurationBuilder)2 PrivilegedActionException (java.security.PrivilegedActionException)1 Properties (java.util.Properties)1 CachingProvider (javax.cache.spi.CachingProvider)1 HotRodClientTestingUtil.killRemoteCacheManager (org.infinispan.client.hotrod.test.HotRodClientTestingUtil.killRemoteCacheManager)1 HotRodClientTestingUtil.newRemoteConfigurationBuilder (org.infinispan.client.hotrod.test.HotRodClientTestingUtil.newRemoteConfigurationBuilder)1 RestClientConfiguration (org.infinispan.client.rest.configuration.RestClientConfiguration)1 RestClientConfigurationBuilder (org.infinispan.client.rest.configuration.RestClientConfigurationBuilder)1 UTF8StringMarshaller (org.infinispan.commons.marshall.UTF8StringMarshaller)1 TimeService (org.infinispan.commons.time.TimeService)1 JCacheTestingUtil (org.infinispan.jcache.util.JCacheTestingUtil)1