cron4j 任务调度框架

cron4j 是一个Java的任务调度框架,类似于UNIX系统下的crontab.

使用示例:

import it.sauronsoftware.cron4j.Scheduler;

public class TestScheduler {
	public static void main(String[] args) throws Throwable {
		Scheduler scheduler = new Scheduler();
		scheduler.schedule("* * * * *", new HelloWorldTask());
		scheduler.start();
		Thread.sleep(300000); // pause the main thread for 5 minutes
		scheduler.stop();
	}
}

Copyright © 2007-2017 PHPERZ.COM All Rights Reserved   冀ICP备14009818号  版权声明  广告服务