Interface CacheManager

All Known Implementing Classes:
AbstractCacheManager, AbstractTransactionSupportingCacheManager, CaffeineCacheManager, CompositeCacheManager, ConcurrentMapCacheManager, JCacheCacheManager, NoOpCacheManager, SimpleCacheManager, TransactionAwareCacheManagerProxy

public interface CacheManager
Spring's central cache manager SPI.

Allows for retrieving named Cache regions.

Since:
3.1
Author:
Costin Leau, Sam Brannen
  • Method Summary

    Modifier and Type
    Method
    Description
    Get the cache associated with the given name.
    Get a collection of the cache names known by this manager.
  • Method Details

    • getCache

      @Nullable Cache getCache(String name)
      Get the cache associated with the given name.

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

      Parameters:
      name - the cache identifier (must not be null)
      Returns:
      the associated cache, or null if such a cache does not exist or could be not created
    • getCacheNames

      Collection<String> getCacheNames()
      Get a collection of the cache names known by this manager.
      Returns:
      the names of all caches known by the cache manager