Interface CacheKeyInvocationContext<A extends Annotation>
- Type Parameters:
A- The type of annotation this context information is for. One ofCacheResult,CachePut, orCacheRemove.
- All Superinterfaces:
CacheInvocationContext<A>, CacheMethodDetails<A>
Runtime information about an intercepted method invocation for a method
annotated with
CacheResult, CachePut, or
CacheRemove.
Used with CacheKeyGenerator.generateCacheKey(CacheKeyInvocationContext)
to generate a GeneratedCacheKey for the invocation.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionReturns a clone of the array of all method parameters to be used by theCacheKeyGeneratorin creating aGeneratedCacheKey.When a method is annotated withCachePutthis is the parameter annotated withCacheValueMethods inherited from interface CacheInvocationContext
getAllParameters, getTarget, unwrapMethods inherited from interface CacheMethodDetails
getAnnotations, getCacheAnnotation, getCacheName, getMethod
-
Method Details
-
getKeyParameters
CacheInvocationParameter[] getKeyParameters()Returns a clone of the array of all method parameters to be used by theCacheKeyGeneratorin creating aGeneratedCacheKey. The returned array may be the same as or a subset of the array returned byCacheInvocationContext.getAllParameters()Parameters in this array are selected by the following rules:
- If no parameters are annotated with
CacheKeyorCacheValuethen all parameters are included - If a
CacheValueannotation exists and noCacheKeythen all parameters except the one annotated withCacheValueare included - If one or more
CacheKeyannotations exist only those parameters with theCacheKeyannotation are included
- Returns:
- An array of all parameters to be used in cache key generation
- If no parameters are annotated with
-
getValueParameter
CacheInvocationParameter getValueParameter()When a method is annotated withCachePutthis is the parameter annotated withCacheValue
-