I read this stackoverflow thread My question is how to cancel it without interrupt. The cancel method of scheduled task is without any parameter and it internally calls ((ScheduledFuture)this.future).cancel(true), which might interrupt the current task.
In my case I don't use Scheduled annotation, instead programmatically create it using taskRegistrar.scheduleFixedRateTask(fixedRateTask) which returns ScheduledTask. Hence I have reference to ScheduledTask and I can invoke cancel() whenever I need. But with the risk of interrupting it. Since the future is package private, I cannot access scheduledTask.future.cancel(false).
Is there another way?