org.springframework.cache.interceptor

Interface CacheResolver

  • All Known Implementing Classes:
    AbstractCacheResolver, NamedCacheResolver, SimpleCacheResolver, SimpleExceptionCacheResolver
    Functional Interface:
    This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.


    @FunctionalInterface
    public interface CacheResolver
    Determine the Cache instance(s) to use for an intercepted method invocation.

    Implementations must be thread-safe.

    Since:
    4.1
    Author:
    Stephane Nicoll
    • Method Detail

      • resolveCaches

        java.util.Collection<? extends Cache> resolveCaches(CacheOperationInvocationContext<?> context)
        Return the cache(s) to use for the specified invocation.
        Parameters:
        context - the context of the particular invocation
        Returns:
        the cache(s) to use (never null)
        Throws:
        java.lang.IllegalStateException - if cache resolution failed