Building the JCache Java EE 8 bridge.. one brick at a time

Let’s quickly look at the Java EE 8-JCache bridge project. This is another concrete step as far as Java EE 8 integration efforts are concerned..


Details on the general idea behind this can be picked up from one of my recent posts on this topic

A bridge ?? What for ?

  • Serve as the integration point for JCache & Java EE 8
  • Provide decoupling: the Java EE 8 platform and the JCache API can be allowed to evolve separately and the bridge would provide a much needed cushion. Think of it as a regular Bridge Pattern (from the GoF) – just implemented in the form of a JSR😉


  • Derive from exiting (and popular) specifications like JPA which can make it easier to adopt and use
  • Standardise a JCache descriptor (configuration)
  • Implement Cache injection
  • Look at support for custom cache properties (which vary across different providers)
  • etc…..

Crossing the bridge

Here is a rather simple example. Its a Java EE 7 Maven project on GitHub. You should be able to pull in into any IDE (Netbeans recommended) and get going

All it does is

  • Defines a named cache in cache.xml placed within WEB-INF/classes/META-INF (this is a pre-requisite for WAR based artifacts)
  • Inject the cache in a JAX-RS resource
  • Save the JSR info in the cache for future use (if it already does not exist there)
  • It provides you JSR information e.g. http://localhost:9000/jcachejavaee8bridge/370 and tells you whether it has been picked up from the cache

Other notable points

  • The cache bridge API source has been included directly into the sample project to make dependency management easier (since its not in Maven yet). You might want to have the latest fork for your experiments
  • The JCache RI is being used by internally by the bridge. Experiment with another JCache provider (Hazelcast, Infinispan etc.), include its dependency and include it in the cache.xml configuration

How can you contribute ?

  • Explore the project
  • Provide ideas, files issues
  • Write tests, break stuff, file some more issues !
  • Get in touch with Adam Bien, translate your ideas into code and submit a PR…


About Abhishek

Currently working as a Senior Product Manager in the Oracle Cloud Application Development team with a focus on Oracle Cloud PaaS portfolio. When not hovering in the clouds, I stay grounded with Java EE
This entry was posted in Java EE and tagged , , , . Bookmark the permalink.

2 Responses to Building the JCache Java EE 8 bridge.. one brick at a time

  1. Pingback: Java EE 8 - Utilizando o JCache para suas aplicações -

  2. Pingback: Java EE 8 – Utilizando o JCache para suas aplicações – Agency Major

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s