Top Description Methods
javax.cache.annotation

public Interface CacheKeyInvocationContext<A extends java.lang.annotation.Annotation>

extends CacheInvocationContext<A extends Annotation>
Type Parameters
<A>
The type of annotation this context information is for. One of CacheResult, CachePut, or CacheRemove.
Imports
java.lang.annotation.Annotation

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.

Author
Eric Dalquist
See Also
CacheKeyGenerator

Method Summary

Modifier and TypeMethod and Description
public CacheInvocationParameter[]

Returns:

An array of all parameters to be used in cache key generation
getKeyParameters
()

Returns a clone of the array of all method parameters to be used by the CacheKeyGenerator in creating a GeneratedCacheKey.

public CacheInvocationParameter

Returns:

The parameter to cache, will never be null for methods annotated with CachePut, will be null for methods not annotated with CachePut
getValueParameter
()

When a method is annotated with CachePut this is the parameter annotated with CacheValue

Inherited from javax.cache.annotation.CacheInvocationContext:
getAllParametersgetTargetunwrap

Method Detail

getKeyParametersback to summary
public CacheInvocationParameter[] getKeyParameters()

Returns a clone of the array of all method parameters to be used by the CacheKeyGenerator in creating a GeneratedCacheKey. The returned array may be the same as or a subset of the array returned by getAllParameters()

Parameters in this array are selected by the following rules:

  • If no parameters are annotated with CacheKey or CacheValue then all parameters are included
  • If a CacheValue annotation exists and no CacheKey then all parameters except the one annotated with CacheValue are included
  • If one or more CacheKey annotations exist only those parameters with the CacheKey annotation are included
Returns:CacheInvocationParameter[]

An array of all parameters to be used in cache key generation

getValueParameterback to summary
public CacheInvocationParameter getValueParameter()

When a method is annotated with CachePut this is the parameter annotated with CacheValue

Returns:CacheInvocationParameter

The parameter to cache, will never be null for methods annotated with CachePut, will be null for methods not annotated with CachePut