spring-context

org.springframework.cache.support
Class AbstractCacheManager

java.lang.Object
  extended by org.springframework.cache.support.AbstractCacheManager
All Implemented Interfaces:
org.springframework.beans.factory.InitializingBean, CacheManager
Direct Known Subclasses:
EhCacheCacheManager, JCacheCacheManager, SimpleCacheManager

public abstract class AbstractCacheManager
extends java.lang.Object
implements CacheManager, org.springframework.beans.factory.InitializingBean

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

Since:
3.1
Author:
Costin Leau, Juergen Hoeller

Constructor Summary
AbstractCacheManager()
           
 
Method Summary
protected  void addCache(Cache cache)
           
 void afterPropertiesSet()
           
 Cache getCache(java.lang.String name)
          Return the cache associated with the given name.
 java.util.Collection<java.lang.String> getCacheNames()
          Return a collection of the caches known by this cache manager.
protected abstract  java.util.Collection<? extends Cache> loadCaches()
          Load the caches for this cache manager.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractCacheManager

public AbstractCacheManager()
Method Detail

afterPropertiesSet

public void afterPropertiesSet()
Specified by:
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean

addCache

protected final void addCache(Cache cache)

getCache

public Cache getCache(java.lang.String name)
Description copied from interface: CacheManager
Return the cache associated with the given name.

Specified by:
getCache in interface CacheManager
Parameters:
name - cache identifier (must not be null)
Returns:
associated cache, or null if none is found

getCacheNames

public java.util.Collection<java.lang.String> getCacheNames()
Description copied from interface: CacheManager
Return a collection of the caches known by this cache manager.

Specified by:
getCacheNames in interface CacheManager
Returns:
names of caches known by the cache manager.

loadCaches

protected abstract java.util.Collection<? extends Cache> loadCaches()
Load the caches for this cache manager. Occurs at startup. The returned collection must not be null.


spring-context