[jax-rs-spec users] [jsr339-experts] Using JSR107 "JCache" with JAX-RS 2.0

From: Markus KARG <>
Date: Sat, 27 Oct 2012 15:50:22 +0200



The JSR107 expert group, lead by Ehcache founder Greg Luck, defined a Java
caching API which will be part of Java EE 7. The API allows to plug in a
cache to virtually anything that needs to be cached. This opens some
interesting scenarios in the JAX-RS world, like explicitly annotating JAX-RS
resource methods with JCache annotations to get "automatic cache
integration" with @GET and @PUT methods, etc., or like writing a filter and
/ or entity interceptor using the JCache API to put / get cache entries in a
transparent way (hence not cluttering the JAX-RS resources with


I think it is obviously that caching will speed up any client and / or
server by reducing unnecessary data transmission or transformation, and that
the existence of a Java EE standard for accessing caches opens the doors for
automatic cache support for a lot of other Java EE standards like here
JAX-RS 2.0, so we should talk about that.


Since there might be clarifications needed how JCache API relates the JAX-RS
API (possibly support inside of a JAX-RS implementation is needed, or there
might be interest on either side to provide one single common JCache based
"generic" JAX-RS filter or interceptor to not have all users to write this
on their own, which could be provided as part of the JAX-RS RI as a joint
JSR107/JSR339 effort), I want to suggest that both teams negotiate whether
either of the specs need to have some clarifications added to support this.


Better to discuss HOW to integratate JCache with JAX-RS NOW than waiting
until lots of users complain about things being unclear or not operational