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

Method Summary
 CacheInvocationParameter[] getKeyParameters()
          Returns a clone of the array of all method parameters to be used by the CacheKeyGenerator in creating a CacheKey.
 CacheInvocationParameter getValueParameter()
          When a method is annotated with CachePut one parameter is the value to be cached.
 
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 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 value to be cached is selected using the following rules:

Returns:
The parameter to cache, will never be null for methods annotated with CachePut, will be null for methods not annotated with CachePut
Throws:
CacheException - thrown if the cache value cannot be determind because there is no CacheValue annotation exists and there is more than one parameter


Copyright © 2011. All Rights Reserved.