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.
Error handler for listener exceptions
监听器异常的错误处理器
- Since:
- JDK 25, opencode-base-cache V1.0.0
- Author:
- Leon Soo www.LeonSoo.com
-
Method Summary
Modifier and TypeMethodDescriptionvoidhandleError(CacheEvent<K, V> event, CacheEventListener<K, V> listener, Exception error) Handle listener error 处理监听器错误static <K,V> CacheEventDispatcher.EventErrorHandler <K, V> ignore()Handler that silently ignores errors 静默忽略错误的处理器static <K,V> CacheEventDispatcher.EventErrorHandler <K, V> Default handler that logs and continues 默认处理器:记录日志并继续static <K,V> CacheEventDispatcher.EventErrorHandler <K, V> rethrow()Handler that rethrows exceptions 重新抛出异常的处理器
-
Method Details
-
handleError
Handle listener error 处理监听器错误- Parameters:
event- the event | 事件listener- the listener that failed | 失败的监听器error- the exception | 异常
-
logAndContinue
Default handler that logs and continues 默认处理器:记录日志并继续- Type Parameters:
K- key type | 键类型V- value type | 值类型- Returns:
- default handler | 默认处理器
-
rethrow
Handler that rethrows exceptions 重新抛出异常的处理器- Type Parameters:
K- key type | 键类型V- value type | 值类型- Returns:
- rethrowing handler | 重新抛出的处理器
-
ignore
Handler that silently ignores errors 静默忽略错误的处理器- Type Parameters:
K- key type | 键类型V- value type | 值类型- Returns:
- ignoring handler | 忽略的处理器
-