[concurrency-interest] Request (bug fix?) for ScheduledThreadPoolExecutor

Norman Elton normelton at gmail.com
Mon Aug 8 12:32:33 EDT 2005

If I create a ThreadPoolExecutor that overrides the beforeExecute and  
afterExecute methods, I see my Runnable go into the pool, and come  
out. This is very handy.

If I change to a ScheduledThreadPoolExecutor, the objects passed to  
these methods are of type ScheduledFutureTask, not my original  
objects. Looking at the code, it appears that  
ScheduledThreadPoolExecutor wraps my Runnable inside this new object.

So the question is... Is this necessary? For immediate executions  
(non-scheduled), could the internals of ScheduledThreadPoolExecutor  
keep my Runnables intact, or provide some way to get them back after  

Thanks for any advice,

Norman Elton

Norman Elton
Information Technology - Network Engineering
College of William & Mary

More information about the Concurrency-interest mailing list