blob: 4465ff079c46a57611dcb781f708de5f21eaf7c1 [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<link rel="canonical" href="https://ignite.apache.org/jcache/1.0.0/javadoc/javax/cache/annotation/package-summary.html" />
<!-- Generated by javadoc (version 1.7.0_25) on Fri Mar 28 13:34:25 EST 2014 -->
<meta http-equiv="Content-Type" content="text/html" charset="UTF-8">
<title>javax.cache.annotation (JSR107 API and SPI 1.0.0 API)</title>
<meta name="date" content="2014-03-28">
<link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style">
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-61232409-1', 'auto');
ga('send', 'pageview');
</script></head>
<body>
<script type="text/javascript"><!--
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="javax.cache.annotation (JSR107 API and SPI 1.0.0 API)";
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar_top">
<!-- -->
</a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../overview-summary.html">Overview</a></li>
<li class="navBarCell1Rev">Package</li>
<li>Class</li>
<li><a href="package-use.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../index-all.html">Index</a></li>
<li><a href="../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../javax/cache/package-summary.html">Prev Package</a></li>
<li><a href="../../../javax/cache/configuration/package-summary.html">Next Package</a></li>
</ul>
<ul class="navList">
<li><a href="../../../index.html?javax/cache/annotation/package-summary.html" target="_top">Frames</a></li>
<li><a href="package-summary.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip-navbar_top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<div class="header">
<h1 title="Package" class="title">Package&nbsp;javax.cache.annotation</h1>
<div class="docSummary">
<div class="block">The annotations in this package provide method interceptors for user supplied
classes.</div>
</div>
<p>See:&nbsp;<a href="#package_description">Description</a></p>
</div>
<div class="contentContainer">
<ul class="blockList">
<li class="blockList">
<table class="packageSummary" border="0" cellpadding="3" cellspacing="0" summary="Interface Summary table, listing interfaces, and an explanation">
<caption><span>Interface Summary</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Interface</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><a href="../../../javax/cache/annotation/CacheInvocationContext.html" title="interface in javax.cache.annotation">CacheInvocationContext</a>&lt;A extends <a href="http://download.oracle.com/javase/6/docs/api/java/lang/annotation/Annotation.html?is-external=true" title="class or interface in java.lang.annotation">Annotation</a>&gt;</td>
<td class="colLast">
<div class="block">Runtime information about an intercepted method invocation for a method
annotated with <a href="../../../javax/cache/annotation/CacheResult.html" title="annotation in javax.cache.annotation"><code>CacheResult</code></a>, <a href="../../../javax/cache/annotation/CachePut.html" title="annotation in javax.cache.annotation"><code>CachePut</code></a>, <a href="../../../javax/cache/annotation/CacheRemove.html" title="annotation in javax.cache.annotation"><code>CacheRemove</code></a>,
or <a href="../../../javax/cache/annotation/CacheRemoveAll.html" title="annotation in javax.cache.annotation"><code>CacheRemoveAll</code></a></div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../../javax/cache/annotation/CacheInvocationParameter.html" title="interface in javax.cache.annotation">CacheInvocationParameter</a></td>
<td class="colLast">
<div class="block">A parameter to an intercepted method invocation.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../../javax/cache/annotation/CacheKeyGenerator.html" title="interface in javax.cache.annotation">CacheKeyGenerator</a></td>
<td class="colLast">
<div class="block">Generates a <a href="../../../javax/cache/annotation/GeneratedCacheKey.html" title="interface in javax.cache.annotation"><code>GeneratedCacheKey</code></a> based on
a <a href="../../../javax/cache/annotation/CacheKeyInvocationContext.html" title="interface in javax.cache.annotation"><code>CacheKeyInvocationContext</code></a>.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../../javax/cache/annotation/CacheKeyInvocationContext.html" title="interface in javax.cache.annotation">CacheKeyInvocationContext</a>&lt;A extends <a href="http://download.oracle.com/javase/6/docs/api/java/lang/annotation/Annotation.html?is-external=true" title="class or interface in java.lang.annotation">Annotation</a>&gt;</td>
<td class="colLast">
<div class="block">Runtime information about an intercepted method invocation for a method
annotated with <a href="../../../javax/cache/annotation/CacheResult.html" title="annotation in javax.cache.annotation"><code>CacheResult</code></a>, <a href="../../../javax/cache/annotation/CachePut.html" title="annotation in javax.cache.annotation"><code>CachePut</code></a>, or
<a href="../../../javax/cache/annotation/CacheRemove.html" title="annotation in javax.cache.annotation"><code>CacheRemove</code></a>.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../../javax/cache/annotation/CacheMethodDetails.html" title="interface in javax.cache.annotation">CacheMethodDetails</a>&lt;A extends <a href="http://download.oracle.com/javase/6/docs/api/java/lang/annotation/Annotation.html?is-external=true" title="class or interface in java.lang.annotation">Annotation</a>&gt;</td>
<td class="colLast">
<div class="block">Static information about a method annotated with one of:
<a href="../../../javax/cache/annotation/CacheResult.html" title="annotation in javax.cache.annotation"><code>CacheResult</code></a>, <a href="../../../javax/cache/annotation/CachePut.html" title="annotation in javax.cache.annotation"><code>CachePut</code></a>, <a href="../../../javax/cache/annotation/CacheRemove.html" title="annotation in javax.cache.annotation"><code>CacheRemove</code></a>, or <a href="../../../javax/cache/annotation/CacheRemoveAll.html" title="annotation in javax.cache.annotation"><code>CacheRemoveAll</code></a></div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../../javax/cache/annotation/CacheResolver.html" title="interface in javax.cache.annotation">CacheResolver</a></td>
<td class="colLast">
<div class="block">Determines the <a href="../../../javax/cache/Cache.html" title="interface in javax.cache"><code>Cache</code></a> to use for an intercepted method invocation.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../../javax/cache/annotation/CacheResolverFactory.html" title="interface in javax.cache.annotation">CacheResolverFactory</a></td>
<td class="colLast">
<div class="block">Determines the <a href="../../../javax/cache/annotation/CacheResolver.html" title="interface in javax.cache.annotation"><code>CacheResolver</code></a> to use for an annotated method.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../../javax/cache/annotation/GeneratedCacheKey.html" title="interface in javax.cache.annotation">GeneratedCacheKey</a></td>
<td class="colLast">
<div class="block">A <a href="http://download.oracle.com/javase/6/docs/api/java/io/Serializable.html?is-external=true" title="class or interface in java.io"><code>Serializable</code></a>, immutable, thread-safe object that is used as a key,
automatically generated by a <a href="../../../javax/cache/annotation/CacheKeyGenerator.html" title="interface in javax.cache.annotation"><code>CacheKeyGenerator</code></a>.</div>
</td>
</tr>
</tbody>
</table>
</li>
<li class="blockList">
<table class="packageSummary" border="0" cellpadding="3" cellspacing="0" summary="Annotation Types Summary table, listing annotation types, and an explanation">
<caption><span>Annotation Types Summary</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Annotation Type</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><a href="../../../javax/cache/annotation/CacheDefaults.html" title="annotation in javax.cache.annotation">CacheDefaults</a></td>
<td class="colLast">
<div class="block">Allows the configuration of defaults for <a href="../../../javax/cache/annotation/CacheResult.html" title="annotation in javax.cache.annotation"><code>CacheResult</code></a>, <a href="../../../javax/cache/annotation/CachePut.html" title="annotation in javax.cache.annotation"><code>CachePut</code></a>,
<a href="../../../javax/cache/annotation/CacheRemove.html" title="annotation in javax.cache.annotation"><code>CacheRemove</code></a>, and <a href="../../../javax/cache/annotation/CacheRemoveAll.html" title="annotation in javax.cache.annotation"><code>CacheRemoveAll</code></a> at the class level.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../../javax/cache/annotation/CacheKey.html" title="annotation in javax.cache.annotation">CacheKey</a></td>
<td class="colLast">
<div class="block">Marks a method argument as part of the cache key.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../../javax/cache/annotation/CachePut.html" title="annotation in javax.cache.annotation">CachePut</a></td>
<td class="colLast">
<div class="block">When a method annotated with <a href="../../../javax/cache/annotation/CachePut.html" title="annotation in javax.cache.annotation"><code>CachePut</code></a> is invoked a <a href="../../../javax/cache/annotation/GeneratedCacheKey.html" title="interface in javax.cache.annotation"><code>GeneratedCacheKey</code></a> will be generated and <a href="../../../javax/cache/Cache.html#put(K, V)"><code>Cache.put(Object,
Object)</code></a> will be invoked on the specified cache storing the value marked with
<a href="../../../javax/cache/annotation/CacheValue.html" title="annotation in javax.cache.annotation"><code>CacheValue</code></a>.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../../javax/cache/annotation/CacheRemove.html" title="annotation in javax.cache.annotation">CacheRemove</a></td>
<td class="colLast">
<div class="block">When a method annotated with <a href="../../../javax/cache/annotation/CacheRemove.html" title="annotation in javax.cache.annotation"><code>CacheRemove</code></a> is invoked a <a href="../../../javax/cache/annotation/GeneratedCacheKey.html" title="interface in javax.cache.annotation"><code>GeneratedCacheKey</code></a> will be generated and <a href="../../../javax/cache/Cache.html#remove(K)"><code>Cache.remove(Object)</code></a> will be
invoked on the specified cache.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../../javax/cache/annotation/CacheRemoveAll.html" title="annotation in javax.cache.annotation">CacheRemoveAll</a></td>
<td class="colLast">
<div class="block">When a method annotated with <a href="../../../javax/cache/annotation/CacheRemoveAll.html" title="annotation in javax.cache.annotation"><code>CacheRemoveAll</code></a> is invoked all elements in
the specified cache will be removed via the
<a href="../../../javax/cache/Cache.html#removeAll()"><code>Cache.removeAll()</code></a> method</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../../javax/cache/annotation/CacheResult.html" title="annotation in javax.cache.annotation">CacheResult</a></td>
<td class="colLast">
<div class="block">When a method annotated with <a href="../../../javax/cache/annotation/CacheResult.html" title="annotation in javax.cache.annotation"><code>CacheResult</code></a> is invoked a
<a href="../../../javax/cache/annotation/GeneratedCacheKey.html" title="interface in javax.cache.annotation"><code>GeneratedCacheKey</code></a> will be generated and <a href="../../../javax/cache/Cache.html#get(K)"><code>Cache.get(Object)</code></a> is
called before the annotated method actually executes.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../../javax/cache/annotation/CacheValue.html" title="annotation in javax.cache.annotation">CacheValue</a></td>
<td class="colLast">
<div class="block">Marks the parameter to be cached for a method annotated with <a href="../../../javax/cache/annotation/CachePut.html" title="annotation in javax.cache.annotation"><code>CachePut</code></a>.</div>
</td>
</tr>
</tbody>
</table>
</li>
</ul>
<a name="package_description">
<!-- -->
</a>
<h2 title="Package javax.cache.annotation Description">Package javax.cache.annotation Description</h2>
<div class="block">The annotations in this package provide method interceptors for user supplied
classes.
<p>
In the case of a the <a href="../../../javax/cache/annotation/CacheResult.html" title="annotation in javax.cache.annotation"><code>CacheResult</code></a> annotation,
if the cache can satisfy the request a result is returned by the method from
cache, not from method execution. For the mutative annotations such as
<a href="../../../javax/cache/annotation/CacheResult.html" title="annotation in javax.cache.annotation"><code>CacheResult</code></a> the annotation allows the cached
value to be mutated so that it will be correct the next time
<a href="../../../javax/cache/annotation/CacheResult.html" title="annotation in javax.cache.annotation"><code>CacheResult</code></a> is used.
<p>
Any operations against a cache via an annotation will have the same behaviour
as if the <a href="../../../javax/cache/annotation/CacheResult.html" title="annotation in javax.cache.annotation"><code>CacheResult</code></a> methods were used. So
if the same underlying cache is used for an annotation and a direct API call,
the same data would be returned. Annotations therefore provide an additional
API for interacting with caches.
<p>
To use these annotations you'll need a library or framework that processes
these annotations and intercepts calls to your application objects
to provide the caching behaviour. This would commonly be provided by a
dependency injection framework such as defined by CDI in Java EE.</div>
<dl><dt><span class="strong">Since:</span></dt>
<dd>1.0</dd>
<dt><span class="strong">Author:</span></dt>
<dd>Eric Dalquist, Greg Luck</dd></dl>
</div>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar_bottom">
<!-- -->
</a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../overview-summary.html">Overview</a></li>
<li class="navBarCell1Rev">Package</li>
<li>Class</li>
<li><a href="package-use.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../index-all.html">Index</a></li>
<li><a href="../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../javax/cache/package-summary.html">Prev Package</a></li>
<li><a href="../../../javax/cache/configuration/package-summary.html">Next Package</a></li>
</ul>
<ul class="navList">
<li><a href="../../../index.html?javax/cache/annotation/package-summary.html" target="_top">Frames</a></li>
<li><a href="package-summary.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip-navbar_bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<p class="legalCopy"><small>Copyright &#169; 2014. All Rights Reserved.</small></p>
</body>
</html>