1 22 package org.jboss.test.classloader.interrupt; 23 24 import org.jboss.logging.Logger; 25 26 31 public class TestThread extends Thread 32 { 33 private static Logger log = Logger.getLogger(TestThread.class); 34 private Object listener; 35 Throwable ex; 36 37 38 public TestThread(Object listener) 39 { 40 super("org.jboss.test.classloader.interrupt.TestThread"); 41 this.listener = listener; 42 } 43 44 public void run() 45 { 46 log.debug("Setting interrupt flag"); 48 this.interrupt(); 49 try 50 { 51 log.debug("Creating TestClass"); 53 this.interrupt(); 54 boolean wasInterrupted = this.isInterrupted(); 55 TestClass tc = new TestClass(); 56 log.debug("TestClass instance = "+tc); 57 if( wasInterrupted == false ) 58 ex = new IllegalStateException ("Interrupted state not restore after loadClassInternal"); 59 } 60 catch(Throwable e) 61 { 62 this.ex = e; 63 log.error("Failure creating TestClass", e); 64 } 65 } 66 } 67 | Popular Tags |