org.springframework.cache.interceptor

Class AbstractCacheResolver

  • java.lang.Object
    • org.springframework.cache.interceptor.AbstractCacheResolver
    • Method Detail

      • setCacheManager

        public void setCacheManager(CacheManager cacheManager)
        Set the CacheManager that this instance should use.
      • afterPropertiesSet

        public void afterPropertiesSet()
        Description copied from interface: InitializingBean
        Invoked by the containing BeanFactory after it has set all bean properties and satisfied BeanFactoryAware, ApplicationContextAware etc.

        This method allows the bean instance to perform validation of its overall configuration and final initialization when all bean properties have been set.

        Specified by:
        afterPropertiesSet in interface InitializingBean
      • resolveCaches

        public java.util.Collection<? extends Cache> resolveCaches(CacheOperationInvocationContext<?> context)
        Description copied from interface: CacheResolver
        Return the cache(s) to use for the specified invocation.
        Specified by:
        resolveCaches in interface CacheResolver
        Parameters:
        context - the context of the particular invocation
        Returns:
        the cache(s) to use (never null)
      • getCacheNames

        @Nullable
        protected abstract java.util.Collection<java.lang.String> getCacheNames(CacheOperationInvocationContext<?> context)
        Provide the name of the cache(s) to resolve against the current cache manager.

        It is acceptable to return null to indicate that no cache could be resolved for this invocation.

        Parameters:
        context - the context of the particular invocation
        Returns:
        the cache name(s) to resolve, or null if no cache should be resolved