harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From telli...@apache.org
Subject svn commit: r409686 - in /incubator/harmony/enhanced/classlib/trunk/modules/luni-kernel/src/main/java/java/lang: Thread.java ThreadGroup.java
Date Fri, 26 May 2006 16:00:35 GMT
Author: tellison
Date: Fri May 26 09:00:35 2006
New Revision: 409686

URL: http://svn.apache.org/viewvc?rev=409686&view=rev
Log:
Implementation of Thread.UncaughtExceptionHandler.

Modified:
    incubator/harmony/enhanced/classlib/trunk/modules/luni-kernel/src/main/java/java/lang/Thread.java
    incubator/harmony/enhanced/classlib/trunk/modules/luni-kernel/src/main/java/java/lang/ThreadGroup.java

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni-kernel/src/main/java/java/lang/Thread.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/luni-kernel/src/main/java/java/lang/Thread.java?rev=409686&r1=409685&r2=409686&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni-kernel/src/main/java/java/lang/Thread.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni-kernel/src/main/java/java/lang/Thread.java
Fri May 26 09:00:35 2006
@@ -691,4 +691,22 @@
 		return false;
 	};
 
+    /**
+     * Implemented by objects that want to handle cases where a thread is being
+     * terminated by an uncaught exception.  Upon such termination, the handler is
+     * notified of the terminating thread and causal exception.  If there is no
+     * explicit handler set then the thread's group is the default handler.
+     */
+    public static interface UncaughtExceptionHandler {
+        /**
+         * The thread is being terminated by an uncaught exception.
+         * Further exceptions thrown in this method are prevent the
+         * remainder of the method from executing, but are otherwise
+         * ignored.
+         * 
+         * @param thread the thread that has an uncaught exception
+         * @param ex the exception that was thrown
+         */
+        void uncaughtException(Thread thread, Throwable ex);
+    }
 }

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni-kernel/src/main/java/java/lang/ThreadGroup.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/luni-kernel/src/main/java/java/lang/ThreadGroup.java?rev=409686&r1=409685&r2=409686&view=diff
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni-kernel/src/main/java/java/lang/ThreadGroup.java
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni-kernel/src/main/java/java/lang/ThreadGroup.java
Fri May 26 09:00:35 2006
@@ -31,7 +31,8 @@
  * @see SecurityManager
  */
 
-public class ThreadGroup {
+public class ThreadGroup implements Thread.UncaughtExceptionHandler {
+
 	// Name of this ThreadGroup
 	private String name;
 



Mime
View raw message