本文整理匯總了Java中javax.cache.CacheManager.destroyCache方法的典型用法代碼示例。如果您正苦於以下問題:Java CacheManager.destroyCache方法的具體用法?Java CacheManager.destroyCache怎麽用?Java CacheManager.destroyCache使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類javax.cache.CacheManager
的用法示例。
在下文中一共展示了CacheManager.destroyCache方法的14個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: after
import javax.cache.CacheManager; //導入方法依賴的package包/類
@AfterClass
public static void after() throws Exception {
CacheManager cacheManager = Caching.getCachingProvider().getCacheManager();
cacheManager.destroyCache(CacheBasedDataModelAccessor.DATA_MODEL_TO_ID_CACHE_NAME);
cacheManager.destroyCache(CacheBasedDataModelAccessor.DATA_MODEL_TO_NAME_CACHE_NAME);
cacheManager.destroyCache(CacheBasedDataSetAccessor.DATA_SET_TO_ID_CACHE_NAME);
cacheManager.destroyCache(CacheBasedDataSetAccessor.DATA_SET_TO_NAME_CACHE_NAME);
cacheManager.destroyCache(CacheBasedDataSourceHub.DATA_SOURCE_CACHE_NAME);
cacheManager.destroyCache(DataSetOptimisationsCache.DATA_SET_TO_LAZY_PARAMETERS);
cacheManager.destroyCache(DataSetOptimisationsCache.DATA_SET_DS_LOOKUP_PARAMETERS);
}
示例2: after
import javax.cache.CacheManager; //導入方法依賴的package包/類
@AfterClass
public static void after() throws Exception {
CacheManager cacheManager = Caching.getCachingProvider().getCacheManager();
cacheManager.destroyCache(CacheBasedDataModelAccessor.DATA_MODEL_TO_ID_CACHE_NAME);
cacheManager.destroyCache(CacheBasedDataModelAccessor.DATA_MODEL_TO_NAME_CACHE_NAME);
cacheManager.destroyCache(CacheBasedMetaFunctionAccessor.META_FUNCTIONS_CACHE_NAME);
}
示例3: after
import javax.cache.CacheManager; //導入方法依賴的package包/類
@AfterClass
public static void after() throws Exception {
CacheManager cacheManager = Caching.getCachingProvider().getCacheManager();
cacheManager.destroyCache(CacheBasedDataSetAccessor.DATA_SET_TO_ID_CACHE_NAME);
cacheManager.destroyCache(CacheBasedDataSetAccessor.DATA_SET_TO_NAME_CACHE_NAME);
}
示例4: after
import javax.cache.CacheManager; //導入方法依賴的package包/類
@AfterClass
public static void after() throws Exception {
CacheManager cacheManager = Caching.getCachingProvider().getCacheManager();
cacheManager.destroyCache(CacheBasedDataSetAccessor.DATA_SET_TO_ID_CACHE_NAME);
cacheManager.destroyCache(CacheBasedDataSetAccessor.DATA_SET_TO_NAME_CACHE_NAME);
cacheManager.destroyCache(CacheBasedDataModelAccessor.DATA_MODEL_TO_ID_CACHE_NAME);
cacheManager.destroyCache(CacheBasedDataModelAccessor.DATA_MODEL_TO_NAME_CACHE_NAME);
cacheManager.destroyCache(CacheBasedMetaFunctionAccessor.META_FUNCTIONS_CACHE_NAME);
}
示例5: after
import javax.cache.CacheManager; //導入方法依賴的package包/類
@AfterClass
public static void after() throws Exception {
CacheManager cacheManager = Caching.getCachingProvider().getCacheManager();
cacheManager.destroyCache(CacheBasedDataSetAccessor.DATA_SET_TO_ID_CACHE_NAME);
cacheManager.destroyCache(CacheBasedDataSetAccessor.DATA_SET_TO_NAME_CACHE_NAME);
cacheManager.destroyCache(DataSetOptimisationsCache.DATA_SET_TO_LAZY_PARAMETERS);
cacheManager.destroyCache(DataSetOptimisationsCache.DATA_SET_DS_LOOKUP_PARAMETERS);
}
示例6: destroyExternalServices
import javax.cache.CacheManager; //導入方法依賴的package包/類
public static void destroyExternalServices() throws Exception {
CacheManager cacheManager = Caching.getCachingProvider().getCacheManager();
cacheManager.destroyCache(CacheBasedDataModelAccessor.DATA_MODEL_TO_ID_CACHE_NAME);
cacheManager.destroyCache(CacheBasedDataModelAccessor.DATA_MODEL_TO_NAME_CACHE_NAME);
cacheManager.destroyCache(CacheBasedDataSetAccessor.DATA_SET_TO_ID_CACHE_NAME);
cacheManager.destroyCache(CacheBasedDataSetAccessor.DATA_SET_TO_NAME_CACHE_NAME);
cacheManager.destroyCache(CacheBasedDataSourceHub.DATA_SOURCE_CACHE_NAME);
cacheManager.destroyCache(CacheBasedMetaFunctionAccessor.META_FUNCTIONS_CACHE_NAME);
cacheManager.destroyCache(DataSetOptimisationsCache.DATA_SET_TO_LAZY_PARAMETERS);
}
示例7: testTckStyleCreateDestroyClose
import javax.cache.CacheManager; //導入方法依賴的package包/類
/**
* Tests start -> destroy -> start -> close using CacheManager.
*/
public void testTckStyleCreateDestroyClose() throws Exception {
startGridsMultiThreaded(gridCount());
CacheManager mgr = Caching.getCachingProvider().getCacheManager();
String cacheName = "cache";
mgr.createCache(cacheName, new MutableConfiguration<Integer, String>().setTypes(Integer.class, String.class));
mgr.destroyCache(cacheName);
Cache<Integer, String> cache = mgr.createCache(cacheName,
new MutableConfiguration<Integer, String>().setTypes(Integer.class, String.class));
cache.close();
// Check second close succeeds without exception.
cache.close();
try {
cache.get(1);
fail();
}
catch (IllegalStateException ignored) {
// No-op;
}
}
示例8: getCacheNullValueClass
import javax.cache.CacheManager; //導入方法依賴的package包/類
@Test(expected = NullPointerException.class)
public void getCacheNullValueClass() {
String name = "c1";
CacheManager manager = Caching.getCachingProvider().getCacheManager();
manager.createCache(name, new MutableConfiguration().setTypes(Long.class, String.class));
try {
Caching.getCache(name, Long.class, null);
} finally {
manager.destroyCache(name);
}
}
示例9: removeCache_Null
import javax.cache.CacheManager; //導入方法依賴的package包/類
@Test
public void removeCache_Null() {
CacheManager cacheManager = getCacheManager();
try {
cacheManager.destroyCache(null);
fail("should have thrown an exception - cache name null");
} catch (NullPointerException e) {
//good
}
}
示例10: removeCache_There
import javax.cache.CacheManager; //導入方法依賴的package包/類
@Test
public void removeCache_There() {
CacheManager cacheManager = getCacheManager();
String name1 = "c1";
cacheManager.createCache(name1, new MutableConfiguration());
cacheManager.destroyCache(name1);
assertFalse(cacheManager.getCacheNames().iterator().hasNext());
}
示例11: removeCache_CacheStopped
import javax.cache.CacheManager; //導入方法依賴的package包/類
@Test
public void removeCache_CacheStopped() {
CacheManager cacheManager = getCacheManager();
String name1 = "c1";
cacheManager.createCache(name1, new MutableConfiguration());
Cache cache1 = cacheManager.getCache(name1);
cacheManager.destroyCache(name1);
ensureClosed(cache1);
}
示例12: removeCache_Stopped
import javax.cache.CacheManager; //導入方法依賴的package包/類
@Test
public void removeCache_Stopped() {
CacheManager cacheManager = getCacheManager();
cacheManager.close();
try {
cacheManager.destroyCache("c1");
fail();
} catch (IllegalStateException e) {
//ok
}
}
示例13: put
import javax.cache.CacheManager; //導入方法依賴的package包/類
private static void put() {
System.setProperty("hazelcast.jcache.provider.type", "server");
CachingProvider cachingProvider = Caching.getCachingProvider();
CacheManager cacheManager = cachingProvider.getCacheManager();
//configure the cache
MutableConfiguration<String, String> config = new MutableConfiguration<String, String>();
config.setStoreByValue(true)
.setTypes(String.class, String.class)
.setExpiryPolicyFactory(AccessedExpiryPolicy.factoryOf(Duration.FIVE_MINUTES))
.setStatisticsEnabled(true);
cacheManager.destroyCache("MY_CACHE");
//create the cache
cacheManager.createCache("MY_CACHE", config);
//get the cache
Cache<String, String> cache = cacheManager.getCache("MY_CACHE", String.class, String.class);
cache.put("theKey", "Hello World");
String value = cache.get("theKey");
System.out.println("echo cache.get('theKey') = " + value);//prints 'Hello World'
for (int increment = 0; increment < 100; increment++) {
cache.put("key-" + increment, "Hello World - " + increment);
}
System.out.println("End");
}
示例14: removeCache_NotThere
import javax.cache.CacheManager; //導入方法依賴的package包/類
@Test
public void removeCache_NotThere() {
CacheManager cacheManager = getCacheManager();
cacheManager.destroyCache("c1");
}