类 CacheProxyFactoryBean
java.lang.Object
cn.taketoday.aop.framework.ProxyConfig
cn.taketoday.aop.framework.AbstractSingletonProxyFactoryBean
cn.taketoday.cache.interceptor.CacheProxyFactoryBean
- 所有已实现的接口:
Aware,BeanClassLoaderAware,BeanFactoryAware,FactoryBean<Object>,InitializingBean,SmartInitializingSingleton,Serializable
public class CacheProxyFactoryBean
extends AbstractSingletonProxyFactoryBean
implements BeanFactoryAware, SmartInitializingSingleton
Proxy factory bean for simplified declarative caching handling.
This is a convenient alternative to a standard AOP
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 Framework reference documentation for more information.
- 从以下版本开始:
- 4.0
- 作者:
- Costin Leau, Juergen Hoeller
- 另请参阅:
-
字段概要
从接口继承的字段 cn.taketoday.beans.factory.FactoryBean
OBJECT_TYPE_ATTRIBUTE -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明voidprotected ObjectvoidsetBeanFactory(BeanFactory beanFactory) voidsetCacheManager(CacheManager cacheManager) Set theCacheManagerto use to create a defaultCacheResolver.voidsetCacheOperationSources(CacheOperationSource... cacheOperationSources) Set one or more sources to find cache operations.voidsetCacheResolver(CacheResolver cacheResolver) Set the defaultCacheResolverthat this cache aspect should delegate to if no specific cache resolver has been set for the operation.voidsetKeyGenerator(KeyGenerator keyGenerator) Set the defaultKeyGeneratorthat this cache aspect should delegate to if no specific key generator has been set for the operation.voidsetPointcut(Pointcut pointcut) Set a pointcut, i.e. a bean that triggers conditional invocation of theCacheInterceptordepending on the method and attributes passed.从类继承的方法 cn.taketoday.aop.framework.AbstractSingletonProxyFactoryBean
afterPropertiesSet, createTargetSource, getObject, getObjectType, isSingleton, postProcessProxyFactory, setAdvisorAdapterRegistry, setBeanClassLoader, setPostInterceptors, setPreInterceptors, setProxyClassLoader, setProxyInterfaces, setTarget从类继承的方法 cn.taketoday.aop.framework.ProxyConfig
copyFrom, isExposeProxy, isFrozen, isOpaque, isOptimize, isProxyTargetClass, setExposeProxy, setFrozen, setOpaque, setOptimize, setProxyTargetClass, toString
-
构造器详细资料
-
CacheProxyFactoryBean
public CacheProxyFactoryBean()
-
-
方法详细资料
-
setCacheOperationSources
Set one or more sources to find cache operations. -
setKeyGenerator
Set the defaultKeyGeneratorthat this cache aspect should delegate to if no specific key generator has been set for the operation.The default is a
SimpleKeyGenerator. -
setCacheResolver
Set the defaultCacheResolverthat 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.
-
setCacheManager
Set theCacheManagerto use to create a defaultCacheResolver. Replace the currentCacheResolver, if any. -
setPointcut
Set a pointcut, i.e. a bean that triggers conditional invocation of theCacheInterceptordepending on the method and attributes passed.Note: Additional interceptors are always invoked.
-
setBeanFactory
- 指定者:
setBeanFactory在接口中BeanFactoryAware
-
afterSingletonsInstantiated
public void afterSingletonsInstantiated() -
createMainInterceptor
-