|
Description
|
A DESCRIPTION OF THE REQUEST :
The concurrency package lacks the ability to use Generics.
JUSTIFICATION :
The ThreadPoolExecutor has these nice methods which are intended to be overridden that can give you some information about the state of a Runnable. The method "void afterExecute(Runnable r, Throwable t)" is one of those methods.
I usually create some specific type of Runnable, for instance: a Job. My ThreadPool only consists of these Jobs. So if I want to access some specific method of my Job class I would need to cast the Runnable to Job.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
I would like to see that I can specify the type of Runnable by the use of generics. So I want to create a "new ThreadPoolExecutor < Job >(...)".
ACTUAL -
No generics :)
---------- BEGIN SOURCE ----------
public class ThreadPoolExecutor<E extends Runnable> extends AbstractExecutorService<E> {
private final BlockingQueue<E> workQueue;
protected void afterExecute(E r, Throwable t) { }
}
---------- END SOURCE ----------
Posted Date : 2006-05-30 11:14:41.0
|