Top Description Fields Constructors Methods
org.springframework.cache.transaction

public abstract Class AbstractTransactionSupportingCacheManager

extends AbstractCacheManager
Class Inheritance
Known Direct Subclasses
org.springframework.cache.jcache.JCacheCacheManager
Imports
org.springframework.cache.Cache, org.springframework.cache.support.AbstractCacheManager

Base class for CacheManager implementations that want to support built-in awareness of Spring-managed transactions. This usually needs to be switched on explicitly through the setTransactionAware bean property.
Author
Juergen Hoeller
Since
3.2
See Also
setTransactionAware, TransactionAwareCacheDecorator, TransactionAwareCacheManagerProxy

Field Summary

Modifier and TypeField and Description
private boolean

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected Cache
decorateCache(Cache
the Cache object to be added to this CacheManager
cache
)

Overrides org.springframework.cache.support.AbstractCacheManager.decorateCache.

Decorate the given Cache object if necessary.

public boolean
isTransactionAware()

Return whether this CacheManager has been configured to be transaction-aware.

public void
setTransactionAware(boolean transactionAware)

Set whether this CacheManager should expose transaction-aware Cache objects.

Inherited from org.springframework.cache.support.AbstractCacheManager:
afterPropertiesSetgetCachegetCacheNamesgetMissingCacheinitializeCachesloadCacheslookupCache

Field Detail

transactionAwareback to summary
private boolean transactionAware

Constructor Detail

AbstractTransactionSupportingCacheManagerback to summary
public AbstractTransactionSupportingCacheManager()

Method Detail

decorateCacheback to summary
protected Cache decorateCache(Cache cache)

Overrides org.springframework.cache.support.AbstractCacheManager.decorateCache.

Doc from org.springframework.cache.support.AbstractCacheManager.decorateCache.

Decorate the given Cache object if necessary.

Parameters
cache:Cache

the Cache object to be added to this CacheManager

Returns:Cache

the decorated Cache object to be used instead, or simply the passed-in Cache object by default

Annotations
@Override
isTransactionAwareback to summary
public boolean isTransactionAware()

Return whether this CacheManager has been configured to be transaction-aware.

setTransactionAwareback to summary
public void setTransactionAware(boolean transactionAware)

Set whether this CacheManager should expose transaction-aware Cache objects.

Default is "false". Set this to "true" to synchronize cache put/evict operations with ongoing Spring-managed transactions, performing the actual cache put/evict operation only in the after-commit phase of a successful transaction.