public void awaitSuccessfulCompletionOfCurrentTasks ( ) throws InterruptedException , ExecutionException { for ( Future < ? > f : futures ) { f . get ( ) ; } futures . clear ( ) ; }
Await successful completion of all previously submitted tasks . Throw exception of the first failed task if 1 or more tasks failed .