- 授权协议: Apache
- 开发语言: Java
- 操作系统: 跨平台
- 软件首页: https://git.oschina.net/myaniu/jfinal-scheduler
- 软件文档: https://git.oschina.net/myaniu/jfinal-scheduler
软件介绍
jfinal-scheduler 是一个基于cron4j以及ScheduledThreadPoolExecutor实现的极简的任务调度插件。
极简体现在几个方便:
1)自动根据CPU内核数设定调度线程数
2)任务只需实现Runnable接口
3)只支持cron表达式(最小单位分钟)/固定频率(时间单位固定为秒)/固定延迟(时间单位固定为秒)4)支持通过配置文件启动任务。插件只需一行代码加载。
如何配置(完全编程配置):
//初始化一个任务调度插件 SchedulerPlugin sp = new SchedulerPlugin(); //初始化一个任务对象(只需实现Runnable接口即可) Runnable task = new TestTask(); //每隔10秒(固定延迟,相当于串行执行)执行一次 //sp.fixedDelaySchedule(task, 10); //每隔10秒(固定频率,频率高时相当于并行执行)执行一次 //sp.fixedRateSchedule(task, 10); //每隔1分钟执行一次 sp.cronSchedule(task, "* * * * *"); //添加插件 me.add(sp);
//初始化一个任务调度插件,参数为配置文件名
SchedulerPlugin sp = new SchedulerPlugin("job.properties");
//添加插件
me.add(sp);
#是否启用该任务 testJob.enable=true #任务类名 testJob.class=com.wellbole.web.core.TestTask #任务类型以及表达式 #testJob.type=cron #testJob.expr=* * * * * #每隔10秒(定频率,每分钟6次)执行一次 testJob.type=fixedRate testJob.expr=10 #每隔5秒(定延迟,任务一个接着一个)执行一次 #testJob.type=fixedDelay #testJob.expr=5 #job1.class=x.y.z.Runnable #jobTest.class=x.y.testRunnbale
一般情况下若需要在部署时改变配置,建议使用配置文件配置。
HTTP Essentials
Stephen A. Thomas、Stephen Thomas / Wiley / 2001-03-08 / USD 34.99
The first complete reference guide to the essential Web protocol As applications and services converge and Web technologies not only assume HTTP but require developers to manipulate it, it is be......一起来看看 《HTTP Essentials》 这本书的介绍吧!
