jdk/src/share/classes/java/lang/Thread.java
/**
* Set the handler invoked when this thread abruptly terminates
* due to an uncaught exception.
* <p>A thread can take full control of how it responds to uncaught
* exceptions by having its uncaught exception handler explicitly set.
* If no such handler is set then the thread's <tt>ThreadGroup</tt>
* object acts as its handler.
* @param eh the object to use as this thread's uncaught exception
* handler. If <tt>null</tt> then this thread has no explicit handler.
* @throws SecurityException if the current thread is not allowed to
* modify this thread.
* @see #setDefaultUncaughtExceptionHandler
* @see ThreadGroup#uncaughtException
* @since 1.5
*/
public void setUncaughtExceptionHandler(UncaughtExceptionHandler eh) {
{- -------------------------------------------
(1) checkAccess() で...#TODO した後,
uncaughtExceptionHandler フィールドにセットするだけ.
---------------------------------------- -}
checkAccess();
uncaughtExceptionHandler = eh;
}
This document is available under the GNU GENERAL PUBLIC LICENSE Version 2.