Skip to content

Instantly share code, notes, and snippets.

@noelyahan
Created August 15, 2015 05:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save noelyahan/1ffd0dd97f345bb547b5 to your computer and use it in GitHub Desktop.
Save noelyahan/1ffd0dd97f345bb547b5 to your computer and use it in GitHub Desktop.
CacheManager cacheManager = Caching.getCachingProvider().getCacheManager();
//CacheManager cacheManager = Caching.getCachingProvider().getCacheManager(new URI("sampleCacheManager"));
Cache<String, Integer> cache = cacheManager.getCache("sampleCache");
String key = "1";
int value1 = 9876;
cache.put(key, value1);
int value = cache.get(key).intValue();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment