I have a singleThreadExecutor in order to execute the tasks I submit to it in serial order i.e. one task after another, no parallel execution.
I have runnable which
You could wrap anything you submit to this service in a Runnable
that records when its run method is entered.
public class RecordingRunnable implements Runnable {
private final Runnable actualTask;
private volatile boolean isRunning = false;
//constructor, etc
public void run() {
isRunning = true;
actualTask.run();
isRunning = false;
}
public boolean isRunning() {
return isRunning;
}
}