日期:2014-05-17 浏览次数:20683 次
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd" > <beans> <bean id="statisticsService" class="Stat.service.impl.StatisticsServiceImpl"> </bean> <bean id="statisticsServiceDetail" class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean"> <property name="targetObject"> <ref bean="statisticsService" /> </property> <property name="targetMethod"> <value>test</value> </property> </bean> <!-- 配置调度任务,复杂定制模式,月份中的日期和星期不能同时设置 --> <bean id="cronReportTrigger" class="org.springframework.scheduling.quartz.CronTriggerBean"> <property name="jobDetail"> <ref bean="statisticsServiceDetail" /> </property> <property name="cronExpression"> <value>0 0 2 ? * *</value> </property> </bean> <!-- 启动调度 --> <bean id="start" class="org.springframework.scheduling.quartz.SchedulerFactoryBean"> <property name="triggers"> <list> <ref bean="cronReportTrigger" /> </list> </property> </bean> </beans>