Waiting for threads to complete in a executor service
问题 I have initialized a exectuor service with N threads. After the N threads finishes i want to wait for a while and then reuse the executor with new instance of N threads. How do i do this? Here is the sample code i am using that is failing: int NumberOfThreads=Integer.parseInt(PropertyHandler.getProperty("numberOfThreads")); ExecutorService executor = Executors.newFixedThreadPool(NumberOfThreads); log.info("Executor class has been initialized"); while (true) { jobStack = MrMestri.buildJobs();