Package javax.cache.annotation
Interface CacheKeyInvocationContext<A extends java.lang.annotation.Annotation>
-
- Type Parameters:
A
- The type of annotation this context information is for. One ofCacheResult
,CachePut
, orCacheRemove
.
- All Superinterfaces:
CacheInvocationContext<A>
,CacheMethodDetails<A>
public interface CacheKeyInvocationContext<A extends java.lang.annotation.Annotation> extends CacheInvocationContext<A>
Runtime information about an intercepted method invocation for a method annotated withCacheResult
,CachePut
, orCacheRemove
.Used withÂ
CacheKeyGenerator.generateCacheKey(CacheKeyInvocationContext)
to generate aGeneratedCacheKey
for the invocation.- See Also:
CacheKeyGenerator
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description CacheInvocationParameter[]
getKeyParameters()
Returns a clone of the array of all method parameters to be used by theCacheKeyGenerator
in creating aGeneratedCacheKey
.CacheInvocationParameter
getValueParameter()
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 Detail
-
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
-
-