de.otto.edison.status.scheduler.EveryTenSecondsScheduler Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of edison-core Show documentation
Show all versions of edison-core Show documentation
Core library for all Edison libraries.
package de.otto.edison.status.scheduler;
import de.otto.edison.status.indicator.ApplicationStatusAggregator;
import org.springframework.scheduling.annotation.Scheduled;
public class EveryTenSecondsScheduler implements Scheduler {
private static final int TEN_SECONDS = 10 * 1000;
private final ApplicationStatusAggregator aggregator;
public EveryTenSecondsScheduler(final ApplicationStatusAggregator aggregator) {
this.aggregator = aggregator;
}
@Scheduled(fixedDelay = TEN_SECONDS)
public void update() {
aggregator.update();
}
}