Package org.openiam.config
Class OpeniamCacheInterceptor
- java.lang.Object
-
- org.springframework.cache.interceptor.AbstractCacheInvoker
-
- org.springframework.cache.interceptor.CacheAspectSupport
-
- org.springframework.cache.interceptor.CacheInterceptor
-
- org.openiam.config.OpeniamCacheInterceptor
-
- All Implemented Interfaces:
Serializable,org.aopalliance.aop.Advice,org.aopalliance.intercept.Interceptor,org.aopalliance.intercept.MethodInterceptor,org.springframework.beans.factory.Aware,org.springframework.beans.factory.BeanFactoryAware,org.springframework.beans.factory.InitializingBean,org.springframework.beans.factory.SmartInitializingSingleton
public class OpeniamCacheInterceptor extends org.springframework.cache.interceptor.CacheInterceptor- Author:
- Lev Bornovalov This is our custom Cache Interceptor. This is required for IDMAPPS-3644. The cache interceptor is required to get access to the generated @Cacheable and @Cachevict keys, as well as the evict() operation, which we would normally not have access to. This is not a Spring Bean, and hence, @Autowiring will not work. Note that half of this class is a hack around the fact that Spring does not not purposefully expose most of this functionality
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected classOpeniamCacheInterceptor.OpeniamCacheOperationContext
-
Constructor Summary
Constructors Constructor Description OpeniamCacheInterceptor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Objectexecute(org.springframework.cache.interceptor.CacheOperationInvoker invoker, Object target, Method method, Object[] args)org.springframework.cache.interceptor.CacheErrorHandlergetErrorHandler()protected OpeniamCacheInterceptor.OpeniamCacheOperationContextgetOperationContext(org.springframework.cache.interceptor.CacheOperation operation, Method method, Object[] args, Object target, Class<?> targetClass)voidinit()voidsetBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory)voidsetCacheManager(org.springframework.cache.CacheManager cacheManager)voidsetErrorHandler(org.springframework.cache.interceptor.CacheErrorHandler errorHandler)voidsetRedissonClient(org.redisson.api.RedissonClient redissonClient)-
Methods inherited from class org.springframework.cache.interceptor.CacheAspectSupport
afterPropertiesSet, afterSingletonsInstantiated, clearMetadataCache, configure, getBean, getCacheOperationMetadata, getCacheOperationSource, getCacheResolver, getCaches, getKeyGenerator, invokeOperation, methodIdentification, setCacheOperationSource, setCacheOperationSources, setCacheResolver, setKeyGenerator
-
-
-
-
Method Detail
-
setCacheManager
public void setCacheManager(org.springframework.cache.CacheManager cacheManager)
- Overrides:
setCacheManagerin classorg.springframework.cache.interceptor.CacheAspectSupport
-
setBeanFactory
public void setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory)
- Specified by:
setBeanFactoryin interfaceorg.springframework.beans.factory.BeanFactoryAware- Overrides:
setBeanFactoryin classorg.springframework.cache.interceptor.CacheAspectSupport
-
setRedissonClient
public void setRedissonClient(org.redisson.api.RedissonClient redissonClient)
-
init
public void init()
-
execute
protected Object execute(org.springframework.cache.interceptor.CacheOperationInvoker invoker, Object target, Method method, Object[] args)
- Overrides:
executein classorg.springframework.cache.interceptor.CacheAspectSupport
-
getOperationContext
protected OpeniamCacheInterceptor.OpeniamCacheOperationContext getOperationContext(org.springframework.cache.interceptor.CacheOperation operation, Method method, Object[] args, Object target, Class<?> targetClass)
- Overrides:
getOperationContextin classorg.springframework.cache.interceptor.CacheAspectSupport
-
setErrorHandler
public void setErrorHandler(org.springframework.cache.interceptor.CacheErrorHandler errorHandler)
- Overrides:
setErrorHandlerin classorg.springframework.cache.interceptor.AbstractCacheInvoker
-
getErrorHandler
public org.springframework.cache.interceptor.CacheErrorHandler getErrorHandler()
- Overrides:
getErrorHandlerin classorg.springframework.cache.interceptor.AbstractCacheInvoker
-
-