I'd like to be able to get the Callables that I've submit
ted to an ExecutorService (specifically a ThreadPoolExecutor) which are currently in progress (so they're not available via getQueue()
).
I tried creating a subclass to override beforeExecute
, the but Runnable given there turns out to be a FutureTask, not the original Callable that was submitted.
Is there another way to go about determining the active Callables?
Ultimately there's two things I'd like to do with this information:
- Get the running tasks so they can be displayed in the user interface
- Check if the file referenced by the Callable matches a pattern, and if so, cancel it