javax.cache.annotation
Interface CacheKeyInvocationContext<A extends Annotation>
- Type Parameters:
A
- The type of annotation this context information is for. One of CacheResult
,
CachePut
, CacheRemoveEntry
, or
CacheRemoveAll
.
- All Superinterfaces:
- CacheInvocationContext<A>, CacheMethodDetails<A>
public interface CacheKeyInvocationContext<A extends Annotation>
- extends CacheInvocationContext<A>
Runtime information about an intercepted method invocation for a method annotated
with CacheResult
, CachePut
, or CacheRemoveEntry
.
Used with CacheKeyGenerator.generateCacheKey(CacheKeyInvocationContext)
to generate a
CacheKey
for the invocation.
- Version:
- $Revision$
- Author:
- Eric Dalquist
- See Also:
CacheKeyGenerator
getKeyParameters
CacheInvocationParameter[] getKeyParameters()
- Returns a clone of the array of all method parameters to be used by the
CacheKeyGenerator
in creating
a CacheKey
. The returned array may be the same as or a subset of the array returned by
CacheInvocationContext.getAllParameters()
Parameters in this array are selected by the following rules:
- Returns:
- An array of all parameters to be used in cache key generation
getValueParameter
CacheInvocationParameter getValueParameter()
- When a method is annotated with
CachePut
one parameter is the value to be cached.
The cached value is selected by the following rules:
- If a
CacheValue
annotation exists the parameter with the annotation is the cached value
- If no
CacheValue
annotation exists and there is only one parameter it is the cached value
- If no
CacheValue
annotation exists and there is more than one parameter an undefined exception will be thrown by the implementation
- Returns:
- The parameter to cache, will never be null for methods annotated with
CachePut
, will be null for methods not annotated with CachePut
Copyright © 2011. All Rights Reserved.