Last active
August 29, 2015 14:27
-
-
Save noelyahan/7183280050e400b24c1e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CacheManager cacheManager = Caching.getCachingProvider().getCacheManager(); | |
//CacheManager cacheManager = Caching.getCachingProvider().getCacheManager(new URI("sampleCacheManager")); | |
String cacheName = "cacheXXX"; | |
cache = cacheManager.createCache(cacheName, new MutableConfiguration<K, V>() | |
.setExpiryPolicyFactory(CreatedExpiryPolicy.factoryOf(new Duration(TimeUnit.SECONDS, cacheTimeout))) | |
.setExpiryPolicyFactory(ModifiedExpiryPolicy.factoryOf(new Duration(TimeUnit.SECONDS, cacheTimeout))) | |
.setStoreByValue(false)); | |
int value = 9876; | |
cache.put(key, value); | |
assertEquals(cache.get(key).intValue(), value); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment