org.springframework.cache.interceptor

## 类 AbstractCacheResolver

- java.lang.Object
- - org.springframework.cache.interceptor.AbstractCacheResolver

- 所有已实现的接口:
    org.springframework.beans.factory.InitializingBean, CacheResolver
  直接已知子类:
    NamedCacheResolver, SimpleCacheResolver

      public abstract class AbstractCacheResolver
      extends Object
      implements CacheResolver, org.springframework.beans.factory.InitializingBean

  A base `CacheResolver` implementation that requires the concrete implementation to provide the collection of cache name(s) based on the invocation context.
  从以下版本开始:
    4.1
  作者:
    Stephane Nicoll, Juergen Hoeller

- - ### 构造器概要

    构造器
    限定符 | 构造器和说明
    --- | ---
    `protected` | `AbstractCacheResolver()` Construct a new `AbstractCacheResolver`.
    `protected` | `AbstractCacheResolver(CacheManager cacheManager)` Construct a new `AbstractCacheResolver` for the given `CacheManager`.

  - ### 方法概要

    所有方法 实例方法 抽象方法 具体方法
    限定符和类型 | 方法和说明
    --- | ---
    `void` | `afterPropertiesSet()`
    `CacheManager` | `getCacheManager()` Return the `CacheManager` that this instance uses.
    `protected abstract Collection<String>` | `getCacheNames(CacheOperationInvocationContext<?> context)` Provide the name of the cache(s) to resolve against the current cache manager.
    `Collection<? extends Cache>` | `resolveCaches(CacheOperationInvocationContext<?> context)` Return the cache(s) to use for the specified invocation.
    `void` | `setCacheManager(CacheManager cacheManager)` Set the `CacheManager` that this instance should use.

    - ### 从类继承的方法 java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### 构造器详细资料

    - #### AbstractCacheResolver

          protected AbstractCacheResolver()

      Construct a new `AbstractCacheResolver`.
      另请参阅:
        `setCacheManager(org.springframework.cache.CacheManager)`

    - #### AbstractCacheResolver

          protected AbstractCacheResolver(CacheManager cacheManager)

      Construct a new `AbstractCacheResolver` for the given `CacheManager`.
      参数:
        `cacheManager` - the CacheManager to use

  - ### 方法详细资料

    - #### setCacheManager

          public void setCacheManager(CacheManager cacheManager)

      Set the `CacheManager` that this instance should use.

    - #### getCacheManager

          public CacheManager getCacheManager()

      Return the `CacheManager` that this instance uses.

    - #### afterPropertiesSet

          public void afterPropertiesSet()

      指定者:
        `afterPropertiesSet` 在接口中 `org.springframework.beans.factory.InitializingBean`

    - #### resolveCaches

          public Collection<? extends Cache> resolveCaches(CacheOperationInvocationContext<?> context)

      从接口复制的说明: `CacheResolver`
      Return the cache(s) to use for the specified invocation.
      指定者:
        `resolveCaches` 在接口中 `CacheResolver`
      参数:
        `context` - the context of the particular invocation
      返回:
        the cache(s) to use (never `null`)

    - #### getCacheNames

          @Nullable
          protected abstract Collection<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.

      参数:
        `context` - the context of the particular invocation
      返回:
        the cache name(s) to resolve, or `null` if no cache should be resolved