Top Description Methods
javax.cache.annotation

public Interface CacheMethodDetails<A extends java.lang.annotation.Annotation>

Known Direct Subinterfaces
javax.cache.annotation.CacheInvocationContext
Type Parameters
<A>
The type of annotation this context information is for. One of CacheResult, CachePut, CacheRemove, or CacheRemoveAll.
Imports
java.lang.annotation.Annotation, java.lang.reflect.Method, java.util.Set

Static information about a method annotated with one of: CacheResult, CachePut, CacheRemove, or CacheRemoveAll

Used with CacheResolverFactory#getCacheResolver(CacheMethodDetails) to determine the CacheResolver to use with the method.

Author
Eric Dalquist
See Also
CacheResolverFactory

Method Summary

Modifier and TypeMethod and Description
public Set<Annotation>

Returns:

An immutable Set of all Annotations on this method
getAnnotations
()

An immutable Set of all Annotations on this method

public A

Returns:

The caching related annotation on the method.
getCacheAnnotation
()

The caching related annotation on the method.

public String

Returns:

The fully resolved cache name
getCacheName
()

The cache name resolved by the implementation.

public Method

Returns:

The annotated method
getMethod
()

The annotated method

Method Detail

getAnnotationsback to summary
public Set<Annotation> getAnnotations()

An immutable Set of all Annotations on this method

Returns:Set<Annotation>

An immutable Set of all Annotations on this method

getCacheAnnotationback to summary
public A getCacheAnnotation()

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

Returns:A

The caching related annotation on the method.

getCacheNameback to summary
public String 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

getMethodback to summary
public Method getMethod()

The annotated method

Returns:Method

The annotated method