<!--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