www.pudn.com > network-java.rar > IPSavingThreadPool$.java
package netManager.discovery.pinger; /** *Title: IPSavingThreadPool(已废弃)
*Description: 保存线程的线程管理池
*Copyright: Copyright (c) 2006
*Company:
* @author:谢飞 * @version 1.0 */ import java.util.*; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; public class IPSavingThreadPool{ private int maxThread; //线程池尺寸(池中线程数) public Vector vector; private Log log = LogFactory.getLog("IPSavingThreadPool"); public IPSavingThreadPool(int threadCount){ try{ this.maxThread = threadCount; System.out.println(""); System.out.println("Start ThreadPool ...."); vector = new Vector(); for(int i=1; i <= maxThread; i++){ //生成maxThread个线程待用 IPSavingThread thread = new IPSavingThread(); vector.addElement(thread); thread.start(); //线程启动后等待 } } catch(Exception e){ e.printStackTrace(); log.error(e); } } public void process(String HostIP){ try{ int i; for(i=0; i