ix.util
Class CatchingThread

java.lang.Object
  |
  +--java.lang.Thread
        |
        +--ix.util.CatchingThread
All Implemented Interfaces:
java.lang.Runnable
Direct Known Subclasses:
GroupSender.SendingThread, IPC.ObjectStreamNameServer, IPC.ObjectStreamServer, Itest.SendingThread

public class CatchingThread
extends java.lang.Thread

A thread that catches and reports errors or exceptions.


Field Summary
(package private)  java.lang.Runnable innerRunnable
           
 
Fields inherited from class java.lang.Thread
inheritableThreadLocals, MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY, threadLocals
 
Constructor Summary
CatchingThread()
           
CatchingThread(java.lang.Runnable innerRunnable)
           
 
Method Summary
protected  void handleException(java.lang.Throwable except)
          Uses SwingUtilities.invokeLater to call the reportException method in the event-handling thread.
 void innerRun()
          Calls the run() method of the innerRunnable passed to the constructor, if innerRunnable is non-null, otherwise does nothing.
protected  void reportException(java.lang.Throwable except)
          Puts up a description of the exception in a message dialog.
 void run()
          Calls innerRun() inside a catch that calls the handleException method on any Throwable caught.
 
Methods inherited from class java.lang.Thread
, activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

innerRunnable

java.lang.Runnable innerRunnable
Constructor Detail

CatchingThread

public CatchingThread()

CatchingThread

public CatchingThread(java.lang.Runnable innerRunnable)
Method Detail

run

public void run()
Calls innerRun() inside a catch that calls the handleException method on any Throwable caught.
Overrides:
run in class java.lang.Thread

innerRun

public void innerRun()
Calls the run() method of the innerRunnable passed to the constructor, if innerRunnable is non-null, otherwise does nothing.

handleException

protected void handleException(java.lang.Throwable except)
Uses SwingUtilities.invokeLater to call the reportException method in the event-handling thread.

reportException

protected void reportException(java.lang.Throwable except)
Puts up a description of the exception in a message dialog.