11.3. Quartz 调度程序
spring.quartz.job-store-type=jdbcspring.quartz.jdbc.initialize-schema=alwayspublic class MySampleJob extends QuartzJobBean {
// fields ...
// Inject "MyService" bean
public void setMyService(MyService myService) {
this.myService = myService;
}
// Inject the "name" job data property
public void setName(String name) {
this.name = name;
}
@Override
protected void executeInternal(JobExecutionContext context) throws JobExecutionException {
this.myService.someMethod(context.getFireTime(), this.name);
}
}最后更新于