public class QueueingThreadPoolExecutor extends ThreadPoolExecutor
ThreadPoolExecutor does the following (see
the official
JavaDoc):
ThreadPoolExecutor.AbortPolicy, ThreadPoolExecutor.CallerRunsPolicy, ThreadPoolExecutor.DiscardOldestPolicy, ThreadPoolExecutor.DiscardPolicy| Modifier | Constructor and Description |
|---|---|
protected |
QueueingThreadPoolExecutor(String name,
int threadPoolSize)
Allows to subclass QueueingThreadPoolExecutor.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
addToQueue(Runnable runnable)
Adds a new task to the queue
|
protected void |
afterExecute(Runnable r,
Throwable t) |
static QueueingThreadPoolExecutor |
createInstance(String name,
int threadPoolSize)
Creates a new instance of
QueueingThreadPoolExecutor |
void |
execute(Runnable command) |
BlockingQueue<Runnable> |
getQueue() |
void |
setRejectedExecutionHandler(RejectedExecutionHandler handler)
This implementation does not allow setting a custom handler.
|
allowCoreThreadTimeOut, allowsCoreThreadTimeOut, awaitTermination, beforeExecute, finalize, getActiveCount, getCompletedTaskCount, getCorePoolSize, getKeepAliveTime, getLargestPoolSize, getMaximumPoolSize, getPoolSize, getRejectedExecutionHandler, getTaskCount, getThreadFactory, isShutdown, isTerminated, isTerminating, prestartAllCoreThreads, prestartCoreThread, purge, remove, setCorePoolSize, setKeepAliveTime, setMaximumPoolSize, setThreadFactory, shutdown, shutdownNow, terminated, toStringinvokeAll, invokeAll, invokeAny, invokeAny, newTaskFor, newTaskFor, submit, submit, submitprotected QueueingThreadPoolExecutor(String name, int threadPoolSize)
public static QueueingThreadPoolExecutor createInstance(String name, int threadPoolSize)
QueueingThreadPoolExecutorname - the name of the thread pool, will be used as a prefix for the name of the threadsthreadPoolSize - the maximum size of the poolQueueingThreadPoolExecutor instanceprotected void addToQueue(Runnable runnable)
runnable - the task to addprotected void afterExecute(Runnable r, Throwable t)
afterExecute in class ThreadPoolExecutorpublic void setRejectedExecutionHandler(RejectedExecutionHandler handler)
setRejectedExecutionHandler in class ThreadPoolExecutorUnsupportedOperationException - if called.public BlockingQueue<Runnable> getQueue()
getQueue in class ThreadPoolExecutorpublic void execute(Runnable command)
execute in interface Executorexecute in class ThreadPoolExecutorCopyright © 2023 jUPnP.org. All rights reserved.