Skip to content

Instantly share code, notes, and snippets.

@abhirockzz
Last active August 29, 2015 14:15
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 abhirockzz/14927cb22dad2fa16402 to your computer and use it in GitHub Desktop.
Save abhirockzz/14927cb22dad2fa16402 to your computer and use it in GitHub Desktop.
Choosing JCache providers
//set JMV level system property
-Djavax.cache.spi.cachingprovider=org.ehcache.jcache.JCacheCachingProvider
//code level config
System.setProperty("javax.cache.spi.cachingprovider","org.ehcache.jcache.JCacheCachingProvider");
//you want to choose from multiple JCache providers at runtime
CachingProvider ehcacheJCacheProvider = Caching.getCachingProvider("org.ehcache.jcache.JCacheCachingProvider");
//which JCache providers do I have on the classpath?
Iterable<CachingProvider> jcacheProviders = Caching.getCachingProviders();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment