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 aGeneratedCacheKeyfor 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 theCacheKeyGeneratorin creating aGeneratedCacheKey.CacheInvocationParametergetValueParameter()When a method is annotated withCachePutthis 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 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
-
-