250 |
|
* override one or more of the protected hook methods. For example, |
251 |
|
* here is a subclass that adds a simple pause/resume feature: |
252 |
|
* |
253 |
< |
* <pre> {@code |
253 |
> |
* <pre> {@code |
254 |
|
* class PausableThreadPoolExecutor extends ThreadPoolExecutor { |
255 |
|
* private boolean isPaused; |
256 |
|
* private ReentrantLock pauseLock = new ReentrantLock(); |
1947 |
|
* as in this sample subclass that prints either the direct cause |
1948 |
|
* or the underlying exception if a task has been aborted: |
1949 |
|
* |
1950 |
< |
* <pre> {@code |
1950 |
> |
* <pre> {@code |
1951 |
|
* class ExtendedExecutor extends ThreadPoolExecutor { |
1952 |
|
* // ... |
1953 |
|
* protected void afterExecute(Runnable r, Throwable t) { |