Top Description Fields Constructors Methods
org.springframework.cache.jcache.interceptor

pack-priv Class DefaultCacheMethodDetails<A extends Annotation>

extends Object
implements CacheMethodDetails<A extends Annotation>
Class Inheritance
All Implemented Interfaces
javax.cache.annotation.CacheMethodDetails
Type Parameters
<A>
the annotation type
Imports
java.lang.annotation.Annotation, java.lang.reflect.Method, java.util.Arrays, .Collections, .LinkedHashSet, .Set, javax.cache.annotation.CacheMethodDetails

The default CacheMethodDetails implementation.
Author
Stephane Nicoll
Since
4.1

Field Summary

Modifier and TypeField and Description
private final Set<Annotation>
private final A
private final String
private final Method

Constructor Summary

AccessConstructor and Description
public
DefaultCacheMethodDetails(Method method, A cacheAnnotation, String cacheName)

Method Summary

Modifier and TypeMethod and Description
public Set<Annotation>
getAnnotations()

Implements javax.cache.annotation.CacheMethodDetails.getAnnotations.

An immutable Set of all Annotations on this method

public A
getCacheAnnotation()

Implements javax.cache.annotation.CacheMethodDetails.getCacheAnnotation.

The caching related annotation on the method.

public String
getCacheName()

Implements javax.cache.annotation.CacheMethodDetails.getCacheName.

The cache name resolved by the implementation.

public Method
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

annotationsback to summary
private final Set<Annotation> annotations
cacheAnnotationback to summary
private final A cacheAnnotation
cacheNameback to summary
private final String cacheName
methodback to summary
private final Method method

Constructor Detail

DefaultCacheMethodDetailsback to summary
public DefaultCacheMethodDetails(Method method, A cacheAnnotation, String cacheName)

Method Detail

getAnnotationsback to summary
public Set<Annotation> getAnnotations()

Implements javax.cache.annotation.CacheMethodDetails.getAnnotations.

Doc from javax.cache.annotation.CacheMethodDetails.getAnnotations.

An immutable Set of all Annotations on this method

Returns:Set<Annotation>

An immutable Set of all Annotations on this method

Annotations
@Override
getCacheAnnotationback to summary
public A getCacheAnnotation()

Implements javax.cache.annotation.CacheMethodDetails.getCacheAnnotation.

Doc from javax.cache.annotation.CacheMethodDetails.getCacheAnnotation.

The caching related annotation on the method. One of: CacheResult, CachePut, CacheRemove, or CacheRemoveAll

Returns:A

The caching related annotation on the method.

Annotations
@Override
getCacheNameback to summary
public String getCacheName()

Implements javax.cache.annotation.CacheMethodDetails.getCacheName.

Doc from javax.cache.annotation.CacheMethodDetails.getCacheName.

The cache name resolved by the implementation.

The cache name is determined by first looking at the cacheName attribute of the method level annotation. If that attribute is not set then the class level CacheDefaults annotation is checked. If that annotation does not exist or does not have its cacheName attribute set then the following cache name generation rules are followed:

"fully qualified class name"."method name"("fully qualified parameter class names")

For example:


package my.app;

public class DomainDao {
  @CacheResult
  public Domain getDomain(String domainId, int index) {
    ...
  }
}

Results in the cache name: "my.app.DomainDao.getDomain(java.lang.String,int)"

Returns:String

The fully resolved cache name

Annotations
@Override
getMethodback to summary
public Method getMethod()

Implements javax.cache.annotation.CacheMethodDetails.getMethod.

Doc from javax.cache.annotation.CacheMethodDetails.getMethod.

The annotated method

Returns:Method

The annotated method

Annotations
@Override
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Returns:String

a string representation of the object

Annotations
@Override