Package org.kissweb

Class Cron

java.lang.Object
org.kissweb.Cron

public class Cron extends Object
System to auto-run Groovy files on a defined period as Unix cron does. The file that controls what gets run and when is in backend/CronTasks/crontab The groovy files it runs are located in the backend/CronTasks directory. See the file backend/crontab

Author: Blake McBride
Date: 12/22/21
  • Constructor Details

    • Cron

      public Cron(String crontabFileName, Supplier<Object> getParameter, Consumer<Object> success, Consumer<Object> failure) throws IOException
      Start the cron process.
      Parameters:
      crontabFileName - the path to the crontab file
      getParameter - method that returns the parameter passed to the Groovy cron job
      success - method that performs the cleanup action after a successful run of the cron job
      failure - method that performs the cleanup action after a failed run of the cron job
      Throws:
      IOException
  • Method Details

    • cancel

      public void cancel()
      Stop further evocation of all cron jobs.