1 24 25 package org.objectweb.cjdbc.scenario.templates; 26 27 import org.objectweb.cjdbc.scenario.tools.util.RequestSender; 28 29 35 public class Raidb1RecoveryWithRequestSenderTemplate 36 extends Raidb1RecoveryTemplate 37 { 38 protected RequestSender sender; 39 protected Thread t; 40 41 44 protected void setUp() 45 { 46 super.setUp(); 48 try 49 { 50 sender = new RequestSender(getCJDBCConnection()); 52 sender.setRequestInterval(500); 53 t = new Thread (sender,"RequestSender"); 54 t.start(); 55 } 56 catch (Exception e) 57 { 58 e.printStackTrace(); 59 fail("Could not start sender thread:" + e); 60 } 61 } 62 63 66 protected void tearDown() 67 { 68 if (t != null) 70 { 71 sender.setQuit(true); 72 73 try 74 { 75 t.join(1000); 76 } 77 catch (InterruptedException e) 78 { 79 e.printStackTrace(); 80 } 81 } 82 83 super.tearDown(); 85 } 86 } 87 | Popular Tags |