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 class
OpeniamCacheInterceptor.OpeniamCacheOperationContext
-
Constructor Summary
Constructors Constructor Description OpeniamCacheInterceptor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Object
execute(org.springframework.cache.interceptor.CacheOperationInvoker invoker, Object target, Method method, Object[] args)
org.springframework.cache.interceptor.CacheErrorHandler
getErrorHandler()
protected OpeniamCacheInterceptor.OpeniamCacheOperationContext
getOperationContext(org.springframework.cache.interceptor.CacheOperation operation, Method method, Object[] args, Object target, Class<?> targetClass)
void
init()
void
setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory)
void
setCacheManager(org.springframework.cache.CacheManager cacheManager)
void
setErrorHandler(org.springframework.cache.interceptor.CacheErrorHandler errorHandler)
void
setRedissonClient(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:
setCacheManager
in classorg.springframework.cache.interceptor.CacheAspectSupport
-
setBeanFactory
public void setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory)
- Specified by:
setBeanFactory
in interfaceorg.springframework.beans.factory.BeanFactoryAware
- Overrides:
setBeanFactory
in 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:
execute
in 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:
getOperationContext
in classorg.springframework.cache.interceptor.CacheAspectSupport
-
setErrorHandler
public void setErrorHandler(org.springframework.cache.interceptor.CacheErrorHandler errorHandler)
- Overrides:
setErrorHandler
in classorg.springframework.cache.interceptor.AbstractCacheInvoker
-
getErrorHandler
public org.springframework.cache.interceptor.CacheErrorHandler getErrorHandler()
- Overrides:
getErrorHandler
in classorg.springframework.cache.interceptor.AbstractCacheInvoker
-
-