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

pack-priv abstract Class AbstractJCacheOperation<A extends Annotation>

extends Object
implements JCacheOperation<A extends Annotation>
Class Inheritance
All Implemented Interfaces
org.springframework.cache.jcache.interceptor.JCacheOperation, javax.cache.annotation.CacheMethodDetails, org.springframework.cache.interceptor.BasicOperation
Known Direct Subclasses
org.springframework.cache.jcache.interceptor.CacheRemoveAllOperation, org.springframework.cache.jcache.interceptor.AbstractJCacheKeyOperation
Type Parameters
<A>
the annotation type
Imports
java.lang.annotation.Annotation, java.lang.reflect.Method, java.util.ArrayList, .Arrays, .Collections, .LinkedHashSet, .List, .Set, javax.cache.annotation.CacheInvocationParameter, .CacheKey, .CacheMethodDetails, .CacheValue, org.springframework.cache.interceptor.CacheResolver, org.springframework.util.Assert, .ExceptionTypeFilter

A base JCacheOperation implementation.
Author
Stephane Nicoll
Since
4.1

Nested and Inner Type Summary

Modifier and TypeClass and Description
protected static class
AbstractJCacheOperation.CacheInvocationParameterImpl

A single cache invocation parameter.

protected static class
AbstractJCacheOperation.CacheParameterDetail

Details for a single cache parameter.

Field Summary

Modifier and TypeField and Description
protected final List<AbstractJCacheOperation.CacheParameterDetail>
private final CacheResolver
private final CacheMethodDetails<A>

Constructor Summary

AccessConstructor and Description
protected
AbstractJCacheOperation(CacheMethodDetails<A>
the CacheMethodDetails related to the cached method
methodDetails
,
CacheResolver
the cache resolver to resolve regular caches
cacheResolver
)

Construct a new AbstractJCacheOperation.

Method Summary

Modifier and TypeMethod and Description
protected ExceptionTypeFilter
createExceptionTypeFilter(Class<? extends Throwable>[] includes, Class<? extends Throwable>[] excludes)

Convenience method for subclasses to create a specific ExceptionTypeFilter.

public CacheInvocationParameter[]
getAllParameters(Object...
the parameters value for a particular invocation
values
)

Implements org.springframework.cache.jcache.interceptor.JCacheOperation.getAllParameters.

Return the CacheInvocationParameter instances based on the specified method arguments.

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 Set<String>
getCacheNames()

Implements org.springframework.cache.interceptor.BasicOperation.getCacheNames.

Return the cache name(s) associated with the operation.

public CacheResolver
getCacheResolver()

Implements org.springframework.cache.jcache.interceptor.JCacheOperation.getCacheResolver.

Return the CacheResolver instance to use to resolve the cache to use for this operation.

public abstract ExceptionTypeFilter
getExceptionTypeFilter()

Return the ExceptionTypeFilter to use to filter exceptions thrown while invoking the method.

public Method
protected StringBuilder
getOperationDescription()

Return an identifying description for this caching operation.

private static List<AbstractJCacheOperation.CacheParameterDetail>
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

allParameterDetailsback to summary
protected final List<AbstractJCacheOperation.CacheParameterDetail> allParameterDetails
cacheResolverback to summary
private final CacheResolver cacheResolver
methodDetailsback to summary
private final CacheMethodDetails<A> methodDetails

Constructor Detail

AbstractJCacheOperationback to summary
protected AbstractJCacheOperation(CacheMethodDetails<A> methodDetails, CacheResolver cacheResolver)

Construct a new AbstractJCacheOperation.

Parameters
methodDetails:CacheMethodDetails<A>

the CacheMethodDetails related to the cached method

cacheResolver:CacheResolver

the cache resolver to resolve regular caches

Method Detail

createExceptionTypeFilterback to summary
protected ExceptionTypeFilter createExceptionTypeFilter(Class<? extends Throwable>[] includes, Class<? extends Throwable>[] excludes)

Convenience method for subclasses to create a specific ExceptionTypeFilter.

See Also
getExceptionTypeFilter()
getAllParametersback to summary
public CacheInvocationParameter[] getAllParameters(Object... values)

Implements org.springframework.cache.jcache.interceptor.JCacheOperation.getAllParameters.

Doc from org.springframework.cache.jcache.interceptor.JCacheOperation.getAllParameters.

Return the CacheInvocationParameter instances based on the specified method arguments.

The method arguments must match the signature of the related method invocation

Parameters
values:Object[]

the parameters value for a particular invocation

Annotations
@Override
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
getCacheNamesback to summary
public Set<String> getCacheNames()

Implements org.springframework.cache.interceptor.BasicOperation.getCacheNames.

Doc from org.springframework.cache.interceptor.BasicOperation.getCacheNames.

Return the cache name(s) associated with the operation.

Annotations
@Override
getCacheResolverback to summary
public CacheResolver getCacheResolver()

Implements org.springframework.cache.jcache.interceptor.JCacheOperation.getCacheResolver.

Doc from org.springframework.cache.jcache.interceptor.JCacheOperation.getCacheResolver.

Return the CacheResolver instance to use to resolve the cache to use for this operation.

Annotations
@Override
getExceptionTypeFilterback to summary
public abstract ExceptionTypeFilter getExceptionTypeFilter()

Return the ExceptionTypeFilter to use to filter exceptions thrown while invoking the method.

See Also
createExceptionTypeFilter
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
getOperationDescriptionback to summary
protected StringBuilder getOperationDescription()

Return an identifying description for this caching operation.

Available to subclasses, for inclusion in their toString() result.

initializeAllParameterDetailsback to summary
private static List<AbstractJCacheOperation.CacheParameterDetail> initializeAllParameterDetails(Method method)
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
org.springframework.cache.jcache.interceptor back to summary

protected Class AbstractJCacheOperation.CacheInvocationParameterImpl

extends Object
implements CacheInvocationParameter
Class Inheritance
  • java.lang.Object
  • org.springframework.cache.jcache.interceptor.AbstractJCacheOperation.CacheInvocationParameterImpl
All Implemented Interfaces
javax.cache.annotation.CacheInvocationParameter

A single cache invocation parameter.

Field Summary

Modifier and TypeField and Description
private final AbstractJCacheOperation.CacheParameterDetail
private final Object

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public Set<Annotation>
public int
getParameterPosition()

Implements javax.cache.annotation.CacheInvocationParameter.getParameterPosition.

The index of the parameter in the original parameter array as returned by CacheInvocationContext#getAllParameters()

public Class<?>
getRawType()

Implements javax.cache.annotation.CacheInvocationParameter.getRawType.

The parameter type as declared on the method.

public Object
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

detailback to summary
private final AbstractJCacheOperation.CacheParameterDetail detail
valueback to summary
private final Object value

Constructor Detail

CacheInvocationParameterImplback to summary
public CacheInvocationParameterImpl(AbstractJCacheOperation.CacheParameterDetail detail, Object value)

Method Detail

getAnnotationsback to summary
public Set<Annotation> getAnnotations()

Implements javax.cache.annotation.CacheInvocationParameter.getAnnotations.

Returns:Set<Annotation>

Doc from javax.cache.annotation.CacheInvocationParameter.getAnnotations.

An immutable Set of all Annotations on this method parameter, never null.

Annotations
@Override
getParameterPositionback to summary
public int getParameterPosition()

Implements javax.cache.annotation.CacheInvocationParameter.getParameterPosition.

Doc from javax.cache.annotation.CacheInvocationParameter.getParameterPosition.

The index of the parameter in the original parameter array as returned by CacheInvocationContext#getAllParameters()

Returns:int

The index of the parameter in the original parameter array.

Annotations
@Override
getRawTypeback to summary
public Class<?> getRawType()

Implements javax.cache.annotation.CacheInvocationParameter.getRawType.

Doc from javax.cache.annotation.CacheInvocationParameter.getRawType.

The parameter type as declared on the method.

Annotations
@Override
getValueback to summary
public Object getValue()

Implements javax.cache.annotation.CacheInvocationParameter.getValue.

Returns:Object

Doc from javax.cache.annotation.CacheInvocationParameter.getValue.

The parameter value

Annotations
@Override
org.springframework.cache.jcache.interceptor back to summary

protected Class AbstractJCacheOperation.CacheParameterDetail

extends Object
Class Inheritance
  • java.lang.Object
  • org.springframework.cache.jcache.interceptor.AbstractJCacheOperation.CacheParameterDetail

Details for a single cache parameter.

Field Summary

Modifier and TypeField and Description
private final Set<Annotation>
private final boolean
private final boolean
private final int
private final Class<?>

Constructor Summary

AccessConstructor and Description
public
CacheParameterDetail(Method method, int parameterPosition)

Method Summary

Modifier and TypeMethod and Description
public int
protected boolean
protected boolean
public CacheInvocationParameter
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

annotationsback to summary
private final Set<Annotation> annotations
isKeyback to summary
private final boolean isKey
isValueback to summary
private final boolean isValue
parameterPositionback to summary
private final int parameterPosition
rawTypeback to summary
private final Class<?> rawType

Constructor Detail

CacheParameterDetailback to summary
public CacheParameterDetail(Method method, int parameterPosition)

Method Detail

getParameterPositionback to summary
public int getParameterPosition()
isKeyback to summary
protected boolean isKey()
isValueback to summary
protected boolean isValue()
toCacheInvocationParameterback to summary
public CacheInvocationParameter toCacheInvocationParameter(Object value)