public class PriorityThreadPoolExecutor
extends ThreadPoolExecutor
DependencyPriorityBlockingQueue
.
This supports both Dependency
and
Priority
functionality.Modifier and Type | Class and Description |
---|---|
protected static class |
PriorityThreadPoolExecutor.PriorityThreadFactory |
Modifier and Type | Method and Description |
---|---|
protected void |
afterExecute(Runnable runnable,
Throwable throwable) |
static PriorityThreadPoolExecutor |
create()
Creates default
PriorityThreadPoolExecutor backed by a
PriorityBlockingQueue |
static PriorityThreadPoolExecutor |
create(int threadCount) |
static <T extends Runnable & Dependency & Task & PriorityProvider> |
create(int corePoolSize,
int maxPoolSize) |
void |
execute(Runnable command) |
DependencyPriorityBlockingQueue |
getQueue() |
protected <T> RunnableFuture<T> |
newTaskFor(Callable<T> callable) |
protected <T> RunnableFuture<T> |
newTaskFor(Runnable runnable,
T value) |
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, setRejectedExecutionHandler, setThreadFactory, shutdown, shutdownNow, terminated, toString
public static <T extends Runnable & Dependency & Task & PriorityProvider> PriorityThreadPoolExecutor create(int corePoolSize, int maxPoolSize)
corePoolSize
- Number of threads to specify for core pool sizemaxPoolSize
- Number of threads to specify for max pool sizePriorityThreadPoolExecutor
backed by a
PriorityBlockingQueue
public static PriorityThreadPoolExecutor create(int threadCount)
threadCount
- Number of threads to specify for Thread PoolPriorityThreadPoolExecutor
backed by a
PriorityBlockingQueue
public static PriorityThreadPoolExecutor create()
PriorityThreadPoolExecutor
backed by a
PriorityBlockingQueue
protected <T> RunnableFuture<T> newTaskFor(Runnable runnable, T value)
newTaskFor
in class AbstractExecutorService
protected <T> RunnableFuture<T> newTaskFor(Callable<T> callable)
newTaskFor
in class AbstractExecutorService
public void execute(Runnable command)
execute
in interface Executor
execute
in class ThreadPoolExecutor
protected void afterExecute(Runnable runnable, Throwable throwable)
afterExecute
in class ThreadPoolExecutor
public DependencyPriorityBlockingQueue getQueue()
getQueue
in class ThreadPoolExecutor