public abstract class AbstractNoticeGlobalExceptionHandler extends Thread implements GlobalExceptionHandler, org.springframework.beans.factory.InitializingBean
Thread.State, Thread.UncaughtExceptionHandler| 限定符和类型 | 字段和说明 |
|---|---|
protected String |
applicationName |
protected ExceptionHandleConfig |
config |
protected ExceptionNotifierHolder |
notifierHolder |
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY| 限定符 | 构造器和说明 |
|---|---|
protected |
AbstractNoticeGlobalExceptionHandler(ExceptionHandleConfig config,
ExceptionNotifierHolder notifierHolder,
String applicationName) |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
afterPropertiesSet() |
void |
handle(Throwable throwable)
处理异常信息
实现类可以在此方法中定义具体的异常处理逻辑, 如记录日志、发送通知、存储异常信息等。
|
void |
handleExceptionNoticeResponse(ExceptionNoticeResponse response)
处理通知结果
|
ExceptionMessage |
init(Throwable t) |
void |
run() |
ExceptionNoticeResponse |
send(ExceptionMessage sendMessage)
发送通知
|
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yieldprotected final ExceptionHandleConfig config
protected final ExceptionNotifierHolder notifierHolder
protected final String applicationName
protected AbstractNoticeGlobalExceptionHandler(ExceptionHandleConfig config, ExceptionNotifierHolder notifierHolder, String applicationName)
public ExceptionMessage init(Throwable t)
public ExceptionNoticeResponse send(ExceptionMessage sendMessage)
sendMessage - 发送的消息public void handleExceptionNoticeResponse(ExceptionNoticeResponse response)
response - 异常通知响应public void handle(Throwable throwable)
GlobalExceptionHandler实现类可以在此方法中定义具体的异常处理逻辑, 如记录日志、发送通知、存储异常信息等。
handle 在接口中 GlobalExceptionHandlerthrowable - 需要处理的异常对象public void afterPropertiesSet()
afterPropertiesSet 在接口中 org.springframework.beans.factory.InitializingBeanCopyright © 2025. All rights reserved.