public class CacheInvocationContext<A extends java.lang.annotation.Annotation>
extends java.lang.Object
CacheResult,
CacheRemove annotations.| Constructor and Description |
|---|
CacheInvocationContext(A cacheAnnotation,
MethodExecutionAction cacheKeyMethod,
java.lang.Object target,
java.lang.reflect.Method method,
java.lang.Object... args)
Constructor to create CacheInvocationContext based on passed parameters.
|
| Modifier and Type | Method and Description |
|---|---|
java.util.List<CacheInvocationParameter> |
getAllParameters()
Gets all method parameters.
|
A |
getCacheAnnotation() |
MethodExecutionAction |
getCacheKeyMethod()
Gets action that invokes cache key method, the result of execution is used as cache key.
|
java.lang.String |
getCacheKeyMethodName()
Gets method name to be used to get a key for request caching.
|
ExecutionType |
getExecutionType()
Gets execution type of cache key action.
|
java.util.List<CacheInvocationParameter> |
getKeyParameters()
Returns a clone of the array of all method parameters annotated with
CacheKey annotation to be used by the
HystrixCacheKeyGenerator in creating a HystrixGeneratedCacheKey. |
java.lang.reflect.Method |
getMethod()
Gets intercepted method that annotated with caching annotation.
|
java.lang.Object |
getTarget()
Gets current instance that can be used to invoke
cacheKeyMethod or for another needs. |
boolean |
hasKeyParameters()
Checks whether any method argument annotated with
CacheKey annotation. |
public CacheInvocationContext(A cacheAnnotation, MethodExecutionAction cacheKeyMethod, java.lang.Object target, java.lang.reflect.Method method, java.lang.Object... args)
cacheAnnotation - the caching annotation, like CacheResultcacheKeyMethod - the method to generate cache keytarget - the current instance of intercepted methodmethod - the method annotated with on of caching annotationsargs - the method argumentspublic java.lang.reflect.Method getMethod()
public java.lang.Object getTarget()
cacheKeyMethod or for another needs.public A getCacheAnnotation()
public java.util.List<CacheInvocationParameter> getAllParameters()
CacheInvocationParameter objectspublic java.util.List<CacheInvocationParameter> getKeyParameters()
CacheKey annotation to be used by the
HystrixCacheKeyGenerator in creating a HystrixGeneratedCacheKey. 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:
CacheInvocationParameter objectspublic boolean hasKeyParameters()
CacheKey annotation.CacheKey annotationpublic java.lang.String getCacheKeyMethodName()
public MethodExecutionAction getCacheKeyMethod()
MethodExecutionAction.public ExecutionType getExecutionType()