public void resolveUrls(){
  try {
    pool=Executors.newFixedThreadPool(numThreads);
    BufferedReader buffRead=new BufferedReader(new FileReader(new File(urlsFile)));
    String urlStr=null;
    while ((urlStr=buffRead.readLine()) != null) {
      LOG.info("Starting: " + urlStr);
      pool.execute(new ResolverThread(urlStr));
    }
    buffRead.close();
    pool.awaitTermination(60,TimeUnit.SECONDS);
  }
 catch (  Exception e) {
    pool.shutdownNow();
    LOG.info(StringUtils.stringifyException(e));
  }
  pool.shutdown();
  LOG.info("Total: " + numTotal.get() + ", Resovled: "+ numResolved.get()+ ", Errored: "+ numErrored.get()+ ", Average Time: "+ totalTime.get() / numTotal.get());
}

public void resolveUrls ( ) { try { pool = Executors . newFixedThreadPool ( numThreads ) ; BufferedReader buffRead = new BufferedReader ( new FileReader ( new File ( urlsFile ) ) ) ; String urlStr = null ; while ( ( urlStr = buffRead . readLine ( ) ) != null ) { LOG . info ( "Starting: " + urlStr ) ; pool . execute ( new ResolverThread ( urlStr ) ) ; } buffRead . close ( ) ; pool . awaitTermination ( 60 , TimeUnit . SECONDS ) ; } catch ( Exception e ) { pool . shutdownNow ( ) ; LOG . info ( StringUtils . stringifyException ( e ) ) ; } pool . shutdown ( ) ; LOG . info ( "Total: " + numTotal . get ( ) + ", Resovled: " + numResolved . get ( ) + ", Errored: " + numErrored . get ( ) + ", Average Time: " + totalTime . get ( ) / numTotal . get ( ) ) ; }
creates a thread pool for resolving urls . reads in the url file on the local filesystem . for each url it attempts to resolve it keeping a total account of the number resolved , errored , and the amount of time .
