1.0.0.CR1 - “Doheny Beach”
New and Noteworthy
- Configuration via XML file, see the Configuration via XML documentation section.
- Documentation emerges in the User Guide.
- Thread pools configurable for loading and prefetching.
Cache2kBuilder#loaderExecutor
,Cache2kBuilder#prefetchExecutor
- Various API cleanups.
- Improved Java Doc at various places.
- This version still contains deprecated methods. Users of the deprecated APIs should migrate now to the new one. The deprecated methods will be removed in the next release.
Potential breakages
Changes in semantics or API that may break existing applications are listed here. Modifications in the statistics output will not listed as breakage.
sharpExpiry(true)
only has effect times returned byExpiryPolicy
. When the expiry is controlled by the durationexpireAfterWrite
it may lag and the value is returned when a reload is in progress, when refresh ahead is enabled.eternal(false)
has an effect now and means “needs expiry, but expiry is undefined yet.”. This can be used to ensure that an expiry time is set via the file based configuration.- Setting conflicting parameters like
eternal(true)
andexpireAfterWrite(...)
leads to an exception - Attempts to create a cache with the identical name of an active cache yields a
IllegalArgumentException
. (In the release before the cache name was disambiguated by adding a incrementing number) - JMX properties: Consistent naming and cleanup
Fixes and Improvements
- cache2k version number, “greeting” is logged only once at info level
- Creation of
CacheManager
is logged at debug level - Check/restrict allowed characters in a cache manager name
- Rename internal artifacts
Cache.getEntry()
: improve entry debug output for a stored exception- remove task queue for asynchronous loads/refreshs and handle rejections gracefully
- reduce default loader thread count to one per available CPU
toString()
contains cache manager nametoString()
add version number- Cleanup and improve
CacheManager
methods - Creation and destruction on
CacheManager
corrected
Using this cache2k version
For Java SE/EE environments
<dependency> <groupId>org.cache2k</groupId> <artifactId>cache2k-api</artifactId> <version>1.0.0.CR1</version> <scope>provided</scope> </dependency> <dependency> <groupId>org.cache2k</groupId> <artifactId>cache2k-all</artifactId> <version>1.0.0.CR1</version> <scope>runtime</scope> </dependency>
For Android
<dependency> <groupId>org.cache2k</groupId> <artifactId>cache2k-api</artifactId> <version>1.0.0.CR1</version> </dependency> <dependency> <groupId>org.cache2k</groupId> <artifactId>cache2k-core</artifactId> <version>1.0.0.CR1</version> <scope>runtime</scope> </dependency>
Using the JCache / JSR107 provider
<dependency> <groupId>org.cache2k</groupId> <artifactId>cache2k-jcache</artifactId> <version>1.0.0.CR1</version> </dependency> <dependency> <groupId>javax.cache</groupId> <artifactId>cache-api</artifactId> <version>1.0.0</version> </dependency>