Package org.springframework.cache.support

# Class SimpleCacheManager

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

All Implemented Interfaces:
  `org.springframework.beans.factory.InitializingBean`, `CacheManager`

public class SimpleCacheManager extends AbstractCacheManager
Simple cache manager working against a given collection of caches. Useful for testing or simple caching declarations.

When using this implementation directly, i.e. not via a regular bean registration, `AbstractCacheManager.initializeCaches()` should be invoked to initialize its internal state once the caches have been provided.

Since:
  3.1
Author:
  Costin Leau
See Also:
  - `NoOpCache`
  - `ConcurrentMapCache`

## Constructor Summary

Constructors
Constructor
Description
`SimpleCacheManager()`

## Method Summary

Modifier and Type
Method
Description
`protected Collection<? extends Cache>`
`loadCaches()`
Load the initial caches for this cache manager.
`void`
`setCaches(Collection<? extends Cache> caches)`
Specify the collection of Cache instances to use for this CacheManager.

### Methods inherited from class org.springframework.cache.support.AbstractCacheManager

`afterPropertiesSet, decorateCache, getCache, getCacheNames, getMissingCache, initializeCaches, lookupCache`

### Methods inherited from class java.lang.Object

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

## Constructor Details

### SimpleCacheManager

public SimpleCacheManager()

## Method Details

### setCaches

public void setCaches(Collection<? extends Cache> caches)
Specify the collection of Cache instances to use for this CacheManager.

See Also:
  - `AbstractCacheManager.initializeCaches()`

### loadCaches

protected Collection<? extends Cache> loadCaches()
Description copied from class: `AbstractCacheManager`
Load the initial caches for this cache manager.

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

Specified by:
  `loadCaches` in class `AbstractCacheManager`