184 |
|
* |
185 |
|
* <ol> |
186 |
|
* |
187 |
< |
* <li>In the default {@link ThreadPoolExecutor.AbortPolicy}, the |
188 |
< |
* handler throws a runtime {@link RejectedExecutionException} upon |
189 |
< |
* rejection. |
187 |
> |
* <li>In the default {@link ThreadPoolExecutor.AbortPolicy}, the handler |
188 |
> |
* throws a runtime {@link RejectedExecutionException} upon rejection. |
189 |
|
* |
190 |
|
* <li>In {@link ThreadPoolExecutor.CallerRunsPolicy}, the thread |
191 |
|
* that invokes {@code execute} itself runs the task. This provides a |
1144 |
|
|
1145 |
|
/** |
1146 |
|
* Creates a new {@code ThreadPoolExecutor} with the given initial |
1147 |
< |
* parameters and default thread factory and rejected execution handler. |
1148 |
< |
* It may be more convenient to use one of the {@link Executors} factory |
1149 |
< |
* methods instead of this general purpose constructor. |
1147 |
> |
* parameters, the default thread factory and the default rejected |
1148 |
> |
* execution handler. |
1149 |
> |
* |
1150 |
> |
* <p>It may be more convenient to use one of the {@link Executors} |
1151 |
> |
* factory methods instead of this general purpose constructor. |
1152 |
|
* |
1153 |
|
* @param corePoolSize the number of threads to keep in the pool, even |
1154 |
|
* if they are idle, unless {@code allowCoreThreadTimeOut} is set |
1179 |
|
|
1180 |
|
/** |
1181 |
|
* Creates a new {@code ThreadPoolExecutor} with the given initial |
1182 |
< |
* parameters and default rejected execution handler. |
1182 |
> |
* parameters and |
1183 |
> |
* {@linkplain ThreadPoolExecutor.AbortPolicy |
1184 |
> |
* default rejected execution handler}. |
1185 |
|
* |
1186 |
|
* @param corePoolSize the number of threads to keep in the pool, even |
1187 |
|
* if they are idle, unless {@code allowCoreThreadTimeOut} is set |
1216 |
|
|
1217 |
|
/** |
1218 |
|
* Creates a new {@code ThreadPoolExecutor} with the given initial |
1219 |
< |
* parameters and default thread factory. |
1219 |
> |
* parameters and |
1220 |
> |
* {@linkplain Executors#defaultThreadFactory default thread factory}. |
1221 |
|
* |
1222 |
|
* @param corePoolSize the number of threads to keep in the pool, even |
1223 |
|
* if they are idle, unless {@code allowCoreThreadTimeOut} is set |
2020 |
|
|
2021 |
|
/** |
2022 |
|
* A handler for rejected tasks that throws a |
2023 |
< |
* {@code RejectedExecutionException}. |
2023 |
> |
* {@link RejectedExecutionException}. |
2024 |
> |
* |
2025 |
> |
* This is the default handler for {@link ThreadPoolExecutor} and |
2026 |
> |
* {@link ScheduledThreadPoolExecutor}. |
2027 |
|
*/ |
2028 |
|
public static class AbortPolicy implements RejectedExecutionHandler { |
2029 |
|
/** |