org.apache.jdo.tck.util
Class ThreadExceptionHandler

java.lang.Object
  extended byjava.lang.ThreadGroup
      extended byorg.apache.jdo.tck.util.ThreadExceptionHandler

public class ThreadExceptionHandler
extends java.lang.ThreadGroup

This class extends java.lang.ThreadGroup and stores any uncaught exception of threads from this ThreadGroup for later retrieval.

Author:
Michael Bouschen

Constructor Summary
ThreadExceptionHandler()
          Constructor.
 
Method Summary
 void clear()
          Clears all exceptions in this ThreadGroup.
 java.util.Set getAllUncaughtExceptions()
          Returns all uncaught exceptions stored in this ThreadGroup.
 java.lang.Throwable getUncaughtException(java.lang.Thread t)
          Returns an uncaught exception for the specified thread.
 void uncaughtException(java.lang.Thread t, java.lang.Throwable e)
          Called by the Java Virtual Machine when a thread in this thread group stops because of an uncaught exception.
 
Methods inherited from class java.lang.ThreadGroup
activeCount, activeGroupCount, allowThreadSuspension, checkAccess, destroy, enumerate, enumerate, enumerate, enumerate, getMaxPriority, getName, getParent, interrupt, isDaemon, isDestroyed, list, parentOf, resume, setDaemon, setMaxPriority, stop, suspend, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ThreadExceptionHandler

public ThreadExceptionHandler()
Constructor.

Method Detail

uncaughtException

public void uncaughtException(java.lang.Thread t,
                              java.lang.Throwable e)
Called by the Java Virtual Machine when a thread in this thread group stops because of an uncaught exception. This implementation stores the uncaught exception in a map for later retrieval.


getUncaughtException

public java.lang.Throwable getUncaughtException(java.lang.Thread t)
Returns an uncaught exception for the specified thread.


getAllUncaughtExceptions

public java.util.Set getAllUncaughtExceptions()
Returns all uncaught exceptions stored in this ThreadGroup. Each element in the returned set is a Map.Entry with the thread as the key and the uncaught Throwable is the value.


clear

public void clear()
Clears all exceptions in this ThreadGroup.



Copyright © 2005-2007 Apache Software Foundation. All Rights Reserved.