當前位置: 首頁>>代碼示例>>Java>>正文


Java EmbeddedCacheManager.stop方法代碼示例

本文整理匯總了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();
}
 
開發者ID:danberindei,項目名稱:infinispan-cachestore-leveldb,代碼行數:24,代碼來源:ConfigurationTest.java

示例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();
}
 
開發者ID:danberindei,項目名稱:infinispan-cachestore-leveldb,代碼行數:19,代碼來源:ConfigurationTest.java

示例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();
}
 
開發者ID:saturnism,項目名稱:infinispan-cachestore-mapdb,代碼行數:25,代碼來源:ConfigurationTest.java

示例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();
}
 
開發者ID:saturnism,項目名稱:infinispan-cachestore-offheap,代碼行數:24,代碼來源:ConfigurationTest.java

示例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");
}
 
開發者ID:danberindei,項目名稱:infinispan-cachestore-leveldb,代碼行數:13,代碼來源:ConfigurationTest.java

示例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");
}
 
開發者ID:danberindei,項目名稱:infinispan-cachestore-leveldb,代碼行數:13,代碼來源:ConfigurationTest.java

示例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();
}
 
開發者ID:saturnism,項目名稱:infinispan-cachestore-mapdb,代碼行數:10,代碼來源:ConfigurationTest.java

示例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();
}
 
開發者ID:infinispan,項目名稱:infinispan-cachestore-cassandra,代碼行數:9,代碼來源:CassandraConfigurationTest.java

示例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();
}
 
開發者ID:infinispan,項目名稱:infinispan-cachestore-cassandra,代碼行數:9,代碼來源:CassandraConfigurationTest.java

示例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();
}
 
開發者ID:saturnism,項目名稱:infinispan-cachestore-offheap,代碼行數:10,代碼來源:ConfigurationTest.java


注:本文中的org.infinispan.manager.EmbeddedCacheManager.stop方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。