spring-framework / org.springframework.cache.transaction / TransactionAwareCacheManagerProxy

TransactionAwareCacheManagerProxy

open class TransactionAwareCacheManagerProxy : CacheManager, InitializingBean

Proxy for a target CacheManager, exposing transaction-aware Cache objects which synchronize their Cache#put operations with Spring-managed transactions (through Spring's org.springframework.transaction.support.TransactionSynchronizationManager, performing the actual cache put operation only in the after-commit phase of a successful transaction. If no transaction is active, Cache#put operations will be performed immediately, as usual.

Author
Juergen Hoeller

Since
3.2

See Also
#setTargetCacheManagerTransactionAwareCacheDecoratororg.springframework.transaction.support.TransactionSynchronizationManager

Constructors

<init>

TransactionAwareCacheManagerProxy()

Create a new TransactionAwareCacheManagerProxy, setting the target CacheManager through the #setTargetCacheManager bean property.

TransactionAwareCacheManagerProxy(targetCacheManager: CacheManager)

Create a new TransactionAwareCacheManagerProxy for the given target CacheManager.

Functions

afterPropertiesSet

open fun afterPropertiesSet(): Unit

getCache

open fun getCache(name: String): Cache

getCacheNames

open fun getCacheNames(): MutableCollection<String>

setTargetCacheManager

open fun setTargetCacheManager(targetCacheManager: CacheManager): Unit

Set the target CacheManager to proxy.