Class JCacheInterceptor
- java.lang.Object
- org.springframework.cache.interceptor.AbstractCacheInvoker
- org.springframework.cache.jcache.interceptor.JCacheAspectSupport
- org.springframework.cache.jcache.interceptor.JCacheInterceptor
- All Implemented Interfaces:
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
JCacheAspectSupport
class which contains the integration with Spring's underlying caching API. JCacheInterceptor simply calls the relevant superclass method.JCacheInterceptors are thread-safe.
- Since:
- 4.1
- Author:
- Stephane Nicoll
- See Also:
CacheInterceptor
, Serialized Form
Field Summary
Fields inherited from class org.springframework.cache.jcache.interceptor.JCacheAspectSupport
logger
Constructor Summary
Constructors Constructor Description JCacheInterceptor()
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Object
invoke(MethodInvocation invocation)
Implement this method to perform extra treatments before and after the invocation.Methods inherited from class org.springframework.cache.jcache.interceptor.JCacheAspectSupport
afterPropertiesSet, execute, getCacheOperationSource, invokeOperation, setCacheOperationSource
Methods inherited from class org.springframework.cache.interceptor.AbstractCacheInvoker
doClear, doEvict, doGet, doPut, getErrorHandler, setErrorHandler
Constructor Detail
JCacheInterceptor
public JCacheInterceptor()
Method Detail
invoke
public Object invoke(MethodInvocation invocation) throws Throwable
Description copied from interface:MethodInterceptor
Implement this method to perform extra treatments before and after the invocation. Polite implementations would certainly like to invokeJoinpoint.proceed()
.- Specified by:
invoke
in interfaceMethodInterceptor
- Parameters:
invocation
- the method invocation joinpoint- Returns:
- the result of the call to
Joinpoint.proceed()
; might be intercepted by the interceptor - Throws:
Throwable
- if the interceptors or the target object throws an exception