Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dreampie/jfinal-quartz
jfinal quartz plugin
https://github.com/dreampie/jfinal-quartz
Last synced: 2 months ago
JSON representation
jfinal quartz plugin
- Host: GitHub
- URL: https://github.com/dreampie/jfinal-quartz
- Owner: Dreampie
- Created: 2014-09-10T06:06:34.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2017-11-29T17:43:46.000Z (about 7 years ago)
- Last Synced: 2023-08-01T18:14:15.570Z (over 1 year ago)
- Language: Java
- Size: 22.5 KB
- Stars: 21
- Watchers: 10
- Forks: 17
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
jfinal-quartz
============jfinal quartz plugin,查看其他插件-> [Maven](http://search.maven.org/#search%7Cga%7C1%7Ccn.dreampie)
maven 引用 ${jfinal-quartz.version}替换为相应的版本如:0.2
```xml
cn.dreampie
jfinal-quartz
${jfinal-quartz.version}```
use it very easy:
```java
//quartz start plugin
plugins.add(new QuartzPlugin());//write job
public class DemoJob implements Job {
public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
//get param from job
Map data = jobExecutionContext.getJobDetail().getJobDataMap();
System.out.println("hi,"+data.get("name")+"," + new Date().getTime());
}
}//start it
//quartzKey must different every task
//addParam to add param in job
//run cron
new QuartzCronJob(new QuartzKey(1, "test", "test"), "*/5 * * * * ?", DemoJob.class).addParam("name", "quartz").start();
//run once
new QuartzOnceJob(new QuartzKey(2, "test", "test"), new Date(), DemoJob.class).addParam("name", "quartz").start();
```