1 4 package com.tctest.restart; 5 6 import java.util.Collection ; 7 import java.util.Collections ; 8 import java.util.HashSet ; 9 import java.util.Set ; 10 11 public class TestThreadGroup extends ThreadGroup { 12 13 public TestThreadGroup(ThreadGroup parent, String name) { 14 super(parent, name); 15 } 16 17 private final Set throwables = Collections.synchronizedSet(new HashSet ()); 18 19 public void uncaughtException(Thread thread, Throwable throwable) { 20 super.uncaughtException(thread, throwable); 21 throwables.add(throwable); 22 } 23 24 public Collection getErrors() { 25 return new HashSet (throwables); 26 } 27 } | Popular Tags |