There should be no such support at the API level. One possible way is to override the beforeExecute and afterExecute methods of ThreadPoolExecutor. You can write the log file before/after the task is executed, and your monitoring process/thread can poll the log to get the current Running task.
Or you can use some thread/inter-process communication methods (such as socket?) to get more real-time results.
It is true that beforeExecute and afterExecute can be overridden, and then a shared ConcurrentHashMap can be opened. BeforeExecute puts Runnable into HashMap, and afterExecute deletes Runnable from HashMap.
There should be no such support at the API level. One possible way is to override the beforeExecute and afterExecute methods of ThreadPoolExecutor. You can write the log file before/after the task is executed, and your monitoring process/thread can poll the log to get the current Running task.
Or you can use some thread/inter-process communication methods (such as socket?) to get more real-time results.
It is true that beforeExecute and afterExecute can be overridden, and then a shared ConcurrentHashMap can be opened. BeforeExecute puts Runnable into HashMap, and afterExecute deletes Runnable from HashMap.