25 |
|
* to return {@code RunnableFuture} implementations other than |
26 |
|
* {@code FutureTask}. |
27 |
|
* |
28 |
< |
* <p><b>Extension example</b>. Here is a sketch of a class |
28 |
> |
* <p><b>Extension example.</b> Here is a sketch of a class |
29 |
|
* that customizes {@link ThreadPoolExecutor} to use |
30 |
|
* a {@code CustomTask} class instead of the default {@code FutureTask}: |
31 |
|
* <pre> {@code |
32 |
|
* public class CustomThreadPoolExecutor extends ThreadPoolExecutor { |
33 |
|
* |
34 |
< |
* static class CustomTask<V> implements RunnableFuture<V> {...} |
34 |
> |
* static class CustomTask<V> implements RunnableFuture<V> { ... } |
35 |
|
* |
36 |
|
* protected <V> RunnableFuture<V> newTaskFor(Callable<V> c) { |
37 |
|
* return new CustomTask<V>(c); |