ssm(spring+springMVC+Mybatis)框架 集成Quartz(定时任务框架)
来源:互联网 发布:caffe的test iter 编辑:程序博客网 时间:2024/05/30 22:59
1、ssm框架基础jar 包
aopalliance.jaraspectjrt.jaraspectjweaver.jarcommons-beanutils-1.9.2.jarcommons-codec-1.9.jarcommons-collections-3.2.1.jarcommons-dbcp-1.4.jarcommons-fileupload-1.3.1.jarcommons-io-2.4.jarcommons-lang-2.6.jarcommons-logging-1.2.jarcommons-net-3.1.jarcommons-pool-1.6.jarcommons-pool2-2.2.jardruid-1.0.9.jarfastjson-1.1.39.jarfreemarker-2.3.19.jarhamcrest-core-1.3.jarjackson-all-1.9.5.jarjboss-logging-3.1.0.CR2.jarjettison-1.0.1.jarjstl-1.1.2.jarjunit-4.11.jarlog4j-1.2.17.jarlog4j-over-slf4j-1.7.7.jarmybatis-3.2.6.jarmybatis-spring-1.2.2.jarmysql-connector-java-5.1.30-bin.jarservlet-api.jarslf4j-api-1.7.7.jarslf4j-ext-1.7.7.jarspring-aop-4.0.2.RELEASE.jarspring-aspects-4.0.2.RELEASE.jarspring-beans-4.0.2.RELEASE.jarspring-context-4.0.2.RELEASE.jarspring-context-support-4.0.2.RELEASE.jarspring-core-4.0.2.RELEASE.jarspring-expression-4.0.2.RELEASE.jarspring-jdbc-4.0.2.RELEASE.jarspring-oxm-4.0.2.RELEASE.jarspring-test-4.0.2.RELEASE.jarspring-tx-4.0.2.RELEASE.jarspring-web-4.0.4.RELEASE.jarspring-webmvc-4.0.2.RELEASE.jarstandard-1.1.2.jar
2、quartz 定时任务框架关联jar包
quartz-1.8.5.jar
3、quartz 定时任务实现类
package com.wlsq.oauth.quartz;import java.util.Date;public class SpringQtz {private static int counter = 0;protected void execute() {long ms = System.currentTimeMillis();System.out.println("\t\t" + new Date(ms));System.out.println("(" + counter++ + ")");}}
4、相关配置文件
<?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:p="http://www.springframework.org/schema/p"xmlns:context="http://www.springframework.org/schema/context"xmlns:mvc="http://www.springframework.org/schema/mvc" xmlns:tx="http://www.springframework.org/schema/tx"xmlns:aop="http://www.springframework.org/schema/aop"xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.1.xsd http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.1.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.1.xsd"><!--运行时请将方式一注释掉! --><!-- 方式二:使用MethodInvokingJobDetailFactoryBean,任务类可以不实现Job接口,通过targetMethod指定调用方法 --><!-- 定义目标bean和bean中的方法 --><bean id="SpringQtzJob" class="com.wlsq.oauth.quartz.SpringQtz" /><bean id="SpringQtzJobMethod"class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean"><property name="targetObject"><ref bean="SpringQtzJob" /></property><property name="targetMethod"> <!-- 要执行的方法名称 --><value>execute</value></property></bean><!-- ======================== 调度触发器 ======================== --><bean id="CronTriggerBean" class="org.springframework.scheduling.quartz.CronTriggerBean"><property name="jobDetail" ref="SpringQtzJobMethod"></property><property name="cronExpression" value="*/5 * * * * ?"></property></bean><!-- ======================== 调度工厂 ======================== --><bean id="SpringJobSchedulerFactoryBean"class="org.springframework.scheduling.quartz.SchedulerFactoryBean"><property name="triggers"><list><ref bean="CronTriggerBean" /></list></property></bean></beans>
其他文件请查考:ssm框架集成memcached服务器
0 0
- ssm(spring+springMVC+Mybatis)框架 集成Quartz(定时任务框架)
- Spring集成Quartz定时任务框架介绍
- Spring集成Quartz定时任务框架介绍
- ssm(spring+springMVC+Mybatis)框架集成Mongodb
- SSM框架集成整合(Spring+SpringMVC+mybatis)
- Spring Quartz定时任务框架
- SSM框架整合 quartz 定时任务调度
- ssm框架整合quartz实现定时任务
- SSM框架整合 quartz 定时任务调度
- Spring集成quartz框架实现定时任务(一)
- spring集成定时任务框架 Quartz的两种方式
- SSM框架集成(一)mybatis+spring
- SSM框架(Spring SpringMvc Mybatis)流程
- SSM框架搭建(Spring+SpringMVC+MyBatis)
- SSM框架整合(Spring+SpringMVC+MyBatis)
- SSM框架(springmvc+spring+mybatis)整合
- SSM框架整合(Spring+SpringMVC+Mybatis)
- SSM框架整合(Spring+SpringMVC+MyBatis)
- C++笔记1.0 外部输入数组n,定义一个数组,从外面输入n个数依次放入数组
- 网络黑客攻防学习平台之基础关第一题
- JNI初试
- OIDC–基于OAuth2的下一代身份认证授权协议
- JSP02
- ssm(spring+springMVC+Mybatis)框架 集成Quartz(定时任务框架)
- Mapreduce和HBase新版本整合之WordCount计数案例
- 文章标题
- 双栈排序
- TimesTen的操作系统,数据库和虚拟化软件支持列表
- Leetcode 84. Largest Rectangle in Histogram & 85. Maximal Rectangle
- Java 多线程(六) synchronized关键字详解
- 基于AT91SAM9261EK的嵌入式Linux2.6.32+Yaffs2 根文件系统移植成功
- Spark Streaming+Kafka+Hive+JSON实时增量计算示例