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

pack-priv abstract Class AbstractJCacheKeyOperation<A extends Annotation>

extends AbstractJCacheOperation<A extends Annotation>
Class Inheritance
Known Direct Subclasses
org.springframework.cache.jcache.interceptor.CachePutOperation, org.springframework.cache.jcache.interceptor.CacheRemoveOperation, org.springframework.cache.jcache.interceptor.CacheResultOperation
Type Parameters
<A>
the annotation type
Imports
java.lang.annotation.Annotation, java.util.ArrayList, .List, javax.cache.annotation.CacheInvocationParameter, .CacheMethodDetails, org.springframework.cache.interceptor.CacheResolver, .KeyGenerator

A base JCacheOperation that operates with a key.
Author
Stephane Nicoll
Since
4.1

Field Summary

Modifier and TypeField and Description
private final KeyGenerator
private final List<AbstractJCacheOperation.CacheParameterDetail>
Inherited from org.springframework.cache.jcache.interceptor.AbstractJCacheOperation:
allParameterDetails

Constructor Summary

AccessConstructor and Description
protected
AbstractJCacheKeyOperation(CacheMethodDetails<A>
the CacheMethodDetails related to the cached method
methodDetails
,
CacheResolver
the cache resolver to resolve regular caches
cacheResolver
,
KeyGenerator
the key generator to compute cache keys
keyGenerator
)

Create a new instance.

Method Summary

Modifier and TypeMethod and Description
public KeyGenerator
getKeyGenerator()

Return the KeyGenerator to use to compute cache keys.

public CacheInvocationParameter[]

Returns:

the CacheInvocationParameter instances for the parameters to be used to compute the key
getKeyParameters
(Object...
the parameters value for a particular invocation
values
)

Return the CacheInvocationParameter for the parameters that are to be used to compute the key.

private static List<AbstractJCacheOperation.CacheParameterDetail>
Inherited from org.springframework.cache.jcache.interceptor.AbstractJCacheOperation:
createExceptionTypeFiltergetAllParametersgetAnnotationsgetCacheAnnotationgetCacheNamegetCacheNamesgetCacheResolvergetExceptionTypeFiltergetMethodgetOperationDescriptiontoString

Field Detail

keyGeneratorback to summary
private final KeyGenerator keyGenerator
keyParameterDetailsback to summary
private final List<AbstractJCacheOperation.CacheParameterDetail> keyParameterDetails

Constructor Detail

AbstractJCacheKeyOperationback to summary
protected AbstractJCacheKeyOperation(CacheMethodDetails<A> methodDetails, CacheResolver cacheResolver, KeyGenerator keyGenerator)

Create a new instance.

Parameters
methodDetails:CacheMethodDetails<A>

the CacheMethodDetails related to the cached method

cacheResolver:CacheResolver

the cache resolver to resolve regular caches

keyGenerator:KeyGenerator

the key generator to compute cache keys

Method Detail

getKeyGeneratorback to summary
public KeyGenerator getKeyGenerator()

Return the KeyGenerator to use to compute cache keys.

getKeyParametersback to summary
public CacheInvocationParameter[] getKeyParameters(Object... values)

Return the CacheInvocationParameter for the parameters that are to be used to compute the key.

Per the spec, if some method parameters are annotated with javax.cache.annotation.CacheKey, only those parameters should be part of the key. If none are annotated, all parameters except the parameter annotated with javax.cache.annotation.CacheValue should be part of the key.

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

Parameters
values:Object[]

the parameters value for a particular invocation

Returns:CacheInvocationParameter[]

the CacheInvocationParameter instances for the parameters to be used to compute the key

initializeKeyParameterDetailsback to summary
private static List<AbstractJCacheOperation.CacheParameterDetail> initializeKeyParameterDetails(List<AbstractJCacheOperation.CacheParameterDetail> allParameters)