List of usage examples for org.springframework.scheduling.config ScheduledTaskRegistrar addFixedDelayTask
public void addFixedDelayTask(Runnable task, long delay)
From source file:edu.jhuapl.openessence.config.SchedulingConfig.java
@Override public void configureTasks(ScheduledTaskRegistrar taskRegistrar) { // it would be nice if we could use Spring's @Scheduled annotations, // but that doesn't let us inject the trigger rate taskRegistrar.addFixedDelayTask(new GraphCleanupTask(), envConfig.graphRetention()); }
From source file:at.porscheinformatik.common.spring.web.extended.config.SpringWebExtendedConfig.java
@Override public void configureTasks(ScheduledTaskRegistrar taskRegistrar) { StackConfig htmlConfig = configurerConfig.getHtmlConfig(); final HtmlStacks htmlStacks = htmlStacks(); if (htmlConfig.getRefreshIntervall() > 0 && htmlStacks != null) { taskRegistrar.addFixedDelayTask(new Runnable() { @Override/*from w w w . j a va2 s . co m*/ public void run() { htmlStacks.refresh(); } }, htmlConfig.getRefreshIntervall() * 1000); } StackConfig styleConfig = configurerConfig.getStyleConfig(); final StyleStacks styles = styleStacks(); if (styleConfig.getRefreshIntervall() > 0 && styles != null) { taskRegistrar.addFixedDelayTask(new Runnable() { @Override public void run() { styles.refresh(); } }, styleConfig.getRefreshIntervall() * 1000); } StackConfig scriptConfig = configurerConfig.getScriptConfig(); final ScriptStacks scripts = scriptStacks(); if (scriptConfig.getRefreshIntervall() > 0 && scripts != null) { taskRegistrar.addFixedDelayTask(new Runnable() { @Override public void run() { scripts.refresh(); } }, scriptConfig.getRefreshIntervall() * 1000); } }