List of usage examples for java.util.concurrent ScheduledThreadPoolExecutor remove
public boolean remove(Runnable task)
From source file:org.codinjutsu.tools.jenkins.view.BrowserPanel.java
public void initScheduledJobs() { final ExecutorService executorService = ExecutorService.getInstance(project); final ScheduledThreadPoolExecutor executor = executorService.getExecutor(); executorService.safeTaskCancel(refreshViewFutureTask); executor.remove(refreshViewJob); if (jenkinsAppSettings.isServerUrlSet() && jenkinsAppSettings.getJobRefreshPeriod() > 0) { refreshViewFutureTask = executor.scheduleWithFixedDelay(refreshViewJob, jenkinsAppSettings.getJobRefreshPeriod(), jenkinsAppSettings.getJobRefreshPeriod(), TimeUnit.MINUTES); }// w w w. java 2s. c o m }