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, Juergen Hoeller
- See Also:
- 
Field SummaryFields inherited from class org.springframework.cache.jcache.interceptor.JCacheAspectSupportloggerFields inherited from class org.springframework.cache.interceptor.AbstractCacheInvokererrorHandler
- 
Constructor SummaryConstructorsConstructorDescriptionConstruct a newJCacheInterceptorwith the default error handler.JCacheInterceptor(Supplier<CacheErrorHandler> errorHandler) Construct a newJCacheInterceptorwith the given error handler.
- 
Method SummaryModifier and TypeMethodDescriptioninvoke(MethodInvocation invocation) Implement this method to perform extra treatments before and after the invocation.Methods inherited from class org.springframework.cache.jcache.interceptor.JCacheAspectSupportafterPropertiesSet, execute, getCacheOperationSource, invokeOperation, setCacheOperationSourceMethods inherited from class org.springframework.cache.interceptor.AbstractCacheInvokerdoClear, doEvict, doGet, doGet, doPut, doRetrieve, doRetrieve, getErrorHandler, setErrorHandler
- 
Constructor Details- 
JCacheInterceptorpublic JCacheInterceptor()Construct a newJCacheInterceptorwith the default error handler.
- 
JCacheInterceptorConstruct a newJCacheInterceptorwith the given error handler.- Parameters:
- errorHandler- a supplier for the error handler to use, applying the default error handler if the supplier is not resolvable
- Since:
- 5.1
 
 
- 
- 
Method Details- 
invokeDescription copied from interface:MethodInterceptorImplement this method to perform extra treatments before and after the invocation. Polite implementations would certainly like to invokeJoinpoint.proceed().- Specified by:
- invokein interface- MethodInterceptor
- 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
 
 
-