public class NativeWorkerPool extends Object implements WorkerPool
| Constructor and Description |
|---|
NativeWorkerPool(int core,
int max,
int keepAlive,
int queueLength,
int waterMark,
String threadGroupName,
String threadGroupId) |
NativeWorkerPool(int core,
int max,
int keepAlive,
int queueLength,
int waterMark,
String threadGroupName,
String threadGroupId,
RejectedExecutionHandler rejectedExecutionHandler) |
NativeWorkerPool(int core,
int max,
int keepAlive,
int queueLength,
int waterMark,
String threadGroupName,
String threadGroupId,
WaterMarkQueue<Runnable> queue) |
NativeWorkerPool(int core,
int max,
int keepAlive,
int queueLength,
String threadGroupName,
String threadGroupId) |
NativeWorkerPool(int core,
int max,
int keepAlive,
int queueLength,
String threadGroupName,
String threadGroupId,
BlockingQueue<Runnable> queue) |
NativeWorkerPool(int core,
int max,
int keepAlive,
int queueLength,
String threadGroupName,
String threadGroupId,
BlockingQueue<Runnable> queue,
RejectedExecutionHandler rejectedExecutionHandler) |
| Modifier and Type | Method and Description |
|---|---|
void |
execute(Runnable task)
Asynchronously execute the given task using one of the threads of the worker pool.
|
int |
getActiveCount() |
int |
getQueueSize() |
void |
shutdown(int timeout)
Destroy the worker pool.
|
public NativeWorkerPool(int core,
int max,
int keepAlive,
int queueLength,
String threadGroupName,
String threadGroupId)
public NativeWorkerPool(int core,
int max,
int keepAlive,
int queueLength,
String threadGroupName,
String threadGroupId,
BlockingQueue<Runnable> queue)
public NativeWorkerPool(int core,
int max,
int keepAlive,
int queueLength,
String threadGroupName,
String threadGroupId,
BlockingQueue<Runnable> queue,
RejectedExecutionHandler rejectedExecutionHandler)
public NativeWorkerPool(int core,
int max,
int keepAlive,
int queueLength,
int waterMark,
String threadGroupName,
String threadGroupId)
public NativeWorkerPool(int core,
int max,
int keepAlive,
int queueLength,
int waterMark,
String threadGroupName,
String threadGroupId,
WaterMarkQueue<Runnable> queue)
public NativeWorkerPool(int core,
int max,
int keepAlive,
int queueLength,
int waterMark,
String threadGroupName,
String threadGroupId,
RejectedExecutionHandler rejectedExecutionHandler)
public void execute(Runnable task)
WorkerPoolRunnable.run() should not
throw an exception. Any uncaught exceptions should be logged by the worker pool
implementation.execute in interface WorkerPooltask - the task to executepublic int getActiveCount()
getActiveCount in interface WorkerPoolpublic int getQueueSize()
getQueueSize in interface WorkerPoolpublic void shutdown(int timeout)
throws InterruptedException
WorkerPoolshutdown in interface WorkerPooltimeout - the timeout value in millisecondsInterruptedException - if the current thread was
interrupted while waiting for pending tasks to
finish executionCopyright © 2004–2017 The Apache Software Foundation. All rights reserved.