public void awaitTermination ( long timeout , TimeUnit unit ) { try { executorService . awaitTermination ( timeout , unit ) ; } catch ( InterruptedException e ) { throw new RuntimeException ( "Job executor was interrupted while waiting" ) ; } }
Wait for jobs to terminate .