@FunctionalInterface public static interface Thread.UncaughtExceptionHandler
当一个线程要终止由于未捕获的异常的java虚拟机将查询线程使用Thread.getUncaughtExceptionHandler()
其UncaughtExceptionHandler将调用处理程序的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.