This version is a development preview and not recommended for production use. Please give feedback to help stabilize and improve the next version.

New and Noteworthy

  • cache2k is now delivered in two jar files, cache2k-api contains the API and cache2k-impl the implementation. Both jar files need to be present at runtime. GH#80
  • Tiny API changes to improve integration with other frameworks

API Changes

  • Cache: Cache.getSimpleEntry, Cache.peekSimpleEntry
  • New exception: UnknownCacheException
  • throws IllegalStateException if cache with identical name already is created

Fixes and Improvements

  • CacheEntry.getValue(): does not make use of the configurable exception propagator any more to simplify internal code
  • faster access to a cache entry in case only the value is needed via: Cache.getSimpleEntry, Cache.peekSimpleEntry
  • async expiry listener: fix potential data inconsistency on the entry value and last modification time
  • Rename jar cache2k-all to cache2k-osgi-all. This contains a bundle of the cache2k-api and cache2k-impl jar file and is kept for OSGi environments only. This special variant is likely to be dropped in the future, see: GH#83. This combined jar should not be used any more to avoid potential duplication in the class path.
  • change timer implementation, faster operation when expiry is used
  • Improve timer robustness by changing thread priorities
  • Improve test coverage for timing related features
  • Cache2kConfiguration.isExternalConfigurationPresent is now true if there is an XML default configuration
  • JCache and XML configuration: allow expireAfterWrite to be configured via XML
  • Default configuraton and class loaders: hold separate default configuration per class loader
  • CacheManager: add toString() output
  • cache2k-impl: Code for XML configuration or JMX support is optional and can be removed, e.g. via ProGuard rules

Using this cache2k version

For Java SE/EE and Android environments


Note to Android users: The cache2k-impl contains code that might only be needed in server environments (e.g. JMX support). If not needed, it is possible to strip unnecessary code. Example ProGuard rules can be found at cache2k user guide - Android secion

Using the JCache / JSR107 provider


Back to top

Version: 1.2.1.Final. Last Published: 2019-03-08.