Interface Scheduler

All Superinterfaces:
AutoCloseable, Closeable

public interface Scheduler extends Closeable
Scheduler is able to run tasks on the future in a background thread. Task can be scheduled with cron like expression. Note: Task are always executed in an administrative context.
Since:
1.47
  • Method Summary

    Modifier and Type
    Method
    Description
    schedule(String expression, Class<? extends Runnable> runnable)
    Schedule a new task for future execution.
    schedule(String expression, Runnable runnable)
    Schedule a new task for future execution.

    Methods inherited from interface java.io.Closeable

    close
  • Method Details

    • schedule

      Task schedule(String expression, Runnable runnable)
      Schedule a new task for future execution.
      Parameters:
      expression - cron expression
      runnable - action
      Returns:
      cancelable task
    • schedule

      Task schedule(String expression, Class<? extends Runnable> runnable)
      Schedule a new task for future execution. The method will create a new instance of the runnable for every execution. The runnable can use injection.
      Parameters:
      expression - cron expression
      runnable - action class
      Returns:
      cancelable task