当前位置: 首页>>代码示例>>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;未经允许,请勿转载。