Skip to content

Instantly share code, notes, and snippets.

@noelyahan
Created August 15, 2015 04:23
Show Gist options
  • Save noelyahan/a18c723a1f8b0a7b34a9 to your computer and use it in GitHub Desktop.
Save noelyahan/a18c723a1f8b0a7b34a9 to your computer and use it in GitHub Desktop.
CacheManager cacheManager = Caching.getCacheManagerFactory().getCacheManager("test");
String cacheName = "cacheXXX";
cache = cacheManager.<String,Integer>createCacheBuilder(cacheName).setExpiry(CacheConfiguration.ExpiryType.MODIFIED, new CacheConfiguration.Duration(TimeUnit.SECONDS, 10)).
setStoreByValue(false).build();
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