I am working on the Executors in java to concurrently run more threads at a time. I have a set of Runnable Objects and i assign it to the Exceutors.The Executor is working f
The ExecutorService class has 2 methods just for this: shutdown() and shutdownNow().
After using the shutdown() method, you can call awaitTermination() to block until all of the started tasks have completed. You can even provide a timeout to prevent waiting forever.
You might want to click on some of these links that I'm providing. They go straight to the docs where you can readup on this stuff yourself.