public class ConcurrentMapCacheManager extends Object implements CacheManager
CacheManager
implementation that lazily builds ConcurrentMapCache
instances for each getCache(java.lang.String)
request. Also supports a 'static' mode where
the set of cache names is pre-defined through setCacheNames(java.util.Collection<java.lang.String>)
, with no
dynamic creation of further cache regions at runtime.Constructor and Description |
---|
ConcurrentMapCacheManager()
Construct a dynamic ConcurrentMapCacheManager,
lazily creating cache instances as they are being requested.
|
ConcurrentMapCacheManager(String... cacheNames)
Construct a static ConcurrentMapCacheManager,
managing caches for the specified cache names only.
|
Modifier and Type | Method and Description |
---|---|
protected Cache |
createConcurrentMapCache(String name)
Create a new ConcurrentMapCache instance for the specified cache name.
|
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.
|
void |
setCacheNames(Collection<String> cacheNames)
Specify the set of cache names for this CacheManager's 'static' mode.
|
public ConcurrentMapCacheManager()
public ConcurrentMapCacheManager(String... cacheNames)
public void setCacheNames(Collection<String> cacheNames)
The number of caches and their names will be fixed after a call to this method, with no creation of further cache regions at runtime.
public Collection<String> getCacheNames()
CacheManager
getCacheNames
in interface CacheManager
public Cache getCache(String name)
CacheManager
getCache
in interface CacheManager
name
- the cache identifier (must not be null
)null
if none found