public class
PriorityThreadPoolExecutor
extends ThreadPoolExecutor
ThreadPoolExecutor that implements a DependencyPriorityBlockingQueue
.
This supports both Dependency
and
Priority
functionality.
Nested Class Summary
class | PriorityThreadPoolExecutor.PriorityThreadFactory |
Public Method Summary
static <T extends Runnable & Dependency & Task & PriorityProvider> PriorityThreadPoolExecutor |
create(int corePoolSize, int maxPoolSize)
|
static PriorityThreadPoolExecutor |
create()
Creates default
PriorityThreadPoolExecutor backed by a
PriorityBlockingQueue
|
static PriorityThreadPoolExecutor |
create(int threadCount)
|
void |
execute(Runnable command)
|
DependencyPriorityBlockingQueue |
getQueue()
|
Protected Method Summary
void |
afterExecute(Runnable runnable, Throwable throwable)
|
<T> RunnableFuture<T> |
newTaskFor(Runnable runnable, T value)
|
<T> RunnableFuture<T> |
newTaskFor(Callable<T> callable)
|
Inherited Method Summary
Public Methods
public static PriorityThreadPoolExecutor create (int corePoolSize, int maxPoolSize)
Parameters
corePoolSize | Number of threads to specify for core pool size |
maxPoolSize | Number of threads to specify for max pool size |
Returns
PriorityThreadPoolExecutor
backed by aPriorityBlockingQueue
public static PriorityThreadPoolExecutor create ()
Creates default PriorityThreadPoolExecutor
backed by a
PriorityBlockingQueue
public static PriorityThreadPoolExecutor create (int threadCount)
Parameters
threadCount | Number of threads to specify for Thread Pool |
Returns
PriorityThreadPoolExecutor
backed by aPriorityBlockingQueue
public void execute (Runnable command)
Parameters
command |
Protected Methods
protected void afterExecute (Runnable runnable, Throwable throwable)
Parameters
runnable | |
throwable |
protected RunnableFuture<T> newTaskFor (Runnable runnable, T value)
Parameters
runnable | |
value |
protected RunnableFuture<T> newTaskFor (Callable<T> callable)
Parameters
callable |