Interface CacheErrorHandler

    • Method Detail

      • handleInvalidateError

        default boolean handleInvalidateError​(Cache<?> cache,
                                              java.lang.Object key,
                                              java.lang.RuntimeException e)
        Handles a cache CacheInvalidate error. Defaults to simply rethrowing the error. By returning false cache invalidate errors will instead to be swallowed and ignored.
        Parameters:
        cache - The cache
        key - The key
        e - The error
        Returns:
        Whether the exception should be swallowed or rethrown. A value of true will rethrow he exception.
      • handleInvalidateError

        default boolean handleInvalidateError​(Cache<?> cache,
                                              java.lang.RuntimeException e)
        Handles a cache CacheInvalidate error. Defaults to simply rethrowing the error. By returning false cache invalidate errors will instead to be swallowed and ignored.
        Parameters:
        cache - The cache
        e - The error
        Returns:
        Whether the exception should be swallowed or rethrown. A value of true will rethrow he exception.
      • handlePutError

        default boolean handlePutError​(Cache<?> cache,
                                       java.lang.Object key,
                                       java.lang.Object result,
                                       java.lang.RuntimeException e)
        Handles a cache CachePut error. Defaults to simply rethrowing the error. By returning false cache write errors will instead to be swallowed and ignored.
        Parameters:
        cache - The cache
        key - The key name
        result - The result
        e - The error
        Returns:
        Whether the exception should be swallowed or rethrown. A value of true will rethrow he exception.
      • handleLoadError

        default boolean handleLoadError​(Cache<?> cache,
                                        java.lang.Object key,
                                        java.lang.RuntimeException e)
        Handles an error loading a value from the cache via Cacheable. Note that by returning false the behaviour can be customized such that cache related exceptions are ignored and the original method invoked.
        Parameters:
        cache - The cache
        key - The key
        e - The error
        Returns:
        Whether the exception should be swallowed or rethrown. A value of true will rethrow he exception.