Class SchedulerUtils

java.lang.Object
io.quarkus.scheduler.common.runtime.util.SchedulerUtils

public class SchedulerUtils extends Object
Utilities class for scheduler extensions.
  • Method Details

    • parseDelayedAsMillis

      public static long parseDelayedAsMillis(Scheduled scheduled)
      Parse the `@Scheduled(delayed = "")` field into milliseconds.
      Parameters:
      scheduled - annotation
      Returns:
      returns the duration in milliseconds.
    • parseEveryAsMillis

      public static OptionalLong parseEveryAsMillis(Scheduled scheduled)
      Parse the `@Scheduled(every = "")` field into milliseconds.
      Parameters:
      scheduled - annotation
      Returns:
      returns the duration in milliseconds or OptionalLong.empty() if the expression evaluates to "off" or "disabled".
    • parseOverdueGracePeriod

      public static Duration parseOverdueGracePeriod(Scheduled scheduled, Duration defaultDuration)
      Parse the `@Scheduled(overdueGracePeriod = "")` field into milliseconds.
      Parameters:
      scheduled - annotation
      Returns:
      returns the duration.
    • isOff

      public static boolean isOff(String value)
    • lookUpPropertyValue

      public static String lookUpPropertyValue(String propertyValue)
      Looks up the property value by checking whether the value is a configuration key and resolves it if so.
      Parameters:
      propertyValue - property value to look up.
      Returns:
      the resolved property value.
    • isConfigValue

      public static boolean isConfigValue(String val)
    • parseCronTimeZone

      public static ZoneId parseCronTimeZone(Scheduled scheduled)
    • instantiateBeanOrClass

      public static <T> T instantiateBeanOrClass(Class<T> type)