1 <BeanID= "Kintaiadditionalcreating"class= "Com.kng.timevalue.kintaiAdditional.KintaiAdditionalCreating" />2The first line is<!-- the work class to invoke--
第3-11 Line <!--the implementation class for the specified task bean-<!--injects properties to the task bean-
3 <Beanname= "Kintaijob"class= "Org.springframework.scheduling.quartz.JobDetailBean">4 < Propertyname= "Jobclass"value= "Com.kng.timevalue.kintaiAdditional.KintaiJob" />5 <!--the implementation class for the specified task bean--6 < Propertyname= "Jobdataasmap"><!--inject properties into the task bean-- 7 <Map>8 <entryKey= "Kintaicreating"Value-ref= "Kintaiadditionalcreating" />9 </Map>Ten </ Property> One </Bean> A第13-16 Line<!-- Define trigger time - - <BeanID= "Kintaicrontrigger"class= "Org.springframework.scheduling.quartz.CronTriggerBean"> - < Propertyname= "Jobdetail"ref= "Kintaijob" /> the < Propertyname= "Cronexpression"value= "0 * * * *" /> - </Bean> -第18-30 row definition Management - <Beanclass= "Org.springframework.scheduling.quartz.SchedulerFactoryBean"> + < Propertyname= "Jobdetails"> - <List> + <refBean= "Kintaijob" /> A </List> at </ Property> - - < Propertyname= "Triggers"> - <List> - <refBean= "Kintaicrontrigger" /> - </List> in </ Property> - </Bean>
1 Public classKintaijobextendsQuartzjobbean {2 3 @Autowired4 Privatekintaiadditionalcreating kintaicreating;5 6 7 8 /**9 * @paramkintaicreating the kintaicreating to setTen */ One Public voidsetkintaicreating (kintaiadditionalcreating kintaicreating) { A This. kintaicreating =kintaicreating; - } - the - - protected voidexecuteinternal (jobexecutioncontext context) - throwsjobexecutionexception { + Kintaicreating.addkintai (); - } + A}
the second piece of code is to write the job class Punchjob( the class must inherit Quartzjobbean)
This class of kintaiadditionalcreating writes the logic to be implemented.
Quartz Spring Configuration timed Trigger