Public Constructors
public
IdlingThreadPoolExecutor
(String resourceName, int corePoolSize, int maximumPoolSize, long keepAliveTime, TimeUnit unit, BlockingQueue<Runnable> workQueue, ThreadFactory threadFactory)
Creates a new IdlingThreadPoolExecutor with the given initial parameters and default
rejected execution handler.
| Parameters |
resourceName |
String: the name of the executor (used for logging and idempotency of
registration). |
corePoolSize |
int: the number of threads to keep in the pool, even if they are idle, unless
allowCoreThreadTimeOut is set. |
maximumPoolSize |
int: the maximum number of threads to allow in the pool. |
keepAliveTime |
long: 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. |
unit |
TimeUnit: the time unit for the keepAliveTime argument. |
workQueue |
BlockingQueue: the queue to use for holding tasks before they are executed. This queue will
hold only the Runnable tasks submitted by the execute method. |
threadFactory |
ThreadFactory: the factory to use when the executor creates a new thread.
|
Public Methods
public
void
execute
(Runnable command)
| Parameters |
command |
Runnable |
public
boolean
isIdleNow
()
public
void
registerIdleTransitionCallback
(IdlingResource.ResourceCallback callback)
| Parameters |
callback |
IdlingResource.ResourceCallback |
Protected Methods
protected
void
afterExecute
(Runnable r, Throwable t)
| Parameters |
r |
Runnable |
t |
Throwable |
protected
void
terminated
()