All Downloads are FREE. Search and download functionalities are using the official Maven repository.

de.bund.bva.isyfact.ueberwachung.actuate.health.IsyHealthTask Maven / Gradle / Ivy

There is a newer version: 3.2.1
Show newest version
package de.bund.bva.isyfact.ueberwachung.actuate.health;

import java.util.concurrent.TimeUnit;

import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.util.Assert;

import de.bund.bva.isyfact.logging.IsyLogger;
import de.bund.bva.isyfact.logging.IsyLoggerFactory;

/**
 * This Task updates the cache in {@link IsyHealthContributorRegistryCache}.
 */
public class IsyHealthTask {

    private static final IsyLogger LOGISY = IsyLoggerFactory.getLogger(IsyHealthTask.class);

    private final IsyCachingHealthContributorRegistry cachingHealthContributorRegistry;

    public IsyHealthTask(IsyCachingHealthContributorRegistry cachingHealthContributorRegistry) {
        Assert.notNull(cachingHealthContributorRegistry,
        "IsyCachingHealthContributorRegistry must not be null");
        this.cachingHealthContributorRegistry = cachingHealthContributorRegistry;
    }

    @Scheduled(fixedRate = 30, initialDelay = 5, timeUnit = TimeUnit.SECONDS)
    public void execute() {
        LOGISY.debug("Starte Health Caching");

        cachingHealthContributorRegistry.updateCache();

        LOGISY.debug("Health Cache aktualisiert");
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy