org.springframework.cache.jcache.interceptor

Class JCacheInterceptor

    • Constructor Detail

      • JCacheInterceptor

        public JCacheInterceptor()
        Construct a new JCacheInterceptor with the default error handler.
      • JCacheInterceptor

        public JCacheInterceptor(@Nullable
                                 java.util.function.Supplier<CacheErrorHandler> errorHandler)
        Construct a new JCacheInterceptor with 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 Detail

      • invoke

        @Nullable
        public java.lang.Object invoke(MethodInvocation invocation)
                                          throws java.lang.Throwable
        Description copied from interface: MethodInterceptor
        Implement this method to perform extra treatments before and after the invocation. Polite implementations would certainly like to invoke Joinpoint.proceed().
        Specified by:
        invoke in interface MethodInterceptor
        Parameters:
        invocation - the method invocation joinpoint
        Returns:
        the result of the call to Joinpoint.proceed(); might be intercepted by the interceptor
        Throws:
        java.lang.Throwable - if the interceptors or the target object throws an exception