- 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
- 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
- 4、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
- 5、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们。
- 6、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
- 7、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
spring3使用注解方式实现任务调度(Spring3 uses annotations to implement task scheduling)
spring3使用注解方式实现任务调度(Spring3 uses annotations to implement task scheduling)
This content is based on the Spring 3.0.5 version, and the reference document is spring-framework-reference-3.0.5.pdf
The task namespace in spring3. You can partially replace quartz and support annotations. However, if more complex task scheduling is used. Or do you suggest using quartz?. Here are the ways to perform task scheduling using task and quartz.
Use annotations to schedule tasks
Write a task instance.
View plaincopy to clipboard
01./***********************************************************************
* 2
3 * TestJob.java
* 4
5 * * * all,
6 * under the protection of the law, no company or individual shall be allowed to copy without authorization.
7 * @copyright Copyright: 2000-2011
8 * @creator Xu Zeyu br/
9 * @create-time 2011-6-27 p.m. 11:51:16
10. * @revision $Id: *
11. ***********************************************************************/
12.package com.alcor.aerie.quartz;
13.import org.slf4j.Logger;
14.import org.slf4j.LoggerFactory;
15.import org.springframework.scheduling.annotation.Scheduled;
16.import org.springframework.stereotype.Service;
17.@Service
18.public, class, TestJob {
19. / * *
20. * Logger for this class
21..
22., private, static, final, Logger, logger = LoggerFactory.getLogger (TestJob.class);
23. @Scheduled (fixedDelay = 1000)
24., public, void, work ()
25. {
26. if (logger.isDebugEnabled ()) {
27. logger.debug (work () - start); //$NON-NLS-1$
28.}
The 29. (Spring Quartz TestJob task is called! );
30. if (logger.isDebugEnabled ()) {
31. logger.debug (work () - end); //$NON-NLS-1$
32.}
33.}
34.}
Notice the @Scheduled tag in it
Configuring springs ApplicationContext.xml
View plaincopy to clipboard
01., XML, version=, 1, encoding=, UTF-8,
02.beans xmlns=, /schema/beans, xmlns:xsi=, /2001/XMLSchema-instance
3 xmlns:context= /schema/context
4 xmlns:task= /schema/task
5 xsi:schemaLocation= /schema/beans
6 /schema/beans/spring-beans-3.0.xsd
7 /schema/fex
8 /sc
您可能关注的文档
- beverages(饮料).doc
- bhk文库(BHK Library).doc
- biolog微生物鉴定步骤(biolog微生物鉴定步骤).doc
- bios恢复默认值(BIOS restores default values).doc
- bios鸣叫的含义(The meaning of BIOS tweets).doc
- bit、byte、bps、bps、pps、gbps 换算(Bit, byte, BPS, BPS, PPS, Gbps conversion).doc
- b2c电子商务存在的问题与对策(Problems and Countermeasures of B2C E-commerce).doc
- bota imba 各种命令(bota 各种命令 packages).doc
- bo原则(Bo principle).doc
- biossata ide安装ghost版本的系统总是蓝屏(Biossata ide installs the ghost version of the system, always blue screen).doc
- sql2000数据库置疑解决方法(SQL2000 database query solution).doc
- sqlserver动态语句基本语法(Sqlserver dynamic statement basic syntax).doc
- still病(still病).doc
- stm32驱动ads7843(STM32 driver ADS7843).doc
- such as 的用法(The use of such as).doc
- tda9373功脚功能介绍om8373和tda9373完全一样(Tda9373 function foot function introduced, om8373 and tda9373 exactly the same).doc
- tdi高压共轨直喷柴油发动机详解(TDI high pressure common rail direct injection diesel engine).doc
- thandie newton embracing otherness,embracing myself拥抱他人,拥抱自己 英语演讲稿带中文翻译(坦蒂牛顿拥抱他人,拥抱自己拥抱他人,拥抱自己英语演讲稿带中文翻译).doc
- tgf-β与bmp复合材料的骨修复作用(Bone repair effects of tgf- beta and BMP Composites).doc
- szgc0104(szgc0104).doc
最近下载
- 车尔尼钢琴初步教程 作品599 教学与弹琴指导_12198815.pdf VIP
- 安全生产月竞赛题库(附参考答案).pptx VIP
- 2025年上海市绿化和市容管理局部分直属事业单位公开招聘笔试历年典型考题(历年真题考点)解题思路附带答案详解(5套).docx
- Unit 4 My friends Friends share第2课时冀教版(三起)(2024)英语三年级上册.pptx VIP
- 起风了sax五线谱.pdf VIP
- 影视话剧剧本_性情男女.docx
- 湘少版三年级上册英语全册教学课件.pptx
- 蚁群算法.ppt VIP
- 江苏开放大学《宏微观经济学》——计分作业2 .doc VIP
- 民族团结铸牢中华民族共同体意识PPT (3).pptx VIP
文档评论(0)