void awaitTermination(Long time, Timeunit timeunit)
The ExecutorServiceawaitTermination() method will block the thread calling it until either the ExecutorService has shutdown completely, or until a given time out occurs. The awaitTermination() method is typically called after calling shutdown() or shutdownNow(). Here is an example of calling ExecutorServiceawaitTermination():