@InterceptorBean(value=CacheAnnotation.class) public class CacheInterceptor extends Object implements io.micronaut.aop.MethodInterceptor<Object,Object>
An AOP MethodInterceptor implementation for the Cache annotations Cacheable,
 CachePut and CacheInvalidate.
| Modifier and Type | Field and Description | 
|---|---|
| static int | POSITIONThe position on the interceptor in the chain. | 
| Constructor and Description | 
|---|
| CacheInterceptor(CacheManager cacheManager,
                CacheErrorHandler errorHandler,
                AsyncCacheErrorHandler asyncCacheErrorHandler,
                ExecutorService ioExecutor,
                io.micronaut.context.BeanContext beanContext)Create Cache Interceptor with given arguments. | 
| Modifier and Type | Method and Description | 
|---|---|
| protected Object | doContextProceed(io.micronaut.aop.MethodInvocationContext context) | 
| int | getOrder() | 
| Object | intercept(io.micronaut.aop.MethodInvocationContext<Object,Object> context) | 
| protected CompletionStage<?> | interceptAsCompletableFuture(io.micronaut.aop.MethodInvocationContext<Object,Object> context,
                            Supplier<CompletionStage<?>> intercept,
                            io.micronaut.core.type.ReturnType<?> returnTypeObject,
                            io.micronaut.core.type.Argument<?> requiredType)Intercept the async method invocation. | 
| protected Object | interceptSync(io.micronaut.aop.MethodInvocationContext context,
             io.micronaut.core.type.ReturnType<?> returnType)Intercept the annotated method invocation with sync. | 
| protected List<io.micronaut.core.annotation.AnnotationValue<CacheInvalidate>> | invalidateOperations(io.micronaut.inject.ExecutableMethod<?,?> method)Evict from the cache. | 
| protected List<io.micronaut.core.annotation.AnnotationValue<CachePut>> | putOperations(io.micronaut.inject.ExecutableMethod<?,?> method)Saving inside the cache. | 
| protected CacheKeyGenerator | resolveKeyGenerator(Class<? extends CacheKeyGenerator> type)Resolve the cache key generator from the give type. | 
public static final int POSITION
public CacheInterceptor(CacheManager cacheManager, CacheErrorHandler errorHandler, AsyncCacheErrorHandler asyncCacheErrorHandler, @Named(value="io") ExecutorService ioExecutor, io.micronaut.context.BeanContext beanContext)
cacheManager - The cache managererrorHandler - Cache error handlerasyncCacheErrorHandler - Async cache error handlersioExecutor - The executor to create tasksbeanContext - The bean context to allow DIpublic int getOrder()
getOrder in interface io.micronaut.core.order.Orderedprotected Object interceptSync(io.micronaut.aop.MethodInvocationContext context, io.micronaut.core.type.ReturnType<?> returnType)
context - Contains information about method invocationreturnType - The return type classprotected CompletionStage<?> interceptAsCompletableFuture(io.micronaut.aop.MethodInvocationContext<Object,Object> context, Supplier<CompletionStage<?>> intercept, io.micronaut.core.type.ReturnType<?> returnTypeObject, io.micronaut.core.type.Argument<?> requiredType)
context - Contains information about method invocationintercept - The intercepted resultreturnTypeObject - The return type of the method in MicronautrequiredType - The return type classprotected List<io.micronaut.core.annotation.AnnotationValue<CachePut>> putOperations(io.micronaut.inject.ExecutableMethod<?,?> method)
method - Contains information about method invocationprotected List<io.micronaut.core.annotation.AnnotationValue<CacheInvalidate>> invalidateOperations(io.micronaut.inject.ExecutableMethod<?,?> method)
method - Contains information about method invocationprotected CacheKeyGenerator resolveKeyGenerator(Class<? extends CacheKeyGenerator> type)
type - The key generatorprotected Object doContextProceed(io.micronaut.aop.MethodInvocationContext context)
context - the method invocation context