Could anyone explain how thread life cycle works inside thread pool.Is it same as normal thread life cycle?
* using submit() method changes code for afterExecute() - Handling exceptions from Java ExecutorService tasks
**afterExecute() will be not invoked if beforeExecute() throw any Exception
Note: part of behaviour of thread pool is similar to pattern template method - beforeExecute() -> run() -> afterExecute().
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With