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

io.quarkus.scheduler.runtime.SchedulerRuntimeConfig Maven / Gradle / Ivy

There is a newer version: 3.17.0.CR1
Show newest version
package io.quarkus.scheduler.runtime;

import java.time.Duration;
import java.util.Optional;

import io.quarkus.runtime.annotations.ConfigItem;
import io.quarkus.runtime.annotations.ConfigPhase;
import io.quarkus.runtime.annotations.ConfigRoot;
import io.quarkus.scheduler.Scheduler;

@ConfigRoot(phase = ConfigPhase.RUN_TIME)
public class SchedulerRuntimeConfig {

    /**
     * If schedulers are enabled.
     */
    @ConfigItem(defaultValue = "true")
    public boolean enabled;

    /**
     * Scheduled task will be flagged as overdue if next execution time is exceeded by this period.
     */
    @ConfigItem(defaultValue = "1")
    public Duration overdueGracePeriod;

    /**
     * Scheduler can be started in different modes. By default, the scheduler is not started unless a
     * {@link io.quarkus.scheduler.Scheduled} business method is found.
     */
    @ConfigItem
    public Optional startMode;

    public enum StartMode {

        /**
         * The scheduler is not started unless a {@link io.quarkus.scheduler.Scheduled} business method is found.
         */
        NORMAL,

        /**
         * The scheduler will be started even if no scheduled business methods are found.
         * 

* This is necessary for "pure" programmatic scheduling. */ FORCED, /** * Just like the {@link #FORCED} mode but the scheduler will not start triggering jobs until {@link Scheduler#resume()} * is called. *

* This can be useful to run some initialization logic that needs to be performed before the scheduler starts. */ HALTED; } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy