I've got a problem. I've got some code that looks like this:
executor = Executors.newSingleThreadScheduledExecutor(new NamedThreadFactory("Exec"));
[...]
executor.scheduleAtFixedRate(new Runnable() {
@Override
public void run() {
// my task
...
}, 1, 1, TimeUnit.MINUTES);
And every once in a while the said task encounters a problem and crashes. And the newSingleThreadScheduledExecutor has an interesting property: it dies silently and won't execute the task again.
I need to modify that behavior. In other words, even if run() encounters a RuntimeException, I want the task to continue executing at the fixed rate.
How do I do that?