Spring Configuration for Quartz

Source: Internet
Author: User

<?xml version= "1.0" encoding= "UTF-8"?>
<! DOCTYPE beans Public "-//spring//dtd bean//en" "Http://www.springframework.org/dtd/spring-beans.dtd" >
<beans>
<!--the work class to invoke--
<bean id= "Job" class= "com.mv.newspider.threesnews.NewsFrom3s" >
</bean>
<!--define methods for calling objects and calling objects--
<bean id= "Jobtask"
class= "Org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean" >
<!--called Class--
<property name= "TargetObject" ref= "Job"/>
<!--calling methods in class--
<property name= "Targetmethod" value= "work"/>
<!--concurrent processing--
<property name= "Concurrent" value= "false"/>
</bean>
<!--expression triggers--
<bean id= "Dotime"
class= "Org.springframework.scheduling.quartz.CronTriggerFactoryBean" >
<property name= "Jobdetail" ref= "Jobtask"/>
<!--cron Expressions--
<property name= "cronexpression" value= "0 20 10? * MON "/>
</bean>

<!--simple triggers: Define trigger rules--
<bean id= "Synjob"
class= "Org.springframework.scheduling.quartz.SimpleTriggerFactoryBean" >
<property name= "Jobdetail" ref= "Jobtask"/>
<!--service starts one minute and then executes 1*1000*60--
<property name= "Startdelay" value= "1"/>
<!--run once every 6 seconds 6*1000--
<property name= "Repeatinterval" value= "7200000"/>
</bean>

<!--general Management class if you lazy-init= ' false ' then the container starts executing the scheduler--
<bean id= "Startquertz" lazy-init= "false" autowire= "no"
class= "Org.springframework.scheduling.quartz.SchedulerFactoryBean" >
<property name= "Triggers" >
<list>
<ref bean= "Dotime"/>
</list>
</property>
</bean>
</beans>

Spring Configuration for Quartz

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.