Class CronFacade

java.lang.Object
sk.iway.iwcm.system.cron.CronFacade

public class CronFacade extends Object
CronFacade.java Facade for convenient use of cron4j library.
  • Method Details

    • getInstance

      public static CronFacade getInstance()
    • getInstance

      public static CronFacade getInstance(boolean restart)
      Method exists only for cluster purposes(ClusterRefresher)
    • setTaskSource

      public void setTaskSource(TaskSource source)
    • start

      public void start()
      Causes cron4j scheduler to start the scheduling thread, executing tasks loaded from TaskSource. If the scheduler is already running when this method is called, the actual scheduler is stopped and a new one is created. Running start() when the scheduler is running thus effectively triggers a restart.
      Throws:
      IllegalStateException - if no task source is supplied
    • stop

      public void stop()
      Stop the scheduling thread of cron4j, causing the scheduling process to cease. However, it does NOT stop threads already scheduled by cron4j that started prior to stop() execution.
    • runSimpleTaskOnce

      public void runSimpleTaskOnce(CronTask task) throws ClassNotFoundException
      Launch a cron task OUTSIDE of cron environment, in a separate thread
      Throws:
      ClassNotFoundException