Package sk.iway.iwcm.system.cron
Class CronFacade
java.lang.Object
sk.iway.iwcm.system.cron.CronFacade
CronFacade.java
Facade for convenient use of cron4j library.
-
Method Summary
Modifier and TypeMethodDescriptionstatic CronFacadestatic CronFacadegetInstance(boolean restart) Method exists only for cluster purposes(ClusterRefresher)voidrunSimpleTaskOnce(CronTask task) Launch a cron task OUTSIDE of cron environment, in a separate threadvoidsetTaskSource(TaskSource source) voidstart()Causes cron4j scheduler to start the scheduling thread, executing tasks loaded fromTaskSource.voidstop()Stop the scheduling thread of cron4j, causing the scheduling process to cease.
-
Method Details
-
getInstance
-
getInstance
Method exists only for cluster purposes(ClusterRefresher) -
setTaskSource
-
start
public void start()Causes cron4j scheduler to start the scheduling thread, executing tasks loaded fromTaskSource. 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
Launch a cron task OUTSIDE of cron environment, in a separate thread- Throws:
ClassNotFoundException
-