Fork me on GitHub

cache2k 1.1.1.Alpha

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
  • Cache2kBuilder.build 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

    <dependency>
      <groupId>org.cache2k</groupId>
      <artifactId>cache2k-api</artifactId>
      <version>1.1.1.Alpha</version>
    </dependency>
    <dependency>
      <groupId>org.cache2k</groupId>
      <artifactId>cache2k-impl</artifactId>
      <version>1.1.1.Alpha</version>
      <scope>runtime</scope>
    </dependency>

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

    <dependency>
      <groupId>org.cache2k</groupId>
      <artifactId>cache2k-jcache</artifactId>
      <version>1.1.1.Alpha</version>
    </dependency>
    <dependency>
      <groupId>javax.cache</groupId>
      <artifactId>cache-api</artifactId>
      <version>1.1.0</version>
    </dependency>