It is not clear to me from the JavaDoc description of the java.util.concurrent.ScheduledExecutorService::scheduleAtFixedRate method,
if the returned ScheduledFuture
represents the same task for all
invocations of the scheduled action or not.
In other words, my scheduled actions will be performed for some undefined number of times (until I stop my application). Can I stop its execution at any time after any number of invocations by just saving this variable and canceling it?
This question is not only about actual implementation (which is by any means interesting to reveal), but also about proper understanding of the specification (what if I would like to provide my own implementation of the ScheduledExecutorService
?).