All Projects → Dreampie → jfinal-quartz

Dreampie / jfinal-quartz

Licence: other
jfinal quartz plugin

Programming Languages

java
68154 projects - #9 most used programming language

jfinal-quartz

jfinal quartz plugin,查看其他插件-> Maven

maven 引用 ${jfinal-quartz.version}替换为相应的版本如:0.2

<dependency>
  <groupId>cn.dreampie</groupId>
  <artifactId>jfinal-quartz</artifactId>
  <version>${jfinal-quartz.version}</version>
</dependency>

use it very easy:

//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();
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].