jeecg 定时任务配置用法
方式一:
1.定时任务配置文件
src/main/resources/spring-mvc-timeTask.xml
2.新定义一个定时任务举例
a.配置定时任务,配置文件spring-mvc-timeTask.xml
<?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:aop="http://www.springframework.org/schema/aop" xmlns:util="http://www.springframework.org/schema/util"
xmlns:tx="http://www.springframework.org/schema/tx" 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.0.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.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-3.0.xsd
http://www.springframework.org/schema/task http://www.springframework.org/schema/task/spring-task-3.0.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.0.xsd"
default-autowire="byName" default-lazy-init="false"> <!-- 定时任务配置 scheduler 方式 注解 -->
<context:component-scan base-package="org.jeecgframework.core.timer" />
<task:executor id="executor" pool-size="5" />
<task:scheduler id="scheduler" pool-size="10" />
<task:annotation-driven executor="executor" scheduler="scheduler" />
<!-- 定时任务调度器 -->
<bean id="schedulerFactory" lazy-init="false" autowire="no" class="org.jeecgframework.core.timer.DataBaseSchedulerFactoryBean">
<property name="triggers">
<list>
<ref bean="xhjCeshiLiufServiceTaskCronTrigger"/>
</list>
</property>
</bean>
<!-- 定时任务业务类 配置loadTask随系统启动,以加载初始启动的定时任务 -->
<bean id="dynamicTask" class="org.jeecgframework.core.timer.DynamicTask" init-method="loadTask"/> <!-- 定时任务 测试任务配置 -->
<bean id="xhjCeshiLiufServiceTaskJob"
class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean">
<property name="targetObject" ref="xhjCeshiLiufService" />
<property name="targetMethod" value="work" />
<property name="concurrent" value="true" />
</bean>
<!-- 定时任务 测试 Trigger 配置 -->
<bean id="xhjCeshiLiufServiceTaskCronTrigger"
class="org.jeecgframework.core.timer.DataBaseCronTriggerBean">
<property name="jobDetail" ref="xhjCeshiLiufServiceTaskJob" />
<property name="cronExpression" value="0 0/1 * * * ?" />
</bean>
</beans>
b.定时任务在线控制

此类必须继承借口org.quartz.Job
方式二:
如果不做处理的定时任务,推荐使用spring的
注解方式
路径在

任务类

任务执行方法和时间

jeecg 定时任务配置用法的更多相关文章
- spring 定时任务配置
1.(易)如何在spring中配置定时任务? spring的定时任务配置分为三个步骤: 1.定义任务 2.任务执行策略配置 3.启动任务 (程序中一般我们都是到过写的,直观些) 1.定义任务 < ...
- spring的定时任务配置
本文来源于:http://myspace1916.iteye.com/blog/1570707 也可参考:http://www.oschina.net/question/8676_9032 (个人只是 ...
- CentOS7下Firewall防火墙配置用法详解
官方文档地址: https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/Security_Guide ...
- Spring的定时任务配置2(转)
spring的定时任务配置分为三个步骤: 1.定义任务 2.任务执行策略配置 3.启动任务 1.定义任务 <!--要定时执行的方法--> <bean id="testTas ...
- Spring的定时任务配置(转)
spring的定时任务配置分为三个步骤: 1.定义任务 2.任务执行策略配置 3.启动任务 1.定义任务 <!--要定时执行的方法--> <bean id="testTas ...
- spring3.0注解定时任务配置及说明
spring注解方式的定时任务配置: 第一步:spring配置文件 <?xml version="1.0" encoding="UTF-8"?> & ...
- 【Python】Linux crontab定时任务配置方法(详解)
CRONTAB概念/介绍 crontab命令用于设置周期性被执行的指令.该命令从标准输入设备读取指令,并将其存放于“crontab”文件中,以供之后读取和执行. cron 系统调度进程. 可以使用它在 ...
- 【spring boot】spring boot中使用定时任务配置
spring boot中使用定时任务配置 =============================================================================== ...
- spring boot 整合 quartz 集群环境 实现 动态定时任务配置【原】
最近做了一个spring boot 整合 quartz 实现 动态定时任务配置,在集群环境下运行的 任务.能够对定时任务,动态的进行增删改查,界面效果图如下: 1. 在项目中引入jar 2. 将需要 ...
随机推荐
- 转: 用 Eclipse 平台进行 C/C++ 开发
http://www.ibm.com/developerworks/cn/linux/opensource/os-ecc/index.html
- Install Identity management Database
Install Identity management Database Installing Oracle Fusion Applications > Setting up I ...
- [Node.js]25. Level 5. Route params
Create a route that responds to a GET request '/quotes/<name>', then use the param from the UR ...
- redis sentinel(哨兵机制)部署(Windows下实现)
另外参考:http://www.cnblogs.com/LiZhiW/p/4851631.html 一.准备条件 1.操作系统:win7 2.redis版本:redis-2.8.19 二.下载Redi ...
- VMware vSphere学习之手动克隆虚拟机
VMware ESxi5.0中,在没有安装VMware vCenter server虚拟机管理器的情况下,vSphere Client是没有提供克隆选项的. 但是还是有以下方法可以通过vSphere ...
- jQuery(一)引入
一.jQuery简介 jQuery是一个兼容多浏览器的javascript库,核心理念是write less,do more(写得更少,做得更多) 二.安装 2.1.下载 下载地址:http://jq ...
- LightOj 1123-Trail Maintenance(最小生成树:神级删边)
1123 - Trail Maintenance PDF (English) Statistics Forum Time Limit: 2 second(s) Memory Limit: 32 MB ...
- 腾讯地图api将物理地址转化成坐标
<!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content ...
- Eclipse Console 加大显示的行数和禁止错误弹出
在 Preferences-〉Run/Debug-〉Console里边,去掉对Limit console output的选择,或者选择,设置一下buffer size的设定值 禁止弹出: Prefer ...
- Oracle 去重查询
Oracle 去重查询 CreateTime--2018年2月28日15:38:45 Author:Marydon (一)使用distinct --查询指定区间内表停诊字段的值 SELECT DI ...