类 CacheInterceptor
- java.lang.Object
- org.springframework.cache.interceptor.AbstractCacheInvoker
- org.springframework.cache.interceptor.CacheAspectSupport
- org.springframework.cache.interceptor.CacheInterceptor
- 所有已实现的接口:
Serializable
,Advice
,Interceptor
,MethodInterceptor
,Aware
,BeanFactoryAware
,InitializingBean
,SmartInitializingSingleton
public class CacheInterceptor extends CacheAspectSupport implements MethodInterceptor, Serializable
AOP Alliance MethodInterceptor for declarative cache management using the common Spring caching infrastructure (Cache
).Derives from the
CacheAspectSupport
class which contains the integration with Spring's underlying caching API. CacheInterceptor simply calls the relevant superclass methods in the correct order.CacheInterceptors are thread-safe.
- 从以下版本开始:
- 3.1
- 作者:
- Costin Leau, Juergen Hoeller
- 另请参阅:
- 序列化表格
嵌套类概要
从类继承的嵌套类/接口 org.springframework.cache.interceptor.CacheAspectSupport
CacheAspectSupport.CacheOperationContext, CacheAspectSupport.CacheOperationMetadata
字段概要
从类继承的字段 org.springframework.cache.interceptor.CacheAspectSupport
logger
构造器概要
构造器 构造器 说明 CacheInterceptor()
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 Object
invoke(MethodInvocation invocation)
Implement this method to perform extra treatments before and after the invocation.从类继承的方法 org.springframework.cache.interceptor.CacheAspectSupport
afterPropertiesSet, afterSingletonsInstantiated, clearMetadataCache, execute, getBean, getCacheOperationMetadata, getCacheOperationSource, getCacheResolver, getCaches, getKeyGenerator, getOperationContext, invokeOperation, methodIdentification, setApplicationContext, setBeanFactory, setCacheManager, setCacheOperationSources, setCacheResolver, setKeyGenerator
从类继承的方法 org.springframework.cache.interceptor.AbstractCacheInvoker
doClear, doEvict, doGet, doPut, getErrorHandler, setErrorHandler
构造器详细资料
CacheInterceptor
public CacheInterceptor()
方法详细资料
invoke
public Object invoke(MethodInvocation invocation) throws Throwable
从接口复制的说明:MethodInterceptor
Implement this method to perform extra treatments before and after the invocation. Polite implementations would certainly like to invokeJoinpoint.proceed()
.- 指定者:
invoke
在接口中MethodInterceptor
- 参数:
invocation
- the method invocation joinpoint- 返回:
- the result of the call to
Joinpoint.proceed()
; might be intercepted by the interceptor - 抛出:
Throwable
- if the interceptors or the target object throws an exception