Class NoOpCacheManager
- java.lang.Object
- org.springframework.cache.support.NoOpCacheManager
- All Implemented Interfaces:
CacheManager
public class NoOpCacheManager extends Object implements CacheManager
A basic, no operationCacheManagerimplementation suitable for disabling caching, typically used for backing cache declarations without an actual backing store.Will simply accept any items into the cache not actually storing them.
- Since:
- 3.1
- Author:
- Costin Leau, Stephane Nicoll
- See Also:
NoOpCache
Constructor Summary
Constructors Constructor Description NoOpCacheManager()
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CachegetCache(String name)This implementation always returns aCacheimplementation that will not store items.Collection<String>getCacheNames()This implementation returns the name of the caches previously requested.
Constructor Detail
NoOpCacheManager
public NoOpCacheManager()
Method Detail
getCache
public Cache getCache(String name)
This implementation always returns aCacheimplementation that will not store items. Additionally, the request cache will be remembered by the manager for consistency.- Specified by:
getCachein interfaceCacheManager- Parameters:
name- the cache identifier (must not benull)- Returns:
- the associated cache, or
nullif such a cache does not exist or could be not created
getCacheNames
public Collection<String> getCacheNames()
This implementation returns the name of the caches previously requested.- Specified by:
getCacheNamesin interfaceCacheManager- Returns:
- the names of all caches known by the cache manager