SPRINGMVC Set Timer to execute a method at timed time

Source: Internet
Author: User

  <!--Personnel file seniority   Configure-->  <!--  General management class in Applicationcontext.xml   if Lazy-init = ' false ' then the container starts executing the scheduler   -->        <bean id= " Pstartquertz " lazy-init=" false " autowire=" no " class=" Org.springframework.scheduling.quartz.SchedulerFactoryBean ">             <property name= "Triggers" >                 <list>                     <ref bean= "AdoTime"/>                 </list>             </property>         </bean>       <!--  Define trigger time  -->        <bean  Id= "Adotime"  class= "Org.springframework.scheduling.quartz.CronTriggerBean" >             <property name= "Jobdetail" >                 <ref bean= "Ajobtask"/>             </property>             <!-- cron Expressions  -->             <property name= "Cronexpression" >                 <value>0 0 0  1 1 ?</value>             </property>        </bean> <!--  Work class to invoke  -->         <bean id= "personseniority"  class= "com.jmcdc.util.PersonSeniority" ></bean>        <!--  Define methods for calling objects and calling objects  -->         <bean id= "Ajobtask"  class= " Org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean ">             <!--  called classes  -->             <property name= "TargetObject" >                 <ref bean= "PersonSeniority"/>  < name of the!--class-->            </property >            <!--  Calling methods in a class  -->             <property name= "Targetmethod" >                 <value>work</value><!--Method Name-->             </property>         </bean>

The Java code is as follows:

public class Personseniority {@Autowired private Cdcdao Cdcdao; method public void Work () {}

SPRINGMVC Set Timer to execute a method at timed time

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.