spring+quartz的配置文件
<?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.0.xsd"> <!-- HEWQ 2种定时器 1.秒(0–59) 2.分钟(0–59) 3.小时(0–23) 4.月份中的日期(1–31) 5.月份(1–12或JAN–DEC) 6.星期中的日期(1–7或SUN–SAT) 7.年份(1970–2099) 表达式意义0 0 6 * * ? 0 0 10,14,16 * * ?每天上午10点,下午2点和下午4点 0 0,15,30,45 * 1-10 * ?每月前10天每隔15分钟 30 0 0 1 1 ? 2012在2012年1月1日午夜过30秒时 0 0 8-5 ? * MON-FRI每个工作日的工作时间 0 15 4 ? * MON 每周一4时15分 ************************************************ "0 0 12 * * ?" 每天中午12点触发 "0 15 10 ? * *" 每天上午10:15触发 "0 15 10 * * ?" 每天上午10:15触发 "0 15 10 * * ? *" 每天上午10:15触发 "0 15 10 * * ? 2005" 2005年的每天上午10:15触发 "0 * 14 * * ?" 在每天下午2点到下午2:59期间的每1分钟触发 "0 0/5 14 * * ?" 在每天下午2点到下午2:55期间的每5分钟触发 "0 0/5 14,18 * * ?" 在每天下午2点到2:55期间和下午6点到6:55期间的每5分钟触发 "0 0-5 14 * * ?" 在每天下午2点到下午2:05期间的每1分钟触发 "0 10,44 14 ? 3 WED" 每年三月的星期三的下午2:10和2:44触发 "0 15 10 ? * MON-FRI" 周一至周五的上午10:15触发 "0 15 10 15 * ?" 每月15日上午10:15触发 "0 15 10 L * ?" 每月最后一日的上午10:15触发 "0 15 10 ? * 6L" 每月的最后一个星期五上午10:15触发 "0 15 10 ? * 6L 2002-2005" 2002年至2005年的每月的最后一个星期五上午10:15触发 "0 15 10 ? * 6#3" 每月的第三个星期五上午10:15触发 --> <!-- 查询**信息 --> <bean id="pageInquiryOrderHeaderInfoScheduler" class="bingo.lis.soa.scheduler.PageInquiryOrderHeaderInfoScheduler"> <property name="dao"> <ref bean="baseDao"></ref> </property> <property name="processer"> <ref bean="pageInquiryOrderHeaderInfoProcesser"></ref> </property> </bean> <bean class="org.springframework.scheduling.quartz.SchedulerFactoryBean"> <property name="triggers"> <list> <!-- 查询**信息 --> <ref bean="inquiryOrderHeaderTriggerBean"/> </list> </property> <property name="quartzProperties"> <props> <prop key="org.quartz.jobStore.class"> org.quartz.simpl.RAMJobStore </prop> </props> </property> </bean> <!-- 查询**信息 --> <bean id="inquiryOrderHeaderJobDetail" class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean"> <property name="targetObject"> <!-- 查询**信息 --> <ref bean="pageInquiryOrderHeaderInfoScheduler" /> </property> <property name="targetMethod"> <value>execute</value> </property> <property name="concurrent" value="false"></property> </bean> <!-- 查询**信息 --> <bean id="inquiryOrderHeaderTriggerBean" class="org.springframework.scheduling.quartz.CronTriggerBean"> <property name="jobDetail"> <ref bean="inquiryOrderHeaderJobDetail" /> </property> <property name="cronExpression"> <value>0 0/3 * * * ?</value> </property> </bean> </beans>
需要添加quartz-1.+的jar包,我用的是quartz-1.5.2.jar。