Class ScoredRedisCacheInterceptor

  • 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 ScoredRedisCacheInterceptor
    extends org.springframework.cache.interceptor.CacheInterceptor
    Resolves the score of the caching value by the ScoreResolver, and stores to the ScoreHolder, and then the ScoredRedisCacheWriter could read the score from the ScoreHolder
    See Also:
    Serialized Form
    • Nested Class Summary

      • 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 
      Modifier and Type Field Description
      private ScoreHolder scoreHolder  
      private org.oxerr.spring.cache.redis.scored.score.resolver.ScoreResolver scoreResolver  
      private static long serialVersionUID  
      • Fields inherited from class org.springframework.cache.interceptor.CacheAspectSupport

        logger
      • Fields inherited from class org.springframework.cache.interceptor.AbstractCacheInvoker

        errorHandler
    • Constructor Summary

      Constructors 
      Constructor Description
      ScoredRedisCacheInterceptor​(org.oxerr.spring.cache.redis.scored.score.resolver.ScoreResolver scoreResolver, ScoreHolder scoreHolder)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      private void clearScore()  
      protected void doPut​(org.springframework.cache.Cache cache, Object key, Object result)  
      private void setScore​(Object result)  
      • Methods inherited from class org.springframework.cache.interceptor.CacheInterceptor

        invoke
      • Methods inherited from class org.springframework.cache.interceptor.CacheAspectSupport

        afterPropertiesSet, afterSingletonsInstantiated, clearMetadataCache, configure, execute, getBean, getCacheOperationMetadata, getCacheOperationSource, getCacheResolver, getCaches, getKeyGenerator, getOperationContext, invokeOperation, methodIdentification, setBeanFactory, setCacheManager, setCacheOperationSource, setCacheOperationSources, setCacheResolver, setKeyGenerator
      • Methods inherited from class org.springframework.cache.interceptor.AbstractCacheInvoker

        doClear, doEvict, doGet, getErrorHandler, setErrorHandler
    • Field Detail

      • scoreResolver

        private final org.oxerr.spring.cache.redis.scored.score.resolver.ScoreResolver scoreResolver
    • Constructor Detail

      • ScoredRedisCacheInterceptor

        public ScoredRedisCacheInterceptor​(@NonNull
                                           org.oxerr.spring.cache.redis.scored.score.resolver.ScoreResolver scoreResolver,
                                           @NonNull
                                           ScoreHolder scoreHolder)
    • Method Detail

      • doPut

        protected void doPut​(org.springframework.cache.Cache cache,
                             Object key,
                             @Nullable
                             Object result)
        Overrides:
        doPut in class org.springframework.cache.interceptor.AbstractCacheInvoker
      • setScore

        private void setScore​(@Nullable
                              Object result)
      • clearScore

        private void clearScore()