org.springframework.cache.support

## 类 AbstractCacheManager

- java.lang.Object
- - org.springframework.cache.support.AbstractCacheManager

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

      public abstract class AbstractCacheManager
      extends Object
      implements CacheManager, org.springframework.beans.factory.InitializingBean

  Abstract base class implementing the common `CacheManager` methods. Useful for 'static' environments where the backing caches do not change.
  从以下版本开始:
    3.1
  作者:
    Costin Leau, Juergen Hoeller, Stephane Nicoll

- - ### 构造器概要

    构造器
    构造器和说明
    `AbstractCacheManager()`

  - ### 方法概要

    所有方法 实例方法 抽象方法 具体方法 已过时的方法
    限定符和类型 | 方法和说明
    --- | ---
    `protected void` | `addCache(Cache cache)` 已过时。 as of Spring 4.3, in favor of `getMissingCache(String)`
    `void` | `afterPropertiesSet()`
    `protected Cache` | `decorateCache(Cache cache)` Decorate the given Cache object if necessary.
    `Cache` | `getCache(String name)` Return the cache associated with the given name.
    `Collection<String>` | `getCacheNames()` Return a collection of the cache names known by this manager.
    `protected Cache` | `getMissingCache(String name)` Return a missing cache with the specified `name` or `null` if such cache does not exist or could not be created on the fly.
    `void` | `initializeCaches()` Initialize the static configuration of caches.
    `protected abstract Collection<? extends Cache>` | `loadCaches()` Load the initial caches for this cache manager.
    `protected Cache` | `lookupCache(String name)` Check for a registered cache of the given name.

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

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

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

    - #### AbstractCacheManager

          public AbstractCacheManager()

  - ### 方法详细资料

    - #### afterPropertiesSet

          public void afterPropertiesSet()

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

    - #### initializeCaches

          public void initializeCaches()

      Initialize the static configuration of caches.

      Triggered on startup through `afterPropertiesSet()`; can also be called to re-initialize at runtime.

      从以下版本开始:
        4.2.2
      另请参阅:
        `loadCaches()`

    - #### loadCaches

          protected abstract Collection<? extends Cache> loadCaches()

      Load the initial caches for this cache manager.

      Called by `afterPropertiesSet()` on startup. The returned collection may be empty but must not be `null`.

    - #### getCache

          @Nullable
          public Cache getCache(String name)

      从接口复制的说明: `CacheManager`
      Return the cache associated with the given name.
      指定者:
        `getCache` 在接口中 `CacheManager`
      参数:
        `name` - the cache identifier (must not be `null`)
      返回:
        the associated cache, or `null` if none found

    - #### getCacheNames

          public Collection<String> getCacheNames()

      从接口复制的说明: `CacheManager`
      Return a collection of the cache names known by this manager.
      指定者:
        `getCacheNames` 在接口中 `CacheManager`
      返回:
        the names of all caches known by the cache manager

    - #### lookupCache

          @Nullable
          protected final Cache lookupCache(String name)

      Check for a registered cache of the given name. In contrast to `getCache(String)`, this method does not trigger the lazy creation of missing caches via `getMissingCache(String)`.
      参数:
        `name` - the cache identifier (must not be `null`)
      返回:
        the associated Cache instance, or `null` if none found
      从以下版本开始:
        4.1
      另请参阅:
        `getCache(String)`, `getMissingCache(String)`

    - #### addCache

          @Deprecated
          protected final void addCache(Cache cache)

      已过时。 as of Spring 4.3, in favor of `getMissingCache(String)`
      Dynamically register an additional Cache with this manager.
      参数:
        `cache` - the Cache to register

    - #### decorateCache

          protected Cache decorateCache(Cache cache)

      Decorate the given Cache object if necessary.
      参数:
        `cache` - the Cache object to be added to this CacheManager
      返回:
        the decorated Cache object to be used instead, or simply the passed-in Cache object by default

    - #### getMissingCache

          @Nullable
          protected Cache getMissingCache(String name)

      Return a missing cache with the specified `name` or `null` if such cache does not exist or could not be created on the fly.

      Some caches may be created at runtime if the native provider supports it. If a lookup by name does not yield any result, a subclass gets a chance to register such a cache at runtime. The returned cache will be automatically added to this instance.

      参数:
        `name` - the name of the cache to retrieve
      返回:
        the missing cache or `null` if no such cache exists or could be created
      从以下版本开始:
        4.1
      另请参阅:
        `getCache(String)`