Search in sources :

Example 1 with BasicConfiguration

use of org.infinispan.commons.configuration.BasicConfiguration in project infinispan by infinispan.

the class RemoteCacheAdminTest method templateCreateRemoveTest.

public void templateCreateRemoveTest(Method m) {
    String templateName = m.getName();
    String xml = String.format("<infinispan><cache-container><distributed-cache name=\"%s\"/></cache-container></infinispan>", templateName);
    BasicConfiguration template = new StringConfiguration(xml);
    client(0).administration().withFlags(CacheContainerAdmin.AdminFlag.VOLATILE).createTemplate(templateName, template);
    assertTrue(manager(0).getCacheConfigurationNames().contains(templateName));
    assertTrue(manager(0).getCacheConfigurationNames().contains(templateName));
    client(1).administration().removeTemplate(templateName);
    assertFalse(manager(0).getCacheConfigurationNames().contains(templateName));
    assertFalse(manager(0).getCacheConfigurationNames().contains(templateName));
}
Also used : StringConfiguration(org.infinispan.commons.configuration.StringConfiguration) BasicConfiguration(org.infinispan.commons.configuration.BasicConfiguration)

Example 2 with BasicConfiguration

use of org.infinispan.commons.configuration.BasicConfiguration in project micronaut-cache by micronaut-projects.

the class InfinispanCacheManager method getCache.

@NonNull
@Override
public SyncCache<RemoteCache<Object, Object>> getCache(String name) {
    BasicConfiguration basicConfiguration = new ConfigurationBuilder().build();
    RemoteCache<Object, Object> nativeCache = remoteCacheManager.administration().getOrCreateCache(name, basicConfiguration);
    return new InfinispanSyncCache(conversionService, nativeCache);
}
Also used : ConfigurationBuilder(org.infinispan.configuration.cache.ConfigurationBuilder) BasicConfiguration(org.infinispan.commons.configuration.BasicConfiguration) NonNull(io.micronaut.core.annotation.NonNull)

Example 3 with BasicConfiguration

use of org.infinispan.commons.configuration.BasicConfiguration in project infinispan by infinispan.

the class AnchoredKeysIT method testCreateAnchoredKeysCache.

@Test
public void testCreateAnchoredKeysCache() {
    BasicConfiguration config = new StringConfiguration("<infinispan><cache-container><replicated-cache name=\"anchored2\">\n" + "<locking concurrency-level=\"100\" acquire-timeout=\"1000\"/>\n" + "<anchored-keys xmlns=\"urn:infinispan:config:anchored-keys:" + Version.getMajorMinor() + "\" enabled=\"true\"/>\n" + "</replicated-cache></cache-container></infinispan>");
    RemoteCacheManager rcm = SERVER_TEST.hotrod().createRemoteCacheManager();
    rcm.administration().createCache("anchored2", config);
    test(rcm.getCache("anchored2"));
}
Also used : RemoteCacheManager(org.infinispan.client.hotrod.RemoteCacheManager) StringConfiguration(org.infinispan.commons.configuration.StringConfiguration) BasicConfiguration(org.infinispan.commons.configuration.BasicConfiguration) Test(org.junit.Test)

Aggregations

BasicConfiguration (org.infinispan.commons.configuration.BasicConfiguration)3 StringConfiguration (org.infinispan.commons.configuration.StringConfiguration)2 NonNull (io.micronaut.core.annotation.NonNull)1 RemoteCacheManager (org.infinispan.client.hotrod.RemoteCacheManager)1 ConfigurationBuilder (org.infinispan.configuration.cache.ConfigurationBuilder)1 Test (org.junit.Test)1