Thread.UncaughtExceptionHandler


Thread.UncaughtExceptionHandler java.lang

Java 5.0

This interface defines a handler to be invoked when a thread throws an exception that remains uncaught. When this happens, the uncaughtException( ) method of the registered handler is invoked with the Thread object that threw the exception and the THRowable exception object as arguments. The handler is run by the thread that received the exception, and that thread will exit as soon as the handler exits. If uncaughtException( ) itself throws an exception, that exception will be ignored.

An object that implements this interface may be registered for a Thread with the setUncaughtExceptionHandler( ) method. A default UncaughtExceptionHandler may be registered with the static method THRead.setDefaultUncaughtExceptionHandler( ) . If no handler or default handler is registered, the uncaughtException( ) method of the containing ThreadGroup is used instead.

 public interface  Thread.UncaughtExceptionHandler  {  // Public Instance Methods  void  uncaughtException  (Thread  t  , Throwable  e  );   } 

Implementations

ThreadGroup

Passed To

Thread.{setDefaultUncaughtExceptionHandler( ) , setUncaughtExceptionHandler( )}

Returned By

Thread.{getDefaultUncaughtExceptionHandler( ) , getUncaughtExceptionHandler( )}



Java In A Nutshell
Java In A Nutshell, 5th Edition
ISBN: 0596007736
EAN: 2147483647
Year: 2004
Pages: 1220

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net