Interface CacheEventDispatcher.EventErrorHandler<K,V>

Type Parameters:
K - key type | 键类型
V - value type | 值类型
Enclosing class:
CacheEventDispatcher<K,V>
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public static interface CacheEventDispatcher.EventErrorHandler<K,V>
Error handler for listener exceptions 监听器异常的错误处理器
Since:
JDK 25, opencode-base-cache V1.0.0
Author:
Leon Soo www.LeonSoo.com
  • Method Details

    • handleError

      void handleError(CacheEvent<K,V> event, CacheEventListener<K,V> listener, Exception error)
      Handle listener error 处理监听器错误
      Parameters:
      event - the event | 事件
      listener - the listener that failed | 失败的监听器
      error - the exception | 异常
    • logAndContinue

      static <K,V> CacheEventDispatcher.EventErrorHandler<K,V> logAndContinue()
      Default handler that logs and continues 默认处理器:记录日志并继续
      Type Parameters:
      K - key type | 键类型
      V - value type | 值类型
      Returns:
      default handler | 默认处理器
    • rethrow

      static <K,V> CacheEventDispatcher.EventErrorHandler<K,V> rethrow()
      Handler that rethrows exceptions 重新抛出异常的处理器
      Type Parameters:
      K - key type | 键类型
      V - value type | 值类型
      Returns:
      rethrowing handler | 重新抛出的处理器
    • ignore

      static <K,V> CacheEventDispatcher.EventErrorHandler<K,V> ignore()
      Handler that silently ignores errors 静默忽略错误的处理器
      Type Parameters:
      K - key type | 键类型
      V - value type | 值类型
      Returns:
      ignoring handler | 忽略的处理器