Java的任务调度框架,cron4j 2.2.5 发布

openkk 12年前
     <a href="/misc/goto?guid=4958187503544530620" target="_blank">cron4j </a>是一个Java的任务调度框架,类似于UNIX系统下的crontab.    <br />    <p>使用示例:</p>    <pre>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();   }  }</pre>    <br /> cron4j 2.2.5 发布了,主要改进有:Predictor 类增加了 setTimeZone() 方法,修复了关闭调度器时潜在的一个死锁条件的 bug。