类 JCacheInterceptor
- java.lang.Object
- org.springframework.cache.interceptor.AbstractCacheInvoker
- org.springframework.cache.jcache.interceptor.JCacheAspectSupport
- org.springframework.cache.jcache.interceptor.JCacheInterceptor
- 所有已实现的接口:
Serializable,Advice,Interceptor,MethodInterceptor,InitializingBean
public class JCacheInterceptor extends JCacheAspectSupport implements MethodInterceptor, Serializable
AOP Alliance MethodInterceptor for declarative cache management using JSR-107 caching annotations.Derives from the
JCacheAspectSupportclass which contains the integration with Spring's underlying caching API. JCacheInterceptor simply calls the relevant superclass method.JCacheInterceptors are thread-safe.
- 从以下版本开始:
- 4.1
- 作者:
- Stephane Nicoll, Juergen Hoeller
- 另请参阅:
CacheInterceptor, 序列化表格
字段概要
从类继承的字段 org.springframework.cache.jcache.interceptor.JCacheAspectSupport
logger
从类继承的字段 org.springframework.cache.interceptor.AbstractCacheInvoker
errorHandler
构造器概要
构造器 构造器 说明 JCacheInterceptor()Construct a newJCacheInterceptorwith the default error handler.JCacheInterceptor(Supplier<CacheErrorHandler> errorHandler)Construct a newJCacheInterceptorwith the given error handler.
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 Objectinvoke(MethodInvocation invocation)Implement this method to perform extra treatments before and after the invocation.从类继承的方法 org.springframework.cache.jcache.interceptor.JCacheAspectSupport
afterPropertiesSet, execute, getCacheOperationSource, invokeOperation, setCacheOperationSource
从类继承的方法 org.springframework.cache.interceptor.AbstractCacheInvoker
doClear, doEvict, doGet, doPut, getErrorHandler, setErrorHandler
构造器详细资料
JCacheInterceptor
public JCacheInterceptor()
Construct a newJCacheInterceptorwith the default error handler.
JCacheInterceptor
public JCacheInterceptor(@Nullable Supplier<CacheErrorHandler> errorHandler)
Construct a newJCacheInterceptorwith the given error handler.- 参数:
errorHandler- a supplier for the error handler to use, applying the default error handler if the supplier is not resolvable- 从以下版本开始:
- 5.1
方法详细资料
invoke
@Nullable public Object invoke(MethodInvocation invocation) throws Throwable
从接口复制的说明:MethodInterceptorImplement 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