import java.io.*;
import java.util.*;

public class ThreadPoolFactory {
   public static ThreadPool createThreadPool() {
      try {
         Properties props = new Properties();
         props.load(new FileInputStream("objsvr.properties"));
         return new ThreadPool(Integer.parseInt(props.getProperty("thread.pool.min")),
                               Integer.parseInt(props.getProperty("thread.pool.max")),
                               Integer.parseInt(props.getProperty("thread.pool.timeout")),
                               Integer.parseInt(props.getProperty("thread.pool.backlog")));
      }
      catch(Exception e) {
         e.printStackTrace(System.err);
         return null;
      }
   }
}
