<!-- 这个BEAN为实际的业务类,该类里面定义了一个handle方法。定时任务会根据配置来定期或周期性的执行该方法 -->
<bean id="ccEtlFade" class="com.tjsoft.module.lhys.third.synclient.cc.CcEtlFade">
<property name="wsdlFilePath" value="thirdsync/statistics/cc_ucheck.wsdl"></property>
<property name="extractType" value="1"></property>
<property name="thirdStatService" ref="thirdStatService"></property>
</bean>
<!-- 下面的所有配置都是Spring的定时任务配置 -->
<bean id="ccJobDetail" class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean">
<!-- 指定定时任务的目标对象 -->
<property name="targetObject" ref="ccEtlFade" />
<!-- 指定定时任务的目标方法 -->
<property name="targetMethod" value="handle" />
<property name="concurrent" value="false" />
</bean>
<!-- 每天凌晨早上三点指定 -->
<bean id="ccCronTrigger" class="org.springframework.scheduling.quartz.CronTriggerBean">
<property name="jobDetail" ref="ccJobDetail" />
<property name="cronExpression" value="0 0 3 * * ?" />
</bean>
<!-- 系统启动后10秒开始执行,后续每隔500s执行一次 -->
<bean id="ccSimpleTrigger" class="org.springframework.scheduling.quartz.SimpleTriggerBean">
<property name="jobDetail" ref="ccJobDetail" />
<property name="startDelay" value="10000" />
<property name="repeatInterval" value="30000000" />
</bean>
<bean class="org.springframework.scheduling.quartz.SchedulerFactoryBean">
<property name="triggers">
<list>
<ref bean="ccSimpleTrigger" />
<ref bean="ccCronTrigger" />
</list>
</property>
</bean>