...
Wiki Markup |
---|
Task-specific recovery or clean-up actions can also be performed by overriding the {{afterExecute()}} hook of class {{java.util.concurrent.ThreadPoolExecutor}}. This hook is called when a task successfully concludes by executing all statements in its {{run()}} method, or halts because of an exception. (A {{java.lang.Error}} might not be captured on specific implementations, see [Bug ID 6450211|http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6450211] \[[SDN 08|AA. Java References#SDN 08]\]).) When using this approach, substitute the executor service with a custom {{ThreadPoolExecutor}} that overrides the {{afterExecute()}} hook as shown below: |
...