PriorityThreadPoolExecutor

public class PriorityThreadPoolExecutor extends ThreadPoolExecutor

ThreadPoolExecutor that implements a DependencyPriorityBlockingQueue. This supports both Dependency and Priority functionality.

Nested Class Summary

Public Method Summary

static <T extends Runnable & Dependency & Task & PriorityProvider> PriorityThreadPoolExecutor
create(int corePoolSize, int maxPoolSize)
static PriorityThreadPoolExecutor
static PriorityThreadPoolExecutor
create(int threadCount)
void
execute(Runnable command)
DependencyPriorityBlockingQueue

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

void
afterExecute(Runnable arg0, Throwable arg1)
void
allowCoreThreadTimeOut(boolean arg0)
boolean
allowsCoreThreadTimeOut()
boolean
awaitTermination(long arg0, TimeUnit arg1)
void
beforeExecute(Thread arg0, Runnable arg1)
void
execute(Runnable arg0)
void
finalize()
int
getActiveCount()
long
getCompletedTaskCount()
int
getCorePoolSize()
long
getKeepAliveTime(TimeUnit arg0)
int
getLargestPoolSize()
int
getMaximumPoolSize()
int
getPoolSize()
BlockingQueue<Runnable>
getQueue()
RejectedExecutionHandler
getRejectedExecutionHandler()
long
getTaskCount()
ThreadFactory
getThreadFactory()
boolean
isShutdown()
boolean
isTerminated()
boolean
isTerminating()
int
prestartAllCoreThreads()
boolean
prestartCoreThread()
void
purge()
boolean
remove(Runnable arg0)
void
setCorePoolSize(int arg0)
void
setKeepAliveTime(long arg0, TimeUnit arg1)
void
setMaximumPoolSize(int arg0)
void
setRejectedExecutionHandler(RejectedExecutionHandler arg0)
void
setThreadFactory(ThreadFactory arg0)
void
shutdown()
List<Runnable>
shutdownNow()
void
terminated()
String
toString()
<T> List<Future<T>>
invokeAll(Collection<? extends Callable<T>> arg0)
<T> List<Future<T>>
invokeAll(Collection<? extends Callable<T>> arg0, long arg1, TimeUnit arg2)
<T> T
invokeAny(Collection<? extends Callable<T>> arg0)
<T> T
invokeAny(Collection<? extends Callable<T>> arg0, long arg1, TimeUnit arg2)
<T> RunnableFuture<T>
newTaskFor(Runnable arg0, T arg1)
<T> RunnableFuture<T>
newTaskFor(Callable<T> arg0)
<T> Future<T>
submit(Callable<T> arg0)
<T> Future<T>
submit(Runnable arg0, T arg1)
Future<?>
submit(Runnable arg0)
Object
clone()
boolean
equals(Object arg0)
void
finalize()
final Class<?>
getClass()
int
hashCode()
final void
notify()
final void
notifyAll()
String
toString()
final void
wait(long arg0, int arg1)
final void
wait(long arg0)
final void
wait()
abstract boolean
awaitTermination(long arg0, TimeUnit arg1)
abstract <T> List<Future<T>>
invokeAll(Collection<? extends Callable<T>> arg0)
abstract <T> List<Future<T>>
invokeAll(Collection<? extends Callable<T>> arg0, long arg1, TimeUnit arg2)
abstract <T> T
invokeAny(Collection<? extends Callable<T>> arg0)
abstract <T> T
invokeAny(Collection<? extends Callable<T>> arg0, long arg1, TimeUnit arg2)
abstract boolean
isShutdown()
abstract boolean
isTerminated()
abstract void
shutdown()
abstract List<Runnable>
shutdownNow()
abstract <T> Future<T>
submit(Callable<T> arg0)
abstract <T> Future<T>
submit(Runnable arg0, T arg1)
abstract Future<?>
submit(Runnable arg0)
abstract void
execute(Runnable arg0)

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

public static PriorityThreadPoolExecutor create ()

public static PriorityThreadPoolExecutor create (int threadCount)

Parameters
threadCount Number of threads to specify for Thread Pool

public void execute (Runnable command)

Parameters
command

public DependencyPriorityBlockingQueue getQueue ()

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