public class FileDownloadExecutors
extends java.lang.Object
All thread pools in FileDownloader will comply with:
The default thread count is 0, and the maximum pool size is nThreads; When there are less
than nThreads threads running, a new thread is created to handle the request, but when it
turn to idle and the interval time of waiting for new task more than DEFAULT_IDLE_SECOND
second, the thread will be terminate to reduce the cost of resources.
| Constructor and Description |
|---|
FileDownloadExecutors() |
| Modifier and Type | Method and Description |
|---|---|
static java.util.concurrent.ThreadPoolExecutor |
newDefaultThreadPool(int nThreads,
java.util.concurrent.LinkedBlockingQueue<java.lang.Runnable> queue,
java.lang.String prefix) |
static java.util.concurrent.ThreadPoolExecutor |
newDefaultThreadPool(int nThreads,
java.lang.String prefix) |
static java.util.concurrent.ThreadPoolExecutor |
newFixedThreadPool(java.lang.String prefix) |
public static java.util.concurrent.ThreadPoolExecutor newFixedThreadPool(java.lang.String prefix)
public static java.util.concurrent.ThreadPoolExecutor newDefaultThreadPool(int nThreads,
java.lang.String prefix)
public static java.util.concurrent.ThreadPoolExecutor newDefaultThreadPool(int nThreads,
java.util.concurrent.LinkedBlockingQueue<java.lang.Runnable> queue,
java.lang.String prefix)