Spring Framework

org.springframework.cache.jcache
Class JCacheCacheManager

java.lang.Object
  extended by org.springframework.cache.support.AbstractCacheManager
      extended by org.springframework.cache.jcache.JCacheCacheManager
All Implemented Interfaces:
InitializingBean, CacheManager

public class JCacheCacheManager
extends AbstractCacheManager

CacheManager implementation backed by a JCache CacheManager.

Since:
3.2
Author:
Juergen Hoeller

Constructor Summary
JCacheCacheManager()
           
 
Method Summary
 Cache getCache(java.lang.String name)
          Return the cache associated with the given name.
 javax.cache.CacheManager getCacheManager()
          Return the backing JCache CacheManager.
 boolean isAllowNullValues()
          Return whether this cache manager accepts and converts null values for all of its caches.
protected  java.util.Collection<Cache> loadCaches()
          Load the caches for this cache manager.
 void setAllowNullValues(boolean allowNullValues)
          Specify whether to accept and convert null values for all caches in this cache manager.
 void setCacheManager(javax.cache.CacheManager cacheManager)
          Set the backing JCache CacheManager.
 
Methods inherited from class org.springframework.cache.support.AbstractCacheManager
addCache, afterPropertiesSet, getCacheNames
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JCacheCacheManager

public JCacheCacheManager()
Method Detail

setCacheManager

public void setCacheManager(javax.cache.CacheManager cacheManager)
Set the backing JCache CacheManager.


getCacheManager

public javax.cache.CacheManager getCacheManager()
Return the backing JCache CacheManager.


setAllowNullValues

public void setAllowNullValues(boolean allowNullValues)
Specify whether to accept and convert null values for all caches in this cache manager.

Default is "true", despite JSR-107 itself not supporting null values. An internal holder object will be used to store user-level null values.


isAllowNullValues

public boolean isAllowNullValues()
Return whether this cache manager accepts and converts null values for all of its caches.


loadCaches

protected java.util.Collection<Cache> loadCaches()
Description copied from class: AbstractCacheManager
Load the caches for this cache manager. Occurs at startup. The returned collection must not be null.

Specified by:
loadCaches in class AbstractCacheManager

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
Overrides:
getCache in class AbstractCacheManager
Parameters:
name - cache identifier (must not be null)
Returns:
associated cache, or null if none is found

Spring Framework