abstract class CacheAspectSupport : AbstractCacheInvoker, BeanFactoryAware, InitializingBean, SmartInitializingSingleton
Base class for caching aspects, such as the CacheInterceptor or an AspectJ aspect.
This enables the underlying Spring caching infrastructure to be used easily to implement an aspect for any aspect system.
Subclasses are responsible for calling methods in this class in the correct order.
Uses the Strategy design pattern. A CacheResolver implementation will resolve the actual cache(s) to use, and a CacheOperationSource is used for determining caching operations.
A cache aspect is serializable if its CacheResolver and CacheOperationSource are serializable.
Author
Costin Leau
Author
Juergen Hoeller
Author
Chris Beams
Author
Phillip Webb
Author
Sam Brannen
Author
Stephane Nicoll
Since
3.1
CacheAspectSupport()
Base class for caching aspects, such as the CacheInterceptor or an AspectJ aspect. This enables the underlying Spring caching infrastructure to be used easily to implement an aspect for any aspect system. Subclasses are responsible for calling methods in this class in the correct order. Uses the Strategy design pattern. A CacheResolver implementation will resolve the actual cache(s) to use, and a CacheOperationSource is used for determining caching operations. A cache aspect is serializable if its |
open fun afterPropertiesSet(): Unit |
|
open fun afterSingletonsInstantiated(): Unit |
|
open fun getCacheOperationSource(): CacheOperationSource
Return the CacheOperationSource for this cache aspect. |
|
open fun getCacheResolver(): CacheResolver
Return the default CacheResolver that this cache aspect delegates to. |
|
open fun getKeyGenerator(): KeyGenerator
Return the default KeyGenerator that this cache aspect delegates to. |
|
open fun setBeanFactory(beanFactory: BeanFactory): Unit
Set the containing BeanFactory for CacheManager and other service lookups. |
|
open fun setCacheManager(cacheManager: CacheManager): Unit
Set the CacheManager to use to create a default CacheResolver. Replace the current CacheResolver, if any. |
|
open fun setCacheOperationSources(vararg cacheOperationSources: CacheOperationSource): Unit
Set one or more cache operation sources which are used to find the cache attributes. If more than one source is provided, they will be aggregated using a CompositeCacheOperationSource. |
|
open fun setCacheResolver(cacheResolver: CacheResolver): Unit
Set the default CacheResolver that this cache aspect should delegate to if no specific cache resolver has been set for the operation. The default resolver resolves the caches against their names and the default cache manager. |
|
open fun setKeyGenerator(keyGenerator: KeyGenerator): Unit
Set the default KeyGenerator that this cache aspect should delegate to if no specific key generator has been set for the operation. The default is a SimpleKeyGenerator |