Package javax.cache.annotation
Interface CacheInvocationContext<A extends Annotation>
-
- Type Parameters:
A
- The type of annotation this context information is for. One ofCacheResult
,CachePut
,CacheRemove
, orCacheRemoveAll
.
- All Superinterfaces:
CacheMethodDetails<A>
- All Known Subinterfaces:
CacheKeyInvocationContext<A>
public interface CacheInvocationContext<A extends Annotation> extends CacheMethodDetails<A>
Runtime information about an intercepted method invocation for a method annotated withCacheResult
,CachePut
,CacheRemove
, orCacheRemoveAll
Used with
CacheResolver.resolveCache(CacheInvocationContext)
to determine theCache
to use at runtime for the method invocation.- Author:
- Eric Dalquist
- See Also:
CacheResolver
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description CacheInvocationParameter[]
getAllParameters()
Returns a clone of the array of all method parameters.Object
getTarget()
<T> T
unwrap(Class<T> cls)
Return an object of the specified type to allow access to the provider-specific API.-
Methods inherited from interface javax.cache.annotation.CacheMethodDetails
getAnnotations, getCacheAnnotation, getCacheName, getMethod
-
-
-
-
Method Detail
-
getTarget
Object getTarget()
- Returns:
- The object the intercepted method was invoked on.
-
getAllParameters
CacheInvocationParameter[] getAllParameters()
Returns a clone of the array of all method parameters.- Returns:
- An array of all parameters for the annotated method
-
unwrap
<T> T unwrap(Class<T> cls)
Return an object of the specified type to allow access to the provider-specific API. If the provider's implementation does not support the specified class, theIllegalArgumentException
is thrown.- Type Parameters:
T
- The type of the expected underlyingCache
implementation.- Parameters:
cls
- the class of the object to be returned. This is normally either the underlying implementation class or an interface that it implements.- Returns:
- an instance of the specified class
- Throws:
IllegalArgumentException
- if the provider doesn't support the specified class.
-
-