org.springframework.cache.interceptor
Class CacheProxyFactoryBean
java.lang.Object
org.springframework.aop.framework.ProxyConfig
org.springframework.aop.framework.AbstractSingletonProxyFactoryBean
org.springframework.cache.interceptor.CacheProxyFactoryBean
- All Implemented Interfaces:
- java.io.Serializable, org.springframework.beans.factory.Aware, org.springframework.beans.factory.BeanClassLoaderAware, org.springframework.beans.factory.FactoryBean<java.lang.Object>, org.springframework.beans.factory.InitializingBean
public class CacheProxyFactoryBean
- extends org.springframework.aop.framework.AbstractSingletonProxyFactoryBean
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 Spring reference documentation for more information.
- Author:
- Costin Leau
- See Also:
ProxyFactoryBean
,
CacheInterceptor
,
Serialized Form
Method Summary |
protected java.lang.Object |
createMainInterceptor()
|
void |
setCacheOperationSources(CacheOperationSource... cacheOperationSources)
Set the sources used to find cache operations. |
void |
setPointcut(org.springframework.aop.Pointcut pointcut)
Set a pointcut, i.e a bean that can cause conditional invocation
of the CacheInterceptor depending on method and attributes passed. |
Methods inherited from class org.springframework.aop.framework.AbstractSingletonProxyFactoryBean |
afterPropertiesSet, createTargetSource, getObject, getObjectType, isSingleton, setAdvisorAdapterRegistry, setBeanClassLoader, setPostInterceptors, setPreInterceptors, setProxyClassLoader, setProxyInterfaces, setTarget |
Methods inherited from class org.springframework.aop.framework.ProxyConfig |
copyFrom, isExposeProxy, isFrozen, isOpaque, isOptimize, isProxyTargetClass, setExposeProxy, setFrozen, setOpaque, setOptimize, setProxyTargetClass, toString |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
CacheProxyFactoryBean
public CacheProxyFactoryBean()
setPointcut
public void setPointcut(org.springframework.aop.Pointcut pointcut)
- Set a pointcut, i.e a bean that can cause conditional invocation
of the CacheInterceptor depending on method and attributes passed.
Note: Additional interceptors are always invoked.
- See Also:
AbstractSingletonProxyFactoryBean.setPreInterceptors(java.lang.Object[])
,
AbstractSingletonProxyFactoryBean.setPostInterceptors(java.lang.Object[])
createMainInterceptor
protected java.lang.Object createMainInterceptor()
- Specified by:
createMainInterceptor
in class org.springframework.aop.framework.AbstractSingletonProxyFactoryBean
setCacheOperationSources
public void setCacheOperationSources(CacheOperationSource... cacheOperationSources)
- Set the sources used to find cache operations.