Package org.springframework.cache.jcache

# Class JCacheCacheManager

java.lang.Object
org.springframework.cache.support.AbstractCacheManager
org.springframework.cache.transaction.AbstractTransactionSupportingCacheManager
org.springframework.cache.jcache.JCacheCacheManager

All Implemented Interfaces:
  `org.springframework.beans.factory.InitializingBean`, `org.springframework.cache.CacheManager`

public class JCacheCacheManager extends AbstractTransactionSupportingCacheManager
`CacheManager` implementation backed by a JCache `javax.cache.CacheManager`.

Note: This class has been updated for JCache 1.0, as of Spring 4.0.

Since:
  3.2
Author:
  Juergen Hoeller, Stephane Nicoll
See Also:
  - `JCacheCache`

## Constructor Summary

Constructors
Constructor
Description
`JCacheCacheManager()`
Create a new `JCacheCacheManager` without a backing JCache `javax.cache.CacheManager`.
`JCacheCacheManager(javax.cache.CacheManager cacheManager)`
Create a new `JCacheCacheManager` for the given backing JCache `javax.cache.CacheManager`.

## Method Summary

Modifier and Type
Method
Description
`void`
`afterPropertiesSet()`
`javax.cache.CacheManager`
`getCacheManager()`
Return the backing JCache `javax.cache.CacheManager`.
`protected org.springframework.cache.Cache`
`getMissingCache(String name)`
`boolean`
`isAllowNullValues()`
Return whether this cache manager accepts and converts `null` values for all of its caches.
`protected Collection<org.springframework.cache.Cache>`
`loadCaches()`
`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 `javax.cache.CacheManager`.

### Methods inherited from class org.springframework.cache.transaction.AbstractTransactionSupportingCacheManager

`decorateCache, isTransactionAware, setTransactionAware`

### Methods inherited from class org.springframework.cache.support.AbstractCacheManager

`getCache, getCacheNames, initializeCaches, lookupCache`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### JCacheCacheManager

public JCacheCacheManager()
Create a new `JCacheCacheManager` without a backing JCache `javax.cache.CacheManager`.

The backing JCache `javax.cache.CacheManager` can be set via the `setCacheManager(javax.cache.CacheManager)` bean property.

### JCacheCacheManager

public JCacheCacheManager(javax.cache.CacheManager cacheManager)
Create a new `JCacheCacheManager` for the given backing JCache `javax.cache.CacheManager`.

Parameters:
  `cacheManager` - the backing JCache `javax.cache.CacheManager`

## Method Details

### setCacheManager

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

### getCacheManager

@Nullable public javax.cache.CacheManager getCacheManager()
Return the backing JCache `javax.cache.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`s.

### isAllowNullValues

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

### afterPropertiesSet

public void afterPropertiesSet()

Specified by:
  `afterPropertiesSet` in interface `org.springframework.beans.factory.InitializingBean`
Overrides:
  `afterPropertiesSet` in class `org.springframework.cache.support.AbstractCacheManager`

### loadCaches

protected Collection<org.springframework.cache.Cache> loadCaches()

Specified by:
  `loadCaches` in class `org.springframework.cache.support.AbstractCacheManager`

### getMissingCache

@Nullable protected org.springframework.cache.Cache getMissingCache(String name)

Overrides:
  `getMissingCache` in class `org.springframework.cache.support.AbstractCacheManager`