public abstract class

AbstractCacheManager

extends Object
implements InitializingBean CacheManager
java.lang.Object
   ↳ org.springframework.cache.support.AbstractCacheManager
Known Direct Subclasses

Class Overview

Abstract base class implementing the common CacheManager methods. Useful for 'static' environments where the backing caches do not change.

Summary

Public Constructors
AbstractCacheManager()
Public Methods
void afterPropertiesSet()
Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).
<K, V> Cache<K, V> getCache(String name)
Returns the cache associated with the given name.
Collection<String> getCacheNames()
Returns a collection of the caches known by this cache manager.
Protected Methods
final ConcurrentMap<StringCache<?, ?>> getCacheMap()
Returns the internal cache map.
abstract Collection<Cache<?, ?>> loadCaches()
Loads the caches into the cache manager.
[Expand]
Inherited Methods
From class java.lang.Object
From interface org.springframework.beans.factory.InitializingBean
From interface org.springframework.cache.CacheManager

Public Constructors

public AbstractCacheManager ()

Public Methods

public void afterPropertiesSet ()

Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).

This method allows the bean instance to perform initialization only possible when all bean properties have been set and to throw an exception in the event of misconfiguration.

public Cache<K, V> getCache (String name)

Returns the cache associated with the given name.

Parameters
name cache identifier - cannot be null
Returns
  • associated cache or null if none is found

public Collection<String> getCacheNames ()

Returns a collection of the caches known by this cache manager.

Returns
  • names of caches known by the cache manager.

Protected Methods

protected final ConcurrentMap<StringCache<?, ?>> getCacheMap ()

Returns the internal cache map.

Returns
  • internal cache map

protected abstract Collection<Cache<?, ?>> loadCaches ()

Loads the caches into the cache manager. Occurs at startup. The returned collection should not be null.