|
|||||||||
| Home >> All >> java >> [ lang overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang
Interface Thread.UncaughtExceptionHandler

- All Known Implementing Classes:
- ThreadGroup
- Enclosing interface:
- Thread
- public static interface Thread.UncaughtExceptionHandler
This interface is used to handle uncaught exceptions
which cause a Thread to terminate. When
a thread, t, is about to terminate due to an uncaught
exception, the virtual machine looks for a class which
implements this interface, in order to supply it with
the dying thread and its uncaught exception.
The virtual machine makes two attempts to find an appropriate handler for the uncaught exception, in the following order:
-
t.getUncaughtExceptionHandler()-- the dying thread is queried first for a handler specific to that thread. -
t.getThreadGroup()-- the thread group of the dying thread is used to handle the exception. If the thread group has no special requirements for handling the exception, it may simply forward it on toThread.getDefaultUncaughtExceptionHandler(), the default handler, which is used as a last resort.
The first handler found is the one used to handle the uncaught exception.
- Since:
- 1.5
| Method Summary | |
void |
uncaughtException(Thread thr,
Throwable exc)
Invoked by the virtual machine with the dying thread and the uncaught exception. |
| Method Detail |
uncaughtException
public void uncaughtException(Thread thr, Throwable exc)
- Invoked by the virtual machine with the dying thread
and the uncaught exception. Any exceptions thrown
by this method are simply ignored by the virtual
machine.
|
|||||||||
| Home >> All >> java >> [ lang overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC