本文整理匯總了Java中org.infinispan.manager.EmbeddedCacheManager.stop方法的典型用法代碼示例。如果您正苦於以下問題:Java EmbeddedCacheManager.stop方法的具體用法?Java EmbeddedCacheManager.stop怎麽用?Java EmbeddedCacheManager.stop使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.infinispan.manager.EmbeddedCacheManager
的用法示例。
在下文中一共展示了EmbeddedCacheManager.stop方法的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: testConfigBuilder
import org.infinispan.manager.EmbeddedCacheManager; //導入方法依賴的package包/類
public void testConfigBuilder() {
GlobalConfiguration globalConfig = new GlobalConfigurationBuilder().globalJmxStatistics().transport().defaultTransport().build();
Configuration cacheConfig = new ConfigurationBuilder().persistence().addStore(LevelDBStoreConfigurationBuilder.class).location(tmpDataDirectory)
.expiredLocation(tmpExpiredDirectory).implementationType(LevelDBStoreConfiguration.ImplementationType.AUTO).build();
StoreConfiguration cacheLoaderConfig = cacheConfig.persistence().stores().get(0);
assertTrue(cacheLoaderConfig instanceof LevelDBStoreConfiguration);
LevelDBStoreConfiguration leveldbConfig = (LevelDBStoreConfiguration) cacheLoaderConfig;
assertEquals(tmpDataDirectory, leveldbConfig.location());
assertEquals(tmpExpiredDirectory, leveldbConfig.expiredLocation());
EmbeddedCacheManager cacheManager = new DefaultCacheManager(globalConfig);
cacheManager.defineConfiguration("testCache", cacheConfig);
cacheManager.start();
Cache<String, String> cache = cacheManager.getCache("testCache");
cache.put("hello", "there");
cache.stop();
cacheManager.stop();
}
示例2: testLegacyJavaConfig
import org.infinispan.manager.EmbeddedCacheManager; //導入方法依賴的package包/類
@Test(enabled = false, description = "ISPN-3388")
public void testLegacyJavaConfig() {
GlobalConfiguration globalConfig = new GlobalConfigurationBuilder().globalJmxStatistics().transport().defaultTransport().build();
Configuration cacheConfig = new ConfigurationBuilder().persistence().addStore(LevelDBStoreConfigurationBuilder.class).addProperty("location", tmpDataDirectory)
.addProperty("expiredLocation", tmpExpiredDirectory).addProperty("implementationType", LevelDBStoreConfiguration.ImplementationType.AUTO.toString()).build();
EmbeddedCacheManager cacheManager = new DefaultCacheManager(globalConfig);
cacheManager.defineConfiguration("testCache", cacheConfig);
cacheManager.start();
Cache<String, String> cache = cacheManager.getCache("testCache");
cache.put("hello", "there legacy java");
cache.stop();
cacheManager.stop();
}
示例3: testConfigBuilder
import org.infinispan.manager.EmbeddedCacheManager; //導入方法依賴的package包/類
public void testConfigBuilder() {
GlobalConfiguration globalConfig = new GlobalConfigurationBuilder().globalJmxStatistics().transport().defaultTransport().build();
Configuration cacheConfig = new ConfigurationBuilder().persistence().addStore(MapDBStoreConfigurationBuilder.class)
.location(tmpDirectory)
.compression(true)
.build();
StoreConfiguration cacheLoaderConfig = cacheConfig.persistence().stores().get(0);
assertTrue(cacheLoaderConfig instanceof MapDBStoreConfiguration);
MapDBStoreConfiguration config = (MapDBStoreConfiguration) cacheLoaderConfig;
assertEquals(true, config.compression());
EmbeddedCacheManager cacheManager = new DefaultCacheManager(globalConfig);
cacheManager.defineConfiguration("testCache", cacheConfig);
cacheManager.start();
Cache<String, String> cache = cacheManager.getCache("testCache");
cache.put("hello", "there");
cache.stop();
cacheManager.stop();
}
示例4: testConfigBuilder
import org.infinispan.manager.EmbeddedCacheManager; //導入方法依賴的package包/類
public void testConfigBuilder() {
GlobalConfiguration globalConfig = new GlobalConfigurationBuilder().globalJmxStatistics().transport().defaultTransport().build();
Configuration cacheConfig = new ConfigurationBuilder().persistence().addStore(OffheapStoreConfigurationBuilder.class)
.compression(true)
.build();
StoreConfiguration cacheLoaderConfig = cacheConfig.persistence().stores().get(0);
assertTrue(cacheLoaderConfig instanceof OffheapStoreConfiguration);
OffheapStoreConfiguration config = (OffheapStoreConfiguration) cacheLoaderConfig;
assertEquals(true, config.compression());
EmbeddedCacheManager cacheManager = new DefaultCacheManager(globalConfig);
cacheManager.defineConfiguration("testCache", cacheConfig);
cacheManager.start();
Cache<String, String> cache = cacheManager.getCache("testCache");
cache.put("hello", "there");
cache.stop();
cacheManager.stop();
}
示例5: textXmlConfigLegacy
import org.infinispan.manager.EmbeddedCacheManager; //導入方法依賴的package包/類
@Test(enabled = false, description = "ISPN-3388")
public void textXmlConfigLegacy() throws IOException {
EmbeddedCacheManager cacheManager = new DefaultCacheManager("config/leveldb-config-legacy-" +
LevelDBStoreConfiguration.ImplementationType.AUTO.toString().toLowerCase() + ".xml");
Cache<String, String> cache = cacheManager.getCache("testCache");
cache.put("hello", "there legacy xml");
cache.stop();
cacheManager.stop();
TestingUtil.recursiveFileRemove("/tmp/leveldb/legacy");
}
示例6: testXmlConfig60
import org.infinispan.manager.EmbeddedCacheManager; //導入方法依賴的package包/類
public void testXmlConfig60() throws IOException {
EmbeddedCacheManager cacheManager = new DefaultCacheManager("config/leveldb-config-60-" +
LevelDBStoreConfiguration.ImplementationType.AUTO.toString().toLowerCase() + ".xml");
Cache<String, String> cache = cacheManager.getCache("testCache");
cache.put("hello", "there 60 xml");
cache.stop();
cacheManager.stop();
TestingUtil.recursiveFileRemove("/tmp/leveldb/60");
}
示例7: testXmlConfig60
import org.infinispan.manager.EmbeddedCacheManager; //導入方法依賴的package包/類
public void testXmlConfig60() throws IOException {
EmbeddedCacheManager cacheManager = new DefaultCacheManager("config/mapdb-config-60.xml");
Cache<String, String> cache = cacheManager.getCache("testCache");
cache.put("hello", "there 60 xml");
cache.stop();
cacheManager.stop();
}
示例8: testXmlConfig
import org.infinispan.manager.EmbeddedCacheManager; //導入方法依賴的package包/類
public void testXmlConfig() throws IOException {
EmbeddedCacheManager cacheManager = new DefaultCacheManager("config.xml");
Cache<String, String> cache = cacheManager.getCache("cassandracache");
cache.put("Hello", "Moon");
assertEquals(cache.get("Hello"), "Moon");
cache.stop();
cacheManager.stop();
}
示例9: testCustomStoreConfig
import org.infinispan.manager.EmbeddedCacheManager; //導入方法依賴的package包/類
public void testCustomStoreConfig() throws IOException {
EmbeddedCacheManager cacheManager = new DefaultCacheManager("customstore-config.xml");
Cache<String, String> cache = cacheManager.getCache("cassandracache");
cache.put("Hi", "there");
assertEquals(cache.get("Hi"), "there");
cache.stop();
cacheManager.stop();
}
示例10: testXmlConfig60
import org.infinispan.manager.EmbeddedCacheManager; //導入方法依賴的package包/類
public void testXmlConfig60() throws IOException {
EmbeddedCacheManager cacheManager = new DefaultCacheManager("config/offheap-config-60.xml");
Cache<String, String> cache = cacheManager.getCache("testCache");
cache.put("hello", "there 52 xml");
cache.stop();
cacheManager.stop();
}