public class JCacheInterceptor extends JCacheAspectSupport implements MethodInterceptor, Serializable
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.
CacheInterceptor
,
Serialized Formlogger
errorHandler
Constructor and Description |
---|
JCacheInterceptor()
Construct a new
JCacheInterceptor with the default error handler. |
JCacheInterceptor(Supplier<CacheErrorHandler> errorHandler)
Construct a new
JCacheInterceptor with the given error handler. |
Modifier and Type | Method and Description |
---|---|
Object |
invoke(MethodInvocation invocation)
Implement this method to perform extra treatments before and
after the invocation.
|
afterPropertiesSet, execute, getCacheOperationSource, invokeOperation, setCacheOperationSource
doClear, doEvict, doGet, doPut, getErrorHandler, setErrorHandler
public JCacheInterceptor()
JCacheInterceptor
with the default error handler.public JCacheInterceptor(@Nullable Supplier<CacheErrorHandler> errorHandler)
JCacheInterceptor
with the given error handler.errorHandler
- a supplier for the error handler to use,
applying the default error handler if the supplier is not resolvable@Nullable public Object invoke(MethodInvocation invocation) throws Throwable
MethodInterceptor
Joinpoint.proceed()
.invoke
in interface MethodInterceptor
invocation
- the method invocation joinpointJoinpoint.proceed()
;
might be intercepted by the interceptorThrowable
- if the interceptors or the target object
throws an exception