Reputation: 868
Could anyone explain how thread life cycle works inside thread pool.Is it same as normal thread life cycle?
Upvotes: 4
Views: 1589
Reputation: 41
* 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().
Upvotes: 2