{"id":597,"date":"2011-10-28T09:15:00","date_gmt":"2011-10-28T09:15:00","guid":{"rendered":"http:\/\/www.javacodegeeks.com\/2012\/10\/the-new-java-caching-standard-javax-cache.html"},"modified":"2012-10-21T20:23:01","modified_gmt":"2012-10-21T20:23:01","slug":"new-java-caching-standard-javaxcache","status":"publish","type":"post","link":"https:\/\/www.javacodegeeks.com\/2011\/10\/new-java-caching-standard-javaxcache.html","title":{"rendered":"The new Java Caching Standard (javax.cache)"},"content":{"rendered":"<div dir=\"ltr\" style=\"text-align: left\">This post explores the new Java caching standard: javax.cache.<\/p>\n<p><span style=\"font-weight: bold\">How it Fits into the Java Ecosystem<\/span><\/p>\n<p>This standard is being developed by <a href=\"http:\/\/jcp.org\/en\/jsr\/summary?id=107\">JSR107<\/a>, of which the author is co-spec lead. JSR107 is included in Java EE 7, being developed by <a href=\"http:\/\/jcp.org\/en\/jsr\/summary?id=342\">JSR342<\/a>. Java EE 7 is due to be finalised at the end of 2012. But in the meantime javax.cache will work in Java SE 6 and higher and Java EE 6 environments as well as with Spring and other popular environments.<\/p>\n<p>JSR107 has draft status. We are currently at release 0.3 of the API, the reference implementation and the TCK. The code samples in this article work against this version.<\/p>\n<p><span style=\"font-weight: bold\">Adoption<\/span><\/p>\n<p>Vendors who are either active members of the expert group or have expressed interest in implementing the specification are:<\/p>\n<ul style=\"text-align: left\">\n<li>Terracotta \u2013 Ehcache<\/li>\n<li>Oracle \u2013 Coherence<\/li>\n<li>JBoss \u2013 Infinispan<\/li>\n<li>IBM \u2013 ExtemeScale<\/li>\n<li>SpringSource \u2013 Gemfire<\/li>\n<li>GridGain<\/li>\n<li>TMax<\/li>\n<li>Google App Engine Java<\/li>\n<\/ul>\n<p>Terracotta will be releasing a module for Ehcache to coincide with the final draft and then updating that if required for the final version.<\/p>\n<p><strong>Features<\/strong><\/p>\n<p>From a design point of view, the basic concepts are a CacheManager that holds and controls a collection of Caches. Caches have entries. The basic API can be thought of map-\u00adlike with the following additional features:<\/p>\n<ul style=\"text-align: left\">\n<li>atomic operations, similar to java.util.ConcurrentMap<\/li>\n<li>read-through caching<\/li>\n<li>write-through caching<\/li>\n<li>cache event listeners<\/li>\n<li>statistics<\/li>\n<li>transactions including all isolation levels<\/li>\n<li>caching annotations<\/li>\n<li>generic caches which hold a defined key and value type<\/li>\n<li>definition of storage by reference (applicable to on heap caches only) and storage by value<\/li>\n<\/ul>\n<p><span style=\"font-weight: bold\">Optional Features<\/span><\/p>\n<p>Rather than split the specification into a number of editions targeted at different user constituencies such as Java SE and Spring\/EE, we have taken a different approach.<\/p>\n<p>Firstly, for Java SE style caching there are no dependencies. And for Spring\/EE where you might want to use annotations and\/or transactions, the dependencies will be satisfied by those frameworks.<\/p>\n<p>Secondly we have a capabilities API via ServiceProvider.isSupported(OptionalFeature feature)so that you can determine at runtime what the capabilities of the implementation are.  Optional features are:<\/p>\n<ul style=\"text-align: left\">\n<li>storeByReference \u2013 storeByValue is the default<\/li>\n<li>transactional<\/li>\n<li>annotations<\/li>\n<\/ul>\n<p>This makes it possible for an implementation to support the specification without necessarily supporting all the features, and allows end users and frameworks to discover what the features are so they can dynamically configure appropriate usage.<\/p>\n<p><span style=\"font-weight: bold\">Good for Standalone and Distributed Caching<\/span><\/p>\n<p>While the specification does not mandate a particular distributed cache topology it is cognizant that caches may well be distributed. We have one API that covers both usages but it is sensitive to distributed concerns. For example CacheEntryListener has a NotificationScope of events it listens for so that events can be restricted to local delivery. We do not have high network cost map-like methods such as keySet() and values(). And we generally prefer zero or low cost return types. So while Map has V put(K key, V value) javax.cache.Cache has void put(K key, V value).<br \/>\nClassloading<\/p>\n<p>Caches contain data shared by multiple threads which may themselves be running in different container applications or OSGi bundles within one JVM and might be distributed across multiple JVMs in a cluster. This makes classloading tricky.<div style=\"display:inline-block; margin: 15px 0;\"> <div id=\"adngin-JavaCodeGeeks_incontent_video-0\" style=\"display:inline-block;\"><\/div> <\/div><\/p>\n<p>We have addressed this problem. When a CacheManager is created a classloader may be specified. If none is specified the implementation provides a default. Either way object de-serialization will use the CacheManager\u2019s classloader.<\/p>\n<p>This is a big improvement over the approach taken by caches like Ehcache that use a fall-back approach. First the thread\u2019s context classloader is used and it that fails, another classloader is tried. This can be made to work in most scenarios but is a bit hit and miss and varies considerably by implementation.<\/p>\n<p><span style=\"font-weight: bold\">Getting the Code<\/span><\/p>\n<p>The spec is in Maven central. The Maven snippet is:<\/p>\n<pre class=\"brush:xml\">&lt;dependency&gt;\r\n     &lt;groupId&gt;javax.cache&lt;\/groupId&gt;\r\n     &lt;artifactId&gt;cache-api&lt;\/artifactId&gt;\r\n     &lt;version&gt;0.3&lt;\/version&gt;\r\n&lt;\/dependency&gt;\r\n<\/pre>\n<p><span style=\"font-weight: bold\">A Cook\u2019s Tour of the API<\/span><\/p>\n<p><u>Creating a CacheManager<\/u><\/p>\n<p>We support the Java 6 java.util.ServiceLoader creational approach. It will automaticaly detect a cache implementation in your classpath. You then create a CacheManager with:<\/p>\n<pre class=\"brush:java\">CacheManager cacheManager = Caching.getCacheManager();\r\n<\/pre>\n<p>which returns a singleton CacheManager called \u201c__default__\u201d. Subsequent calls return the same CacheManager.<\/p>\n<p>CacheManagers can have names and classloaders configured in. e.g.<\/p>\n<pre class=\"brush:java\">CacheManager cacheManager =\r\n Caching.getCacheManager(\"app1\", Thread.currentThread().getContextClassLoader());\r\n<\/pre>\n<p>Implementations may also support direct creation with new for maximum flexibility:<\/p>\n<pre class=\"brush:java\">CacheManager cacheManager =\r\n new RICacheManager(\"app1\", Thread.currentThread().getContextClassLoader());\r\n<\/pre>\n<p>Or to do the same thing without adding a compile time dependency on any particular implementation:<\/p>\n<pre class=\"brush:java\">String className = \"javax.cache.implementation.RIServiceProvider\";\r\nClass&lt;ServiceProvider&gt; clazz =\r\n (Class&lt;ServiceProvider&gt;)Class.forName(className);\r\nServiceProvider provider = clazz.newInstance();\r\nreturn provider.createCacheManager(Thread.currentThread().getContextClassLoader(), \"app1\");\r\n<\/pre>\n<p>We expect implementations to have their own well-known configuration files which will be used to configure the CacheManager. The name of the CacheManager can be used to distinguish the configuration file. For ehcache, this will be the familiar ehcache.xml placed at the root of the classpath with a hyphenated prefix for the name of the CacheManager. So, the default CacheManager will simply be ehcache.xml and \u201cmyCacheManager\u201d will be app1-ehcache.xml.<\/p>\n<p><u>Creating a Cache<\/u><\/p>\n<p>The API supports programmatic creation of caches. This complements the usual convention of configuring caches declaratively which is left to each vendor.<\/p>\n<p>To programmatically configure a cache named \u201ctestCache\u201d which is set for read-through<\/p>\n<pre class=\"brush:java\">cacheManager = getCacheManager();\r\nCacheConfiguration cacheConfiguration = cacheManager.createCacheConfiguration();\r\ncacheConfiguration.setReadThrough(true);\r\nCache testCache = cacheManager.createCacheBuilder(\"testCache\")\r\n .setCacheConfiguration(cacheConfiguration).build();\r\n<\/pre>\n<p><u>Getting a reference to a Cache<\/u><\/p>\n<p>You get caches from the CacheManager. To get a cache called \u201ctestCache\u201d:<\/p>\n<pre class=\"brush:java\">Cache&lt;Integer, Date&gt; cache = cacheManager.getCache(\"testCache\");\r\n<\/pre>\n<p><u>Basic Cache Operations<\/u><\/p>\n<p>To put to a cache:<\/p>\n<pre class=\"brush:java\">Cache&lt;Integer, Date&gt; cache = cacheManager.getCache(cacheName);\r\nDate value1 = new Date();\r\nInteger key = 1;\r\ncache.put(key, value1);\r\n<\/pre>\n<p>To get from a cache:<\/p>\n<pre class=\"brush:java\">Cache&lt;Integer, Date&gt; cache =\r\n cacheManager.getCache(cacheName);\r\nDate value2 = cache.get(key);\r\n<\/pre>\n<p>To remove from a cache:<\/p>\n<pre class=\"brush:java\">Cache&lt;Integer, Date&gt; cache =\r\n cacheManager.getCache(cacheName);\r\nInteger key = 1;\r\ncache.remove(key);\r\n<\/pre>\n<p><span style=\"font-weight: bold\">Annotations<\/span><\/p>\n<p>JSR107 introduces a standardized set of caching annotations, which do method level caching interception on annotated classes running in dependency injection containers. Caching annotations are becoming increasingly popular, starting with <a href=\"http:\/\/code.google.com\/p\/ehcache-spring-annotations\/\">Ehcache Annotations for Spring<\/a>, which then influenced Spring 3\u2019s caching annotations.<\/p>\n<p>The JSR107 annotations cover the most common cache operations including:<\/p>\n<ul style=\"text-align: left\">\n<li>@CacheResult \u2013 use the cache<\/li>\n<li>@CachePut \u2013 put into the cache<\/li>\n<li>@CacheRemoveEntry \u2013 remove a single entry from the cache<\/li>\n<li>@CacheRemoveAll \u2013 remove all entries from the cache<\/li>\n<\/ul>\n<p>When the required cache name, key and value can be inputed they are not required. See the JavaDoc for the details. To allow greater control, you can specify all these and more. In the following example, the cacheName attribute is specified to be \u201cdomainCache\u201d, index is specified as the key and domain as the value.<\/p>\n<pre class=\"brush:java\">public class DomainDao {\r\n     @CachePut(cacheName=\"domainCache\")\r\n     public void updateDomain(String domainId, @CacheKeyParam int index,\r\n @CacheValue Domain domain) {\r\n ...\r\n     }\r\n}\r\n<\/pre>\n<p>The reference implementation includes an implementation for both Spring and CDI. CDI is the standardised container driven injection introduced in Java EE 6. The implementation is nicely modularised for reuse, uses an Apache license, and we therefore expect several open source caches to reuse them. While we have not done an implementation for Guice, this could be easily done.<\/p>\n<p><span style=\"font-weight: bold\">Annotation Example<\/span><\/p>\n<p>This example shows how to use annotations to keep a cache in sync with an underlying data structure, in this case a Blog manager, and also how to use the cache to speed up responses, done with @CacheResult<\/p>\n<pre class=\"brush:java\">public class BlogManager {\r\n\r\n @CacheResult(cacheName=\"blogManager\")\r\n public Blog getBlogEntry(String title) {...}\r\n\r\n @CacheRemoveEntry(cacheName=\"blogManager\")\r\n public void removeBlogEntry(String title) {...}\r\n\r\n @CacheRemoveAll(cacheName=\"blogManager\")\r\n public void removeAllBlogs() {...}\r\n\r\n @CachePut(cacheName=\"blogManager\")\r\n public void createEntry(@CacheKeyParam String title, @CacheValue Blog blog) {...}\r\n\r\n @CacheResult(cacheName=\"blogManager\")\r\n public Blog getEntryCached(String randomArg, @CacheKeyParam String title){...}\r\n\r\n}\r\n<\/pre>\n<p><span style=\"font-weight: bold\">Wiring Up Spring<\/span><\/p>\n<p>For Spring the key is the following config line, which adds the caching annotation interceptors into the Spring context:<\/p>\n<pre class=\"brush:xml\">&lt;jcache-spring:annotation-driven proxy-target-class=\"true\"\/&gt;\r\n<\/pre>\n<p>A full example  is:<\/p>\n<pre class=\"brush:xml\">&lt;beans&gt;\r\n &lt;context:annotation-config\/&gt;\r\n &lt;jcache-spring:annotation-driven proxy-target-class=\"true\"\/&gt;\r\n &lt;bean id=\"cacheManager\" factory-method=\"getCacheManager\" \/&gt;\r\n&lt;\/beans&gt;\r\n<\/pre>\n<p>Spring has it\u2019s own caching annotations based on earlier work from JSR107 contributor Eric Dalquist. Those annotations and JSR107 will happily co-exist.<\/p>\n<p><span style=\"font-weight: bold\">Wiring Up CDI<\/span><\/p>\n<p>First create an implementation of javax.cache.annotation.BeanProvider and then tell CDI where to find it  declaring a resource named javax.cache.annotation.BeanProvider in the classpath at \/META-INF\/services\/.<\/p>\n<p>For an example using the Weld implementation of CDI, see the <a href=\"https:\/\/github.com\/jsr107\/jsr107tck\/blob\/master\/cdi-weld-annotations-test-harness\/src\/main\/java\/javax\/cache\/annotation\/impl\/cdi\/test\/CdiBeanProvider.java\">CdiBeanProvider<\/a> in our CDI test harness.<\/p>\n<p><span style=\"font-weight: bold\">Further Reading<\/span><\/p>\n<p>For further reading visit the JSRs home page at <a href=\"https:\/\/github.com\/jsr107\/jsr107spec\">https:\/\/github.com\/jsr107\/jsr107spec<\/a>. <\/p>\n<p><strong><i>Reference: <\/i><\/strong><a href=\"http:\/\/gregluck.com\/blog\/archives\/2011\/10\/javax-cache-the-new-java-caching-standard\/\">javax.cache: The new Java Caching Standard<\/a> from our <a href=\"http:\/\/www.javacodegeeks.com\/p\/jcg.html\">JCG partner<\/a> Greg Luck at <a href=\"http:\/\/gregluck.com\/blog\/\">Greg Luck&#8217;s Blog<\/a>.<\/p>\n<div style=\"margin: 0px\"><strong><i>Related Articles :<\/i><\/strong><\/div>\n<ul>\n<li><a href=\"http:\/\/www.javacodegeeks.com\/2011\/02\/spring-31-cache-abstraction-tutorial.html\">Spring 3.1 Cache Abstraction Tutorial<\/a><\/li>\n<li><a href=\"http:\/\/www.javacodegeeks.com\/2011\/10\/java-ee6-cdi-named-components-and.html\">Java EE6 CDI, Named Components and Qualifiers<\/a> <\/li>\n<li><a href=\"http:\/\/www.javacodegeeks.com\/2010\/05\/jboss-42x-spring-3-jpa-hibernate.html\">JBoss 4.2.x Spring 3 JPA Hibernate Tutorial<\/a><\/li>\n<li><a href=\"http:\/\/www.javacodegeeks.com\/2010\/05\/jboss-42x-spring-3-jpa-hibernate_21.html\">JBoss 4.2.x Spring 3 JPA Hibernate Tutorial Part #2<\/a><\/li>\n<li><a href=\"http:\/\/www.javacodegeeks.com\/p\/java-tutorials.html\">Java Tutorials and Android Tutorials list<\/a> <\/li>\n<\/ul>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>This post explores the new Java caching standard: javax.cache. How it Fits into the Java Ecosystem This standard is being developed by JSR107, of which the author is co-spec lead. JSR107 is included in Java EE 7, being developed by JSR342. Java EE 7 is due to be finalised at the end of 2012. But &hellip;<\/p>\n","protected":false},"author":106,"featured_media":112,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[285],"class_list":["post-597","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-enterprise-java","tag-cache"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>The new Java Caching Standard (javax.cache) - Java Code Geeks<\/title>\n<meta name=\"description\" content=\"This post explores the new Java caching standard: javax.cache. How it Fits into the Java Ecosystem This standard is being developed by JSR107, of which\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.javacodegeeks.com\/2011\/10\/new-java-caching-standard-javaxcache.html\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"The new Java Caching Standard (javax.cache) - Java Code Geeks\" \/>\n<meta property=\"og:description\" content=\"This post explores the new Java caching standard: javax.cache. How it Fits into the Java Ecosystem This standard is being developed by JSR107, of which\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.javacodegeeks.com\/2011\/10\/new-java-caching-standard-javaxcache.html\" \/>\n<meta property=\"og:site_name\" content=\"Java Code Geeks\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/javacodegeeks\" \/>\n<meta property=\"article:published_time\" content=\"2011-10-28T09:15:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2012-10-21T20:23:01+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/enterprise-java-logo.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"150\" \/>\n\t<meta property=\"og:image:height\" content=\"150\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Greg Luck\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:site\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Greg Luck\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"7 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2011\\\/10\\\/new-java-caching-standard-javaxcache.html#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2011\\\/10\\\/new-java-caching-standard-javaxcache.html\"},\"author\":{\"name\":\"Greg Luck\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/person\\\/cb20aa33bd4fc2102eb5b879f393d0f4\"},\"headline\":\"The new Java Caching Standard (javax.cache)\",\"datePublished\":\"2011-10-28T09:15:00+00:00\",\"dateModified\":\"2012-10-21T20:23:01+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2011\\\/10\\\/new-java-caching-standard-javaxcache.html\"},\"wordCount\":1263,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2011\\\/10\\\/new-java-caching-standard-javaxcache.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/enterprise-java-logo.jpg\",\"keywords\":[\"Cache\"],\"articleSection\":[\"Enterprise Java\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.javacodegeeks.com\\\/2011\\\/10\\\/new-java-caching-standard-javaxcache.html#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2011\\\/10\\\/new-java-caching-standard-javaxcache.html\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2011\\\/10\\\/new-java-caching-standard-javaxcache.html\",\"name\":\"The new Java Caching Standard (javax.cache) - Java Code Geeks\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2011\\\/10\\\/new-java-caching-standard-javaxcache.html#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2011\\\/10\\\/new-java-caching-standard-javaxcache.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/enterprise-java-logo.jpg\",\"datePublished\":\"2011-10-28T09:15:00+00:00\",\"dateModified\":\"2012-10-21T20:23:01+00:00\",\"description\":\"This post explores the new Java caching standard: javax.cache. How it Fits into the Java Ecosystem This standard is being developed by JSR107, of which\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2011\\\/10\\\/new-java-caching-standard-javaxcache.html#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.javacodegeeks.com\\\/2011\\\/10\\\/new-java-caching-standard-javaxcache.html\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2011\\\/10\\\/new-java-caching-standard-javaxcache.html#primaryimage\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/enterprise-java-logo.jpg\",\"contentUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/enterprise-java-logo.jpg\",\"width\":150,\"height\":150,\"caption\":\"java-interview-questions-answers\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2011\\\/10\\\/new-java-caching-standard-javaxcache.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Java\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/category\\\/java\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Enterprise Java\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/category\\\/java\\\/enterprise-java\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"The new Java Caching Standard (javax.cache)\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#website\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\",\"name\":\"Java Code Geeks\",\"description\":\"Java Developers Resource Center\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\"},\"alternateName\":\"JCG\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.javacodegeeks.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\",\"name\":\"Exelixis Media P.C.\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/exelixis-logo.png\",\"contentUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/exelixis-logo.png\",\"width\":864,\"height\":246,\"caption\":\"Exelixis Media P.C.\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/javacodegeeks\",\"https:\\\/\\\/x.com\\\/javacodegeeks\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/person\\\/cb20aa33bd4fc2102eb5b879f393d0f4\",\"name\":\"Greg Luck\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/d69f4d78718bcc777b44defb098515560f09f30dcde68e3f3e3f9d93e96439d0?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/d69f4d78718bcc777b44defb098515560f09f30dcde68e3f3e3f9d93e96439d0?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/d69f4d78718bcc777b44defb098515560f09f30dcde68e3f3e3f9d93e96439d0?s=96&d=mm&r=g\",\"caption\":\"Greg Luck\"},\"sameAs\":[\"http:\\\/\\\/gregluck.com\\\/\"],\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/author\\\/Greg-Luck\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"The new Java Caching Standard (javax.cache) - Java Code Geeks","description":"This post explores the new Java caching standard: javax.cache. How it Fits into the Java Ecosystem This standard is being developed by JSR107, of which","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.javacodegeeks.com\/2011\/10\/new-java-caching-standard-javaxcache.html","og_locale":"en_US","og_type":"article","og_title":"The new Java Caching Standard (javax.cache) - Java Code Geeks","og_description":"This post explores the new Java caching standard: javax.cache. How it Fits into the Java Ecosystem This standard is being developed by JSR107, of which","og_url":"https:\/\/www.javacodegeeks.com\/2011\/10\/new-java-caching-standard-javaxcache.html","og_site_name":"Java Code Geeks","article_publisher":"https:\/\/www.facebook.com\/javacodegeeks","article_published_time":"2011-10-28T09:15:00+00:00","article_modified_time":"2012-10-21T20:23:01+00:00","og_image":[{"width":150,"height":150,"url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/enterprise-java-logo.jpg","type":"image\/jpeg"}],"author":"Greg Luck","twitter_card":"summary_large_image","twitter_creator":"@javacodegeeks","twitter_site":"@javacodegeeks","twitter_misc":{"Written by":"Greg Luck","Est. reading time":"7 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.javacodegeeks.com\/2011\/10\/new-java-caching-standard-javaxcache.html#article","isPartOf":{"@id":"https:\/\/www.javacodegeeks.com\/2011\/10\/new-java-caching-standard-javaxcache.html"},"author":{"name":"Greg Luck","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/person\/cb20aa33bd4fc2102eb5b879f393d0f4"},"headline":"The new Java Caching Standard (javax.cache)","datePublished":"2011-10-28T09:15:00+00:00","dateModified":"2012-10-21T20:23:01+00:00","mainEntityOfPage":{"@id":"https:\/\/www.javacodegeeks.com\/2011\/10\/new-java-caching-standard-javaxcache.html"},"wordCount":1263,"commentCount":0,"publisher":{"@id":"https:\/\/www.javacodegeeks.com\/#organization"},"image":{"@id":"https:\/\/www.javacodegeeks.com\/2011\/10\/new-java-caching-standard-javaxcache.html#primaryimage"},"thumbnailUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/enterprise-java-logo.jpg","keywords":["Cache"],"articleSection":["Enterprise Java"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.javacodegeeks.com\/2011\/10\/new-java-caching-standard-javaxcache.html#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.javacodegeeks.com\/2011\/10\/new-java-caching-standard-javaxcache.html","url":"https:\/\/www.javacodegeeks.com\/2011\/10\/new-java-caching-standard-javaxcache.html","name":"The new Java Caching Standard (javax.cache) - Java Code Geeks","isPartOf":{"@id":"https:\/\/www.javacodegeeks.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.javacodegeeks.com\/2011\/10\/new-java-caching-standard-javaxcache.html#primaryimage"},"image":{"@id":"https:\/\/www.javacodegeeks.com\/2011\/10\/new-java-caching-standard-javaxcache.html#primaryimage"},"thumbnailUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/enterprise-java-logo.jpg","datePublished":"2011-10-28T09:15:00+00:00","dateModified":"2012-10-21T20:23:01+00:00","description":"This post explores the new Java caching standard: javax.cache. How it Fits into the Java Ecosystem This standard is being developed by JSR107, of which","breadcrumb":{"@id":"https:\/\/www.javacodegeeks.com\/2011\/10\/new-java-caching-standard-javaxcache.html#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.javacodegeeks.com\/2011\/10\/new-java-caching-standard-javaxcache.html"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.javacodegeeks.com\/2011\/10\/new-java-caching-standard-javaxcache.html#primaryimage","url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/enterprise-java-logo.jpg","contentUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/enterprise-java-logo.jpg","width":150,"height":150,"caption":"java-interview-questions-answers"},{"@type":"BreadcrumbList","@id":"https:\/\/www.javacodegeeks.com\/2011\/10\/new-java-caching-standard-javaxcache.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.javacodegeeks.com\/"},{"@type":"ListItem","position":2,"name":"Java","item":"https:\/\/www.javacodegeeks.com\/category\/java"},{"@type":"ListItem","position":3,"name":"Enterprise Java","item":"https:\/\/www.javacodegeeks.com\/category\/java\/enterprise-java"},{"@type":"ListItem","position":4,"name":"The new Java Caching Standard (javax.cache)"}]},{"@type":"WebSite","@id":"https:\/\/www.javacodegeeks.com\/#website","url":"https:\/\/www.javacodegeeks.com\/","name":"Java Code Geeks","description":"Java Developers Resource Center","publisher":{"@id":"https:\/\/www.javacodegeeks.com\/#organization"},"alternateName":"JCG","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.javacodegeeks.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.javacodegeeks.com\/#organization","name":"Exelixis Media P.C.","url":"https:\/\/www.javacodegeeks.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","contentUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","width":864,"height":246,"caption":"Exelixis Media P.C."},"image":{"@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/javacodegeeks","https:\/\/x.com\/javacodegeeks"]},{"@type":"Person","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/person\/cb20aa33bd4fc2102eb5b879f393d0f4","name":"Greg Luck","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/d69f4d78718bcc777b44defb098515560f09f30dcde68e3f3e3f9d93e96439d0?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/d69f4d78718bcc777b44defb098515560f09f30dcde68e3f3e3f9d93e96439d0?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/d69f4d78718bcc777b44defb098515560f09f30dcde68e3f3e3f9d93e96439d0?s=96&d=mm&r=g","caption":"Greg Luck"},"sameAs":["http:\/\/gregluck.com\/"],"url":"https:\/\/www.javacodegeeks.com\/author\/Greg-Luck"}]}},"_links":{"self":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/597","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/users\/106"}],"replies":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/comments?post=597"}],"version-history":[{"count":0,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/597\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/media\/112"}],"wp:attachment":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/media?parent=597"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/categories?post=597"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/tags?post=597"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}