247 |
|
* Creates a thread pool that can schedule commands to run after a |
248 |
|
* given delay, or to execute periodically. |
249 |
|
* @param corePoolSize the number of threads to keep in the pool, |
250 |
< |
* even if they are idle. |
250 |
> |
* even if they are idle |
251 |
|
* @return a newly created scheduled thread pool |
252 |
|
* @throws IllegalArgumentException if {@code corePoolSize < 0} |
253 |
|
*/ |
259 |
|
* Creates a thread pool that can schedule commands to run after a |
260 |
|
* given delay, or to execute periodically. |
261 |
|
* @param corePoolSize the number of threads to keep in the pool, |
262 |
< |
* even if they are idle. |
262 |
> |
* even if they are idle |
263 |
|
* @param threadFactory the factory to use when the executor |
264 |
< |
* creates a new thread. |
264 |
> |
* creates a new thread |
265 |
|
* @return a newly created scheduled thread pool |
266 |
|
* @throws IllegalArgumentException if {@code corePoolSize < 0} |
267 |
|
* @throws NullPointerException if threadFactory is null |
353 |
|
* @return a thread factory |
354 |
|
* @throws AccessControlException if the current access control |
355 |
|
* context does not have permission to both get and set context |
356 |
< |
* class loader. |
356 |
> |
* class loader |
357 |
|
*/ |
358 |
|
public static ThreadFactory privilegedThreadFactory() { |
359 |
|
return new PrivilegedThreadFactory(); |
452 |
|
* @throws NullPointerException if callable null |
453 |
|
* @throws AccessControlException if the current access control |
454 |
|
* context does not have permission to both set and get context |
455 |
< |
* class loader. |
455 |
> |
* class loader |
456 |
|
*/ |
457 |
|
public static <T> Callable<T> privilegedCallableUsingCurrentClassLoader(Callable<T> callable) { |
458 |
|
if (callable == null) |