I - The intercepted method invocationpublic abstract class AbstractCacheLookupUtil<I> extends Object implements CacheContextSource<I>
CacheResolver and CacheKeyGenerator for a given method.| Constructor and Description |
|---|
AbstractCacheLookupUtil()
Create lookup utility
|
| Modifier and Type | Method and Description |
|---|---|
protected abstract InternalCacheInvocationContext<? extends Annotation> |
createCacheInvocationContextImpl(StaticCacheInvocationContext<? extends Annotation> staticCacheInvocationContext,
I invocation)
Create the cache invocation context for the provided static context and intercepted method invocation
|
protected abstract InternalCacheKeyInvocationContext<? extends Annotation> |
createCacheKeyInvocationContextImpl(StaticCacheKeyInvocationContext<? extends Annotation> staticCacheKeyInvocationContext,
I invocation)
Create the cache key invocation context for the provided static context and intercepted method invocation
|
protected <A extends Annotation> |
createCacheMethodDetails(A cacheAnnotation,
javax.cache.annotation.CacheDefaults cacheDefaultsAnnotation,
String methodCacheName,
Method method,
Class<? extends Object> targetClass)
Create CacheMethodDetails to describe the annotated method
|
protected CachePutMethodDetails |
createCachePutMethodDetails(javax.cache.annotation.CachePut cachePutAnnotation,
javax.cache.annotation.CacheDefaults cacheDefaultsAnnotation,
Method method,
Class<? extends Object> targetClass)
Create a StaticCacheInvocationContext implementation specific to the
CachePut annotated method |
protected CacheRemoveAllMethodDetails |
createCacheRemoveAllMethodDetails(javax.cache.annotation.CacheRemoveAll cacheRemoveAllAnnotation,
javax.cache.annotation.CacheDefaults cacheDefaultsAnnotation,
Method method,
Class<? extends Object> targetClass)
Create a StaticCacheInvocationContext implementation specific to the
CacheRemoveAll annotated method |
protected CacheRemoveEntryMethodDetails |
createCacheRemoveEntryMethodDetails(javax.cache.annotation.CacheRemove cacheRemoveAnnotation,
javax.cache.annotation.CacheDefaults cacheDefaultsAnnotation,
Method method,
Class<? extends Object> targetClass)
Create a StaticCacheInvocationContext implementation specific to the
CacheRemove annotated method |
protected CacheResultMethodDetails |
createCacheResultMethodDetails(javax.cache.annotation.CacheResult cacheResultAnnotation,
javax.cache.annotation.CacheDefaults cacheDefaultsAnnotation,
Method method,
Class<? extends Object> targetClass)
Create a StaticCacheInvocationContext implementation specific to the
CacheResult annotated method |
protected <T extends Annotation> |
getAnnotation(Class<T> annotationClass,
Method method,
Class<? extends Object> targetClass)
Get the concrete annotation object for the method that will be invoked on the target class.
|
InternalCacheInvocationContext<? extends Annotation> |
getCacheInvocationContext(I invocation)
Get the
AbstractInternalCacheInvocationContext for the invocation |
protected javax.cache.annotation.CacheKeyGenerator |
getCacheKeyGenerator(Class<? extends javax.cache.annotation.CacheKeyGenerator> cacheKeyGeneratorType,
javax.cache.annotation.CacheDefaults cacheDefaultsAnnotation)
Get the cache key generator based on the requested type and the defaults
|
InternalCacheKeyInvocationContext<? extends Annotation> |
getCacheKeyInvocationContext(I invocation)
Get the
InternalCacheKeyInvocationContext for the CDI invocation. |
protected javax.cache.annotation.CacheResolverFactory |
getCacheResolverFactory(Class<? extends javax.cache.annotation.CacheResolverFactory> cacheResolverFactoryType,
javax.cache.annotation.CacheDefaults cacheDefaultsAnnotation)
Get the cache resolver factory based on the requested type and the defaults.
|
protected abstract javax.cache.annotation.CacheKeyGenerator |
getDefaultCacheKeyGenerator() |
protected abstract javax.cache.annotation.CacheResolverFactory |
getDefaultCacheResolverFactory() |
protected abstract Method |
getMethod(I invocation) |
protected Set<Annotation> |
getMethodAnnotations(Method method)
Get an immutable set of all annotations on the method
|
StaticCacheInvocationContext<? extends Annotation> |
getMethodDetails(Method method,
Class<? extends Object> targetClass)
Get detailed data about an annotated method for a specific targeted class
|
protected abstract <T> T |
getObjectByType(Class<T> type)
Used to load
CacheKeyGenerator and CacheResolverFactory instances by type |
protected org.jsr107.ri.annotations.AbstractCacheLookupUtil.ParameterDetails |
getParameterDetails(Method method,
boolean cacheValueAllowed)
Parse the parameters for a Method and create immutable
CacheParameterDetails lists |
protected abstract Class<?> |
getTargetClass(I invocation) |
protected String |
resolveCacheName(String methodCacheName,
javax.cache.annotation.CacheDefaults cacheDefaultsAnnotation,
Method method,
Class<? extends Object> targetClass)
Determine the cache name to use based on the method and class level annotations
|
public InternalCacheKeyInvocationContext<? extends Annotation> getCacheKeyInvocationContext(I invocation)
InternalCacheKeyInvocationContext for the CDI invocation.getCacheKeyInvocationContext in interface CacheContextSource<I>invocation - The CDI invocation contextUnsupportedOperationException - if the invocation context is available for the invocationprotected abstract InternalCacheKeyInvocationContext<? extends Annotation> createCacheKeyInvocationContextImpl(StaticCacheKeyInvocationContext<? extends Annotation> staticCacheKeyInvocationContext, I invocation)
staticCacheKeyInvocationContext - The static key context information about the methodinvocation - The intercepted method invocationpublic InternalCacheInvocationContext<? extends Annotation> getCacheInvocationContext(I invocation)
AbstractInternalCacheInvocationContext for the invocationgetCacheInvocationContext in interface CacheContextSource<I>invocation - The CDI invocation contextprotected abstract InternalCacheInvocationContext<? extends Annotation> createCacheInvocationContextImpl(StaticCacheInvocationContext<? extends Annotation> staticCacheInvocationContext, I invocation)
staticCacheInvocationContext - The static context information about the methodinvocation - The intercepted method invocationprotected <T extends Annotation> T getAnnotation(Class<T> annotationClass, Method method, Class<? extends Object> targetClass)
Subclasses may override this to provide their own annotation resolution logic, the default implementation
uses Method.getAnnotation(Class)
annotationClass - The annotation classmethod - Target methodtargetClass - Target Classpublic StaticCacheInvocationContext<? extends Annotation> getMethodDetails(Method method, Class<? extends Object> targetClass)
getMethodDetails in interface CacheContextSource<I>method - The method that to get details fortargetClass - The class that is being targeted with the invocationAnnotationFormatError - if an invalid combination of annotations exist on the methodprotected <A extends Annotation> javax.cache.annotation.CacheMethodDetails<A> createCacheMethodDetails(A cacheAnnotation, javax.cache.annotation.CacheDefaults cacheDefaultsAnnotation, String methodCacheName, Method method, Class<? extends Object> targetClass)
cacheAnnotation - The annotationcacheDefaultsAnnotation - The class level defaults annotationmethod - The annotated methodtargetClass - The intercepted classprotected CacheResultMethodDetails createCacheResultMethodDetails(javax.cache.annotation.CacheResult cacheResultAnnotation, javax.cache.annotation.CacheDefaults cacheDefaultsAnnotation, Method method, Class<? extends Object> targetClass)
CacheResult annotated methodcacheResultAnnotation - The annotation on the methodcacheDefaultsAnnotation - The defaults annotation for the class, if it existsmethod - The annotated methodtargetClass - The intercepted classprotected CachePutMethodDetails createCachePutMethodDetails(javax.cache.annotation.CachePut cachePutAnnotation, javax.cache.annotation.CacheDefaults cacheDefaultsAnnotation, Method method, Class<? extends Object> targetClass)
CachePut annotated methodcachePutAnnotation - The annotation on the methodcacheDefaultsAnnotation - The defaults annotation for the class, if it existsmethod - The annotated methodtargetClass - The intercepted classprotected CacheRemoveEntryMethodDetails createCacheRemoveEntryMethodDetails(javax.cache.annotation.CacheRemove cacheRemoveAnnotation, javax.cache.annotation.CacheDefaults cacheDefaultsAnnotation, Method method, Class<? extends Object> targetClass)
CacheRemove annotated methodcacheRemoveAnnotation - The annotation on the methodcacheDefaultsAnnotation - The defaults annotation for the class, if it existsmethod - The annotated methodtargetClass - The intercepted classprotected CacheRemoveAllMethodDetails createCacheRemoveAllMethodDetails(javax.cache.annotation.CacheRemoveAll cacheRemoveAllAnnotation, javax.cache.annotation.CacheDefaults cacheDefaultsAnnotation, Method method, Class<? extends Object> targetClass)
CacheRemoveAll annotated methodcacheRemoveAllAnnotation - The annotation on the methodcacheDefaultsAnnotation - The defaults annotation for the class, if it existsmethod - The annotated methodtargetClass - The intercepted classprotected Set<Annotation> getMethodAnnotations(Method method)
protected org.jsr107.ri.annotations.AbstractCacheLookupUtil.ParameterDetails getParameterDetails(Method method, boolean cacheValueAllowed)
CacheParameterDetails listsmethod - The method to get parameter detail information forcacheValueAllowed - If the CacheValue annotation is legal for this methodprotected abstract <T> T getObjectByType(Class<T> type)
CacheKeyGenerator and CacheResolverFactory instances by typeprotected abstract javax.cache.annotation.CacheKeyGenerator getDefaultCacheKeyGenerator()
protected abstract javax.cache.annotation.CacheResolverFactory getDefaultCacheResolverFactory()
protected javax.cache.annotation.CacheKeyGenerator getCacheKeyGenerator(Class<? extends javax.cache.annotation.CacheKeyGenerator> cacheKeyGeneratorType, javax.cache.annotation.CacheDefaults cacheDefaultsAnnotation)
cacheKeyGeneratorType - Requested key generator typecacheDefaultsAnnotation - Defaults dataprotected javax.cache.annotation.CacheResolverFactory getCacheResolverFactory(Class<? extends javax.cache.annotation.CacheResolverFactory> cacheResolverFactoryType, javax.cache.annotation.CacheDefaults cacheDefaultsAnnotation)
cacheResolverFactoryType - Requested resolver factory typecacheDefaultsAnnotation - Defaults dataprotected String resolveCacheName(String methodCacheName, javax.cache.annotation.CacheDefaults cacheDefaultsAnnotation, Method method, Class<? extends Object> targetClass)
methodCacheName - The cache name specified by the method level annotationcacheDefaultsAnnotation - The class level cache defaultsmethod - The annotated methodtargetClass - The target class, if not null a default cache name will be generated if no name is specifiedAnnotationFormatError - If target is null and no cache name is specified in the method or class level annotationsCopyright © 2019. All rights reserved.