public void awaitTermination() throws InterruptedException {
  do {
    logger.info("Awaiting completion of scanner.");
  }
 while (!executor.awaitTermination(60,TimeUnit.SECONDS));
  logger.info("Scanner finished.");
}

public void awaitTermination ( ) throws InterruptedException { do { logger . info ( "Awaiting completion of scanner." ) ; } while ( ! executor . awaitTermination ( 60 , TimeUnit . SECONDS ) ) ; logger . info ( "Scanner finished." ) ; }
await termination of all running and waiting jobs . this method blocks until all paths have been scanned .
