Spring定时任务
<?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:tx="http://www.springframework.org/schema/tx" xmlns:task="http://www.springframework.org/schema/task" xsi:schemaLocation="http://www.springframework.org/schema/task http://www.springframework.org/schema/task/spring-task-4.3.xsd http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd"> <!-- 定时爬虫任务 --> <bean id="checkLocations" class="com.huawei.iop.timetask.task.CheckAppLocations"></bean> <bean id="recordAppTask" class="com.huawei.iop.timetask.task.RecordAppTask"></bean> <bean id="autoTracking" class="com.huawei.iop.timetask.task.AutoTracking"> <property name="hotPlayTrackingManager" ref="hotPlayTrackingImpl"></property> </bean> <bean id="updateActivityClicks" class="com.huawei.iop.timetask.task.UpdateActivityClicks"> <property name="operationActivityChannelManage" ref="operationActivityChannelManage"></property> </bean> <!-- 自定义用户群任务 --> <!-- <bean id="aggregationTask" class="com.huawei.iop.timetask.task.AggregationTask"></bean> --> <!-- 任务调度器 --> <task:scheduler id="qbScheduler" pool-size="10" /> <!-- 0 0/1 * * * ? 每分钟执行一次 --> <task:scheduled-tasks scheduler="qbScheduler"> <!-- 执行checkAndUpdate方法,每晚1点执行 --> <task:scheduled ref="checkLocations" method="checkAndUpdate" cron="0 0 1 * * ?" /> <!-- 执行record方法 每晚0点10分执行 --> <task:scheduled ref="recordAppTask" method="record" cron="0 10 0 1/1 * ? " /> <!-- 每天1点执行,热播跟踪表定时刷新 --> <task:scheduled ref="autoTracking" method="updateTask" cron="0 0 1 * * ?" /> <!--活动管理每天1点更新获取拥有活动渠道URL活动的最新点击量 --> <task:scheduled ref="updateActivityClicks" method="updateClicks" cron="0 0/60 * * * ?" /> <!-- 执行aggregationTask方法,3分钟执行 https://www.cnblogs.com/javahr/p/8318728.html --> <!-- <task:scheduled ref="aggregationTask" method="aggregation" cron="0 0/1 * * * ?" /> --> </task:scheduled-tasks> </beans>