JCache samples
Sample code for a JCache presentation at JHUG meetup.
HelloWorldTest: start hereEntryProcessorTest: demonstrates atomic execution ofEntryProcessorHelloWorldAppandHelloWorldAppTest:HelloWorldAppdemonstrates how to implement cache-aside and cache-through caching of aSlowService. It is a web application built on the JDK's embedded web server.HelloWorldHandlerdoes not cache.CacheAsideHandlerimplements the cache-aside pattern: queries the cache for cached results, then if none found, requests the result fromSlowServiceand puts the retrieved result in its cache.CacheThroughHandlerimplements the cache-through pattern: all requests are served from theCachewhich is now configured with aCacheLoader.
Building and running
The samples have been tested with Java 8 and maven 3.5.0. While building, skip tests as some are intentionally failing.
mvn -DskipTests clean packageYou may execute each test individually, for example:
mvn -Dtest=HelloWorldTest testJSR-107 resources
- JSR page on JCP: https://www.jcp.org/en/jsr/detail?id=107
- Source code and issue tracking: https://github.com/jsr107/
- Discussion forum: https://groups.google.com/forum/?fromgroups=#!forum/jsr107