<?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:context="http://www.springframework.org/schema/context" 
	xmlns:util="http://www.springframework.org/schema/util"
	xsi:schemaLocation="
	http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.2.xsd
	http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.2.xsd
	http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-4.2.xsd">

	<!-- 配置schedulingTaskBean定时任务执行方法 -->
	<bean id="schedulingTaskBean.dyCronTaskMethod" 
		class="org.springframework.scheduling.support.ScheduledMethodRunnable">
		<!--指向任务执行方法的实例对象-->
		<constructor-arg name="target" ref="schedulingTaskBean" />
		<!--指定任务执行方法名-->
		<constructor-arg name="methodName" value="cronTask" />
	</bean>
	<bean id="schedulingTaskBean.dyFixedRateTaskMethod" 
		class="org.springframework.scheduling.support.ScheduledMethodRunnable">
		<constructor-arg name="target" ref="schedulingTaskBean" />
		<constructor-arg name="methodName" value="fixedRateTask" />
	</bean>
	<bean id="schedulingTaskBean.dyFixedDelayTaskMethod" 
		class="org.springframework.scheduling.support.ScheduledMethodRunnable">
		<constructor-arg name="target" ref="schedulingTaskBean" />
		<constructor-arg name="methodName" value="fixedDelayTask" />
	</bean>

	<!-- 动态cron task配置 -->
	<bean class="cn.com.yict.framemax.scheduler.dytask.DynamicCronTask">
		<constructor-arg name="runnable" ref="schedulingTaskBean.dyCronTaskMethod" />
		<!-- cron表达式的默认执行表达式,每天23点执行 0 0 23 * * * -->
		<property name="cron" value="0 0 23 * * *" />
		<!-- 指定fmx_param_config参数配置表的cron表达式的配置键,如果参数配置表的配置发生变化,会自动重新配置cron task -->
		<property name="cronConfigKey" value="dynamic.crontask.cron" />
	</bean>
	
	<!-- 动态固定频率task配置 -->
	<bean class="cn.com.yict.framemax.scheduler.dytask.DynamicFixedRateTask">
		<constructor-arg name="runnable" ref="schedulingTaskBean.dyFixedRateTaskMethod" />
		<!-- 默认执行间隔,单位为毫秒 -->
		<property name="interval" value="5000" />
		<!-- 默认延迟执行时间,单位毫秒 -->
		<property name="initialDelay" value="10000" />
		<!-- 指定fmx_param_config参数配置表的执行间隔interval配置键 -->
		<property name="intervalConfigKey" value="dynamic.fixedratetask.interval" />
		<!-- 指定fmx_param_config参数配置表的执行间隔initialDelay配置键 -->
		<property name="initialDelayConfigKey" value="dynamic.fixedratetask.initialdelay" />
	</bean>
	
	<!-- 动态固定延迟频率的task配置 -->
	<bean class="cn.com.yict.framemax.scheduler.dytask.DynamicFixedDelayTask">
		<constructor-arg name="runnable" ref="schedulingTaskBean.dyFixedDelayTaskMethod" />
		<!-- 执行间隔,单位为毫秒 -->
		<property name="interval" value="5000" />
		<!-- 固定延迟执行时间,单位毫秒 -->
		<property name="delay" value="10000" />
		<!-- 指定fmx_param_config参数配置表的执行间隔interval配置键 -->
		<property name="intervalConfigKey" value="dynamic.fixeddelaytask.interval" />
		<!-- 指定fmx_param_config参数配置表的执行间隔delay配置键 -->
		<property name="delayConfigKey" value="dynamic.fixeddelaytask.delay" />		
	</bean>	
</beans>
