package edu.vt.marian.server; import java.io.*; import java.net.*; import java.lang.*; import java.util.*; import edu.vt.marian.common.*; import edu.vt.marian.uip.*; /** class name: uip_log_manager class description: this class is responsible for the uip_log management uses the services of class(es): debug designer(s): Jianxin Zhao (jxzhao@csgrad.cs.vt.edu) implementator(s): Xuelei Sun (xusun@csgrad.cs.vt.edu) finished time: December 8, 1998 known bugs: JDK version: 1.1.5 side effects: */ public class test_uip_log_manager { public test_uip_log_manager() { } public static void main(String[] argv) { Debug debug = new Debug("debug.cfg", "test_uip_log_manager_trace", false); // create two uip_log_manager uip_log_manager ulm1 = new uip_log_manager("client_uip" + File.separator + "log_manager\\", debug); uip_log_manager ulm2 = new uip_log_manager("server_uip" + File.separator + "log_manager\\", debug); // create threads to call them Vector v1 = new Vector(); Vector v2 = new Vector(); int number_of_threads = 40; for (int i = 0; i < number_of_threads; i++) { my_thread mt = new my_thread(ulm1, debug); v1.addElement(mt); mt = new my_thread(ulm2, debug); v2.addElement(mt); } // start the threads, so that they will log trace for (int i = 0; i < number_of_threads; i++) { my_thread mt = (my_thread) v1.elementAt(i); mt.start(); mt = (my_thread) v2.elementAt(i); mt.start(); } // dead loop System.err.println("threads started, press key to stop them"); try { System.in.read(); } catch (Exception e) { debug.dumpTrace("class test_uip_log_manager, error reading input from user"); } // stop the threads for (int i = 0; i < number_of_threads; i++) { my_thread mt = (my_thread) v1.elementAt(i); mt.stop(); mt = (my_thread) v2.elementAt(i); mt.stop(); } return; } }