public class CacheProxyFactoryBean
extends org.springframework.aop.framework.AbstractSingletonProxyFactoryBean
implements org.springframework.beans.factory.BeanFactoryAware, org.springframework.beans.factory.SmartInitializingSingleton
ProxyFactoryBean
with a separate CacheInterceptor definition.
This class is designed to facilitate declarative cache demarcation: namely, wrapping
a singleton target object with a caching proxy, proxying all the interfaces that the
target implements. Exists primarily for third-party framework integration.
Users should favor the cache: XML namespace
@Cacheable annotation.
See the declarative annotation-based caching section
of the Spring reference documentation for more information.
ProxyFactoryBean,
CacheInterceptor,
序列化表格| 构造器和说明 |
|---|
CacheProxyFactoryBean() |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
afterSingletonsInstantiated() |
protected Object |
createMainInterceptor() |
void |
setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory) |
void |
setCacheManager(CacheManager cacheManager)
Set the
CacheManager to use to create a default CacheResolver. |
void |
setCacheOperationSources(CacheOperationSource... cacheOperationSources)
Set one or more sources to find cache operations.
|
void |
setCacheResolver(CacheResolver cacheResolver)
Set the default
CacheResolver that this cache aspect should delegate
to if no specific cache resolver has been set for the operation. |
void |
setKeyGenerator(KeyGenerator keyGenerator)
Set the default
KeyGenerator that this cache aspect should delegate to
if no specific key generator has been set for the operation. |
void |
setPointcut(org.springframework.aop.Pointcut pointcut)
Set a pointcut, i.e. a bean that triggers conditional invocation of the
CacheInterceptor depending on the method and attributes passed. |
afterPropertiesSet, createTargetSource, getObject, getObjectType, isSingleton, postProcessProxyFactory, setAdvisorAdapterRegistry, setBeanClassLoader, setPostInterceptors, setPreInterceptors, setProxyClassLoader, setProxyInterfaces, setTargetpublic void setCacheOperationSources(CacheOperationSource... cacheOperationSources)
public void setKeyGenerator(KeyGenerator keyGenerator)
KeyGenerator that this cache aspect should delegate to
if no specific key generator has been set for the operation.
The default is a SimpleKeyGenerator.
public void setCacheResolver(CacheResolver cacheResolver)
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.
public void setCacheManager(CacheManager cacheManager)
CacheManager to use to create a default CacheResolver.
Replace the current CacheResolver, if any.CacheAspectSupport.setCacheManager(org.springframework.cache.CacheManager)public void setPointcut(org.springframework.aop.Pointcut pointcut)
CacheInterceptor depending on the method and attributes passed.
Note: Additional interceptors are always invoked.
AbstractSingletonProxyFactoryBean.setPreInterceptors(java.lang.Object[]),
AbstractSingletonProxyFactoryBean.setPostInterceptors(java.lang.Object[])public void setBeanFactory(org.springframework.beans.factory.BeanFactory beanFactory)
setBeanFactory 在接口中 org.springframework.beans.factory.BeanFactoryAwarepublic void afterSingletonsInstantiated()
afterSingletonsInstantiated 在接口中 org.springframework.beans.factory.SmartInitializingSingletonprotected Object createMainInterceptor()
createMainInterceptor 在类中 org.springframework.aop.framework.AbstractSingletonProxyFactoryBean