01: /*
02: * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright
03: * notice. All rights reserved.
04: */
05: package com.tc.lang;
06:
07: public class TCThreadGroup extends ThreadGroup {
08:
09: private static final String CLASS_NAME = TCThreadGroup.class
10: .getName();
11:
12: private final ThrowableHandler throwableHandler;
13:
14: public static boolean currentThreadInTCThreadGroup() {
15: return Thread.currentThread().getThreadGroup().getClass()
16: .getName().equals(CLASS_NAME);
17: }
18:
19: public TCThreadGroup(ThrowableHandler throwableHandler) {
20: this (throwableHandler, "TC Thread Group");
21: }
22:
23: public TCThreadGroup(ThrowableHandler throwableHandler, String name) {
24: super (name);
25: this .throwableHandler = throwableHandler;
26: }
27:
28: public void uncaughtException(Thread thread, Throwable throwable) {
29: throwableHandler.handleThrowable(thread, throwable);
30: }
31:
32: }
|