Skip to content

Instantly share code, notes, and snippets.

@Romeh
Created December 22, 2017 15:04
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 Romeh/528b1831081fe34790805cf7227cefeb to your computer and use it in GitHub Desktop.
Save Romeh/528b1831081fe34790805cf7227cefeb to your computer and use it in GitHub Desktop.
@Autowired
private javax.cache.CacheManager cacheManager;
// get access to your cache for further operation
private Cache<String, List<AlertEntry>> getAlertsCache() {
return cacheManager.getCache(CacheNames.Alerts.name());
}
// close the cache manager upon shutting down
@PreDestroy
public void close(){
cacheManager.close();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment