Package javax.cache.annotation
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 theCacheKeyGenerator
in creating aGeneratedCacheKey
.When a method is annotated withCachePut
this is the parameter annotated withCacheValue
Methods inherited from interface javax.cache.annotation.CacheInvocationContext
getAllParameters, getTarget, unwrap
Methods inherited from interface javax.cache.annotation.CacheMethodDetails
getAnnotations, getCacheAnnotation, getCacheName, getMethod
-
Method Details
-
getKeyParameters
CacheInvocationParameter[] getKeyParameters()Returns a clone of the array of all method parameters to be used by theCacheKeyGenerator
in 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
CacheKey
orCacheValue
then all parameters are included - If a
CacheValue
annotation exists and noCacheKey
then all parameters except the one annotated withCacheValue
are included - If one or more
CacheKey
annotations exist only those parameters with theCacheKey
annotation 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 withCachePut
this is the parameter annotated withCacheValue
-