@FunctionalInterface public static interface Thread.UncaughtExceptionHandler
当一个线程要终止由于未捕获到异常的Java虚拟机将使用查询线程其UncaughtExceptionHandler Thread.getUncaughtExceptionHandler()
,将调用处理程序的uncaughtException方法,将线程和异常作为参数。 如果一个线程一直没有其UncaughtExceptionHandler明确设置,那么它ThreadGroup对象充当其UncaughtExceptionHandler。 如果ThreadGroup对象没有处理异常的特殊要求,则可以将调用转发到default uncaught exception handler 。
Modifier and Type | Method and Description |
---|---|
void |
uncaughtException(Thread t, Throwable e)
当给定的线程由于给定的未捕获异常而终止时调用方法。
|
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.