spring-framework / org.springframework.scheduling.concurrent / ThreadPoolTaskScheduler / setRemoveOnCancelPolicy

setRemoveOnCancelPolicy

open fun setRemoveOnCancelPolicy(removeOnCancelPolicy: Boolean): Unit

Set the remove-on-cancel mode on ScheduledThreadPoolExecutor (JDK 7+).

Default is false. If set to true, the target executor will be switched into remove-on-cancel mode (if possible, with a soft fallback otherwise).

This setting can be modified at runtime, for example through JMX.