blob: 826c602dd5d9f3c0780000a95f43eb61ba0a0454 [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/CacheDefaults.html" />
<!-- Generated by javadoc (version 1.7.0_25) on Fri Mar 28 13:34:24 EST 2014 -->
<meta http-equiv="Content-Type" content="text/html" charset="UTF-8">
<title>CacheDefaults (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="CacheDefaults (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><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/CacheDefaults.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>Prev Class</li>
<li><a href="../../../javax/cache/annotation/CacheInvocationContext.html" title="interface in javax.cache.annotation"><span class="strong">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../index.html?javax/cache/annotation/CacheDefaults.html" target="_top">Frames</a></li>
<li><a href="CacheDefaults.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>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Required&nbsp;|&nbsp;</li>
<li><a href="#annotation_type_optional_element_summary">Optional</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li><a href="#annotation_type_element_detail">Element</a></li>
</ul>
</div>
<a name="skip-navbar_top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="subTitle">javax.cache.annotation</div>
<h2 title="Annotation Type CacheDefaults" class="title">Annotation Type CacheDefaults</h2>
</div>
<div class="contentContainer">
<div class="description">
<ul class="blockList">
<li class="blockList">
<hr>
<br>
<pre><a href="http://download.oracle.com/javase/6/docs/api/java/lang/annotation/Target.html?is-external=true" title="class or interface in java.lang.annotation">@Target</a>(<a href="http://download.oracle.com/javase/6/docs/api/java/lang/annotation/Target.html?is-external=true#value()" title="class or interface in java.lang.annotation">value</a>=<a href="http://download.oracle.com/javase/6/docs/api/java/lang/annotation/ElementType.html?is-external=true#TYPE" title="class or interface in java.lang.annotation">TYPE</a>)
<a href="http://download.oracle.com/javase/6/docs/api/java/lang/annotation/Retention.html?is-external=true" title="class or interface in java.lang.annotation">@Retention</a>(<a href="http://download.oracle.com/javase/6/docs/api/java/lang/annotation/Retention.html?is-external=true#value()" title="class or interface in java.lang.annotation">value</a>=<a href="http://download.oracle.com/javase/6/docs/api/java/lang/annotation/RetentionPolicy.html?is-external=true#RUNTIME" title="class or interface in java.lang.annotation">RUNTIME</a>)
public @interface <span class="strong">CacheDefaults</span></pre>
<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. Without
the method level annotations this annotation has no effect.
<p>
Following is an example of specifying a default cache name that is used by
the annotations on the getDomain and deleteDomain methods. The annotation for
getAllDomains would use the "allDomains" cache name specified in the method
level annotation.
<pre><code>
package my.app;
&#64;CacheDefaults(cacheName="domainCache")
public class DomainDao {
&#64;CacheResult
public Domain getDomain(String domainId, int index) {
...
}
&#64;CacheRemove
public void deleteDomain(String domainId, int index) {
...
}
&#64;CacheResult(cacheName="allDomains")
public List&lt;Domain&gt; getAllDomains() {
...
}
}
</code></pre></div>
<dl><dt><span class="strong">Since:</span></dt>
<dd>1.0</dd>
<dt><span class="strong">Author:</span></dt>
<dd>Rick Hightower</dd></dl>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- =========== ANNOTATION TYPE OPTIONAL MEMBER SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="annotation_type_optional_element_summary">
<!-- -->
</a>
<h3>Optional Element Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Optional Element Summary table, listing optional elements, and an explanation">
<caption><span>Optional Elements</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Optional Element and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="http://download.oracle.com/javase/6/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</a>&lt;? extends <a href="../../../javax/cache/annotation/CacheKeyGenerator.html" title="interface in javax.cache.annotation">CacheKeyGenerator</a>&gt;</code></td>
<td class="colLast"><code><strong><a href="../../../javax/cache/annotation/CacheDefaults.html#cacheKeyGenerator()">cacheKeyGenerator</a></strong></code>
<div class="block">The <a href="../../../javax/cache/annotation/CacheKeyGenerator.html" title="interface in javax.cache.annotation"><code>CacheKeyGenerator</code></a> to use to generate the
<a href="../../../javax/cache/annotation/GeneratedCacheKey.html" title="interface in javax.cache.annotation"><code>GeneratedCacheKey</code></a> for interacting with the specified Cache.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td>
<td class="colLast"><code><strong><a href="../../../javax/cache/annotation/CacheDefaults.html#cacheName()">cacheName</a></strong></code>
<div class="block">The default name of the cache for the annotated class</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="http://download.oracle.com/javase/6/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</a>&lt;? extends <a href="../../../javax/cache/annotation/CacheResolverFactory.html" title="interface in javax.cache.annotation">CacheResolverFactory</a>&gt;</code></td>
<td class="colLast"><code><strong><a href="../../../javax/cache/annotation/CacheDefaults.html#cacheResolverFactory()">cacheResolverFactory</a></strong></code>
<div class="block">The <a href="../../../javax/cache/annotation/CacheResolverFactory.html" title="interface in javax.cache.annotation"><code>CacheResolverFactory</code></a> used to find the <a href="../../../javax/cache/annotation/CacheResolver.html" title="interface in javax.cache.annotation"><code>CacheResolver</code></a> to
use at runtime.</div>
</td>
</tr>
</table>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ============ ANNOTATION TYPE MEMBER DETAIL =========== -->
<ul class="blockList">
<li class="blockList"><a name="annotation_type_element_detail">
<!-- -->
</a>
<h3>Element Detail</h3>
<a name="cacheName()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>cacheName</h4>
<pre>public abstract&nbsp;<a href="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;cacheName</pre>
<div class="block">The default name of the cache for the annotated class
<p>
If not specified defaults to:
package.name.ClassName.methodName(package.ParameterType,package.ParameterType)
<p>
Applicable 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></div>
<dl>
<dt>Default:</dt>
<dd>""</dd>
</dl>
</li>
</ul>
<a name="cacheResolverFactory()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>cacheResolverFactory</h4>
<pre>public abstract&nbsp;<a href="http://download.oracle.com/javase/6/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</a>&lt;? extends <a href="../../../javax/cache/annotation/CacheResolverFactory.html" title="interface in javax.cache.annotation">CacheResolverFactory</a>&gt;&nbsp;cacheResolverFactory</pre>
<div class="block">The <a href="../../../javax/cache/annotation/CacheResolverFactory.html" title="interface in javax.cache.annotation"><code>CacheResolverFactory</code></a> used to find the <a href="../../../javax/cache/annotation/CacheResolver.html" title="interface in javax.cache.annotation"><code>CacheResolver</code></a> to
use at runtime.
<p>
The default resolver pair will resolve the cache by name from the default
<a href="../../../javax/cache/CacheManager.html" title="interface in javax.cache"><code>CacheManager</code></a>
<p>
Applicable 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></div>
<dl>
<dt>Default:</dt>
<dd>javax.cache.annotation.CacheResolverFactory.class</dd>
</dl>
</li>
</ul>
<a name="cacheKeyGenerator()">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>cacheKeyGenerator</h4>
<pre>public abstract&nbsp;<a href="http://download.oracle.com/javase/6/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</a>&lt;? extends <a href="../../../javax/cache/annotation/CacheKeyGenerator.html" title="interface in javax.cache.annotation">CacheKeyGenerator</a>&gt;&nbsp;cacheKeyGenerator</pre>
<div class="block">The <a href="../../../javax/cache/annotation/CacheKeyGenerator.html" title="interface in javax.cache.annotation"><code>CacheKeyGenerator</code></a> to use to generate the
<a href="../../../javax/cache/annotation/GeneratedCacheKey.html" title="interface in javax.cache.annotation"><code>GeneratedCacheKey</code></a> for interacting with the specified Cache.
<p>
Defaults to a key generator that uses <a href="http://download.oracle.com/javase/6/docs/api/java/util/Arrays.html?is-external=true#deepHashCode(java.lang.Object[])" title="class or interface in java.util"><code>Arrays.deepHashCode(Object[])</code></a>
and <a href="http://download.oracle.com/javase/6/docs/api/java/util/Arrays.html?is-external=true#deepEquals(java.lang.Object[], java.lang.Object[])" title="class or interface in java.util"><code>Arrays.deepEquals(Object[], Object[])</code></a> with the array returned by
<a href="../../../javax/cache/annotation/CacheKeyInvocationContext.html#getKeyParameters()"><code>CacheKeyInvocationContext.getKeyParameters()</code></a>
<p>
Applicable 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>, and <a href="../../../javax/cache/annotation/CacheRemove.html" title="annotation in javax.cache.annotation"><code>CacheRemove</code></a></div>
<dl><dt><span class="strong">See Also:</span></dt><dd><a href="../../../javax/cache/annotation/CacheKey.html" title="annotation in javax.cache.annotation"><code>CacheKey</code></a></dd></dl>
<dl>
<dt>Default:</dt>
<dd>javax.cache.annotation.CacheKeyGenerator.class</dd>
</dl>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= -->
<!-- ======= 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><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/CacheDefaults.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>Prev Class</li>
<li><a href="../../../javax/cache/annotation/CacheInvocationContext.html" title="interface in javax.cache.annotation"><span class="strong">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../index.html?javax/cache/annotation/CacheDefaults.html" target="_top">Frames</a></li>
<li><a href="CacheDefaults.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>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Required&nbsp;|&nbsp;</li>
<li><a href="#annotation_type_optional_element_summary">Optional</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li><a href="#annotation_type_element_detail">Element</a></li>
</ul>
</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>