类 AbstractCacheManager

java.lang.Object
cn.taketoday.cache.support.AbstractCacheManager
所有已实现的接口:
InitializingBean, CacheManager
直接已知子类:
SimpleCacheManager

public abstract class AbstractCacheManager extends Object implements CacheManager, InitializingBean
Abstract base class implementing the common CacheManager methods. Useful for 'static' environments where the backing caches do not change.
从以下版本开始:
2020-08-15 19:18
作者:
Costin Leau, Juergen Hoeller, Stephane Nicoll, TODAY
  • 构造器详细资料

    • AbstractCacheManager

      public AbstractCacheManager()
  • 方法详细资料

    • afterPropertiesSet

      public void afterPropertiesSet()
      指定者:
      afterPropertiesSet 在接口中 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.0
      另请参阅:
    • 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
      Get the cache associated with the given name.

      Note that the cache may be lazily created at runtime if the native provider supports it.

      指定者:
      getCache 在接口中 CacheManager
      参数:
      name - the cache identifier (must not be null)
      返回:
      the associated cache, or null if such a cache does not exist or could be not created
    • getCacheNames

      public Collection<String> getCacheNames()
      从接口复制的说明: CacheManager
      Get 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.0
      另请参阅:
    • 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 a cache does not exist or could not be created on demand.

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

      参数:
      name - the name of the cache to retrieve
      返回:
      the missing cache, or null if no such cache exists or could be created on demand
      从以下版本开始:
      4.0
      另请参阅: