Class 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  
      • Nested classes/interfaces inherited from class org.springframework.cache.interceptor.CacheAspectSupport

        org.springframework.cache.interceptor.CacheAspectSupport.CacheOperationContext, org.springframework.cache.interceptor.CacheAspectSupport.CacheOperationMetadata
    • Field Summary

      • Fields inherited from class org.springframework.cache.interceptor.CacheAspectSupport

        logger
    • 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.CacheInterceptor

        invoke
      • 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
      • Methods inherited from class org.springframework.cache.interceptor.AbstractCacheInvoker

        doClear, doEvict, doGet, doPut
    • Constructor Detail

      • OpeniamCacheInterceptor

        public OpeniamCacheInterceptor()
    • Method Detail

      • setCacheManager

        public void setCacheManager​(org.springframework.cache.CacheManager cacheManager)
        Overrides:
        setCacheManager in class org.springframework.cache.interceptor.CacheAspectSupport
      • setBeanFactory

        public void setBeanFactory​(org.springframework.beans.factory.BeanFactory beanFactory)
        Specified by:
        setBeanFactory in interface org.springframework.beans.factory.BeanFactoryAware
        Overrides:
        setBeanFactory in class org.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 class org.springframework.cache.interceptor.CacheAspectSupport
      • setErrorHandler

        public void setErrorHandler​(org.springframework.cache.interceptor.CacheErrorHandler errorHandler)
        Overrides:
        setErrorHandler in class org.springframework.cache.interceptor.AbstractCacheInvoker
      • getErrorHandler

        public org.springframework.cache.interceptor.CacheErrorHandler getErrorHandler()
        Overrides:
        getErrorHandler in class org.springframework.cache.interceptor.AbstractCacheInvoker