Java-based quartz implementation of timing two (XML mode configuration)

Source: Internet
Author: User

<!--configured as follows in the spring core configuration file --

<!--Spring based on quartz timed tasks - <BeanID= "Triggerbybeantwo"class= "Cn.zr.pringmvctest.trigger.TriggerByBeanTwo"></Bean> <!--Jobdetail - <BeanID= "Triggerbybeantwojob"class= "Org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean"> <!--the task target object to invoke - < Propertyname= "TargetObject"ref= "Triggerbybeantwo" /> <!--the corresponding method of the task target object to invoke - < Propertyname= "Targetmethod"value= "Simplemission" /> <!--whether concurrency is supported false, such as when a timed task is not over, cannot be executed again, it must be executed before it executes true and the opposite - < Propertyname= "Concurrent"value= "false" /> </Bean> <BeanID= "Simpletrigger"class= "Org.springframework.scheduling.quartz.SimpleTriggerFactoryBean"> <!--Jobdetail, the Task Scheduler that triggers need to perform - < Propertyname= "Jobdetail"ref= "Triggerbybeantwojob" /> <!--startdelay container starts after 10 seconds delay - < Propertyname= "Startdelay"value= "+" /> <!--Recurrence of the method of execution - < Propertyname= "Repeatinterval"value= "the" /> </Bean> <!--Spring based on quartz timed tasks - <BeanID= "Triggerbybean"class= "Cn.zr.pringmvctest.trigger.TriggerByBean"></Bean> <!--Jobdetail - <BeanID= "Triggerjob"class= "Org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean"> <!--the task target object to invoke - < Propertyname= "TargetObject"ref= "Triggerbybean" /> <!--the corresponding method of the task target object to invoke - < Propertyname= "Targetmethod"value= "TriggerAction" /> <!--whether concurrency is supported false, such as when a timed task is not over, cannot be executed again, it must be executed before it executes true and the opposite - < Propertyname= "Concurrent"value= "false" /> </Bean> <!--define a trigger - <BeanID= "Crontrigger"class= "Org.springframework.scheduling.quartz.CronTriggerFactoryBean"> <!--Jobdetail, the Task Scheduler that triggers need to perform - < Propertyname= "Jobdetail"ref= "Triggerjob" /> <!--Time-expression - < Propertyname= "Cronexpression"value= "0 0-55 * *?" /> <!--startdelay container starts after 10 seconds delay - < Propertyname= "Startdelay"value= "+" /> </Bean> <!--Trigger Chain - <Beanclass= "Org.springframework.scheduling.quartz.SchedulerFactoryBean"> < Propertyname= "Triggers"> <List> <refBean= "Crontrigger" /> <refBean= "Simpletrigger" /> </List> </ Property>
 Package Cn.zr.pringmvctest.trigger;  Public class Triggerbybean {        publicvoid  triggeraction () {        System.out.println (" Execute the method periodically ");}    }
 Package Cn.zr.pringmvctest.trigger;  Public class Triggerbybeantwo {        publicvoid  simplemission () {        SYSTEM.OUT.PRINTLN ("timer, perform the corresponding task ...");     }

Java-based quartz implementation of timing two (XML mode configuration)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.