ThreadPoolExecutor
Creates a new ThreadPoolExecutor with the given initial parameters and the default thread factory.
Parameters
the number of threads to keep in the pool, even if they are idle, unless allowCoreThreadTimeOut is set
the maximum number of threads to allow in the pool
when the number of threads is greater than the core, this is the maximum time that excess idle threads will wait for new tasks before terminating.
the time unit for the keepAliveTime argument
the queue to use for holding tasks before they are executed. This queue will hold only the Runnable tasks submitted by the execute method.
the handler to use when execution is blocked because the thread bounds and queue capacities are reached
Throws
if one of the following holds:
corePoolSize < 0
keepAliveTime < 0
maximumPoolSize <= 0
maximumPoolSize < corePoolSize
if workQueue or handler is null