KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > nightlabs > rcp > exceptionhandler > ExceptionHandlingThreadGroup


1 /*
2  * Created on Nov 12, 2004
3  * by Alexander Bieber
4  *
5  */

6 package com.nightlabs.rcp.exceptionhandler;
7
8
9
10 /**
11  * ExceptionHandlingThreadGroup adds exception handling to
12  * a thread group. It is used internally to extend the mechanism of
13  * exception handling in the NightLabs RCP framework.
14  * @author Alexander Bieber
15  */

16 public class ExceptionHandlingThreadGroup extends ThreadGroup JavaDoc {
17
18     /**
19      * @param name
20      */

21     public ExceptionHandlingThreadGroup(String JavaDoc name) {
22         super(name);
23     }
24
25     /**
26      * @param parent
27      * @param name
28      */

29     public ExceptionHandlingThreadGroup(ThreadGroup JavaDoc parent, String JavaDoc name) {
30         super(parent, name);
31     }
32     
33     
34
35     public void uncaughtException(Thread JavaDoc t, Throwable JavaDoc e) {
36         if (!ExceptionHandlerRegistry.syncHandleException(t, e))
37             super.uncaughtException(t, e);
38 // final ExceptionHandlerRegistry.ExceptionHandlerSearchResult handlerSearch = ExceptionHandlerRegistry.searchHandler(e);
39
// Throwable handlingException = null;
40
// final Thread thread = t;
41
// final Throwable exception = e;
42
// if (handlerSearch.getHandler() != null){
43
// try {
44
// Display.getDefault().syncExec(new Runnable(){
45
// public void run(){
46
// try {
47
// handlerSearch.getHandler().handleException(thread,exception,handlerSearch.getTriggerException());
48
// } catch(Throwable x) {
49
// }
50
// }
51
// });
52
//
53
// } catch (Throwable ex) {
54
// handlingException = ex;
55
// handlingException.initCause(e);
56
// }
57
// if (handlingException != null)
58
// super.uncaughtException(t,handlingException);
59
// }
60
// else
61
// super.uncaughtException(t, e);
62
}
63 }
64
Popular Tags