码迷,mamicode.com
首页 > 其他好文 > 详细

spirng定时任务的两种配置:注解和xml

时间:2015-08-27 20:59:20      阅读:212      评论:0      收藏:0      [点我收藏+]

标签:

1 使用注解

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

    <context:component-scan base-package="com.mediaforce.news.api.quartz" />
<task:executor id="executor" pool-size="1" /> <task:scheduler id="scheduler" pool-size="1" /> <task:annotation-driven executor="executor" scheduler="scheduler" />
</beans>

 

spirng定时任务的两种配置:注解和xml

标签:

原文地址:http://www.cnblogs.com/amei0/p/4764329.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!