54 |
|
* |
55 |
|
* @param nThreads the number of threads in the pool |
56 |
|
* @return the newly created thread pool |
57 |
< |
* @throws IllegalArgumentException if <tt>nThreads <= 0</tt> |
57 |
> |
* @throws IllegalArgumentException if {@code nThreads <= 0} |
58 |
|
*/ |
59 |
|
public static ExecutorService newFixedThreadPool(int nThreads) { |
60 |
|
return new ThreadPoolExecutor(nThreads, nThreads, |
79 |
|
* @param threadFactory the factory to use when creating new threads |
80 |
|
* @return the newly created thread pool |
81 |
|
* @throws NullPointerException if threadFactory is null |
82 |
< |
* @throws IllegalArgumentException if <tt>nThreads <= 0</tt> |
82 |
> |
* @throws IllegalArgumentException if {@code nThreads <= 0} |
83 |
|
*/ |
84 |
|
public static ExecutorService newFixedThreadPool(int nThreads, ThreadFactory threadFactory) { |
85 |
|
return new ThreadPoolExecutor(nThreads, nThreads, |
213 |
|
* @param corePoolSize the number of threads to keep in the pool, |
214 |
|
* even if they are idle. |
215 |
|
* @return a newly created scheduled thread pool |
216 |
< |
* @throws IllegalArgumentException if <tt>corePoolSize < 0</tt> |
216 |
> |
* @throws IllegalArgumentException if {@code corePoolSize < 0} |
217 |
|
*/ |
218 |
|
public static ScheduledExecutorService newScheduledThreadPool(int corePoolSize) { |
219 |
|
return new ScheduledThreadPoolExecutor(corePoolSize); |
227 |
|
* @param threadFactory the factory to use when the executor |
228 |
|
* creates a new thread. |
229 |
|
* @return a newly created scheduled thread pool |
230 |
< |
* @throws IllegalArgumentException if <tt>corePoolSize < 0</tt> |
230 |
> |
* @throws IllegalArgumentException if {@code corePoolSize < 0} |
231 |
|
* @throws NullPointerException if threadFactory is null |
232 |
|
*/ |
233 |
|
public static ScheduledExecutorService newScheduledThreadPool( |