Warning: This class is related to the JSR107 specification, which is in draft. It is subject to change without notice.
A cache implementation that matches the draft JCACHE specification.
WARNING: The JCache specfication is in draft and this API will change up until the time that JCACHE is finalised.
It is not possible for one class to implement both JCACHE and Ehcache in the same class due to conflicts with method signatures on get and remove.
This implementation is an adaptor to Ehcache, and will exhibit the same underlying characteristics as Ehcache. Additiona features have been added to Ehcache to match the JCache features. All of these features can be configured in ehcache.xml.
The current JCache CacheManager class, available in the draft, is considered unworkable. Instead, use the Ehcache
cacheManager.getJCache(String name)
to get a JCache. The JCache CacheManager is unlikely to make it into the final spec.
The recommended creational pattern for JCache is one of:
- Add a cache to ehcache.xml and use
cacheManager.getJCache(String name)
to access it. - Create a JCache from an Ehcache, using one of the constructors in this class. Two types of CacheLoader can be specified, in which case the underlying Ehcache loader is replaced by the one specified.
- Create an Ehcache from a Cache using its constructor, then a JCache, and then add it to the ehcache CacheManager using
cacheManager.addCache(JCache jCache)
@author Greg Luck
@version $Id: JCache.java 796 2008-10-09 02:39:03Z gregluck $
@since 1.3