spring定时器配置
来源:互联网 发布:南京品浪钓具淘宝店铺 编辑:程序博客网 时间:2024/06/06 03:20
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd ">
<context:component-scan base-package="com.service" />
<!-- 要调用的工作类 -->
<bean id="quartzJob" class="com.service.imp.QuartzJobServiceImpl"></bean>
<!-- 定义调用对象和调用对象的方法 -->
<bean id="jobtask" class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean">
<!-- 调用的类 -->
<property name="targetObject">
<ref bean="quartzJob"/>
</property>
<!-- 调用类中的方法 -->
<property name="targetMethod">
<value>work</value>
</property>
</bean>
<!-- 定义触发时间 -->
<bean id="doTime" class="org.springframework.scheduling.quartz.CronTriggerFactoryBean">
<property name="jobDetail">
<ref bean="jobtask"/>
</property>
<!-- cron表达式 -->
<property name="cronExpression">
<!-- 00:10执行一次-->
<value>0 10 00 * * ? *</value>
</property>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd ">
<context:component-scan base-package="com.service" />
<!-- 要调用的工作类 -->
<bean id="quartzJob" class="com.service.imp.QuartzJobServiceImpl"></bean>
<!-- 定义调用对象和调用对象的方法 -->
<bean id="jobtask" class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean">
<!-- 调用的类 -->
<property name="targetObject">
<ref bean="quartzJob"/>
</property>
<!-- 调用类中的方法 -->
<property name="targetMethod">
<value>work</value>
</property>
</bean>
<!-- 定义触发时间 -->
<bean id="doTime" class="org.springframework.scheduling.quartz.CronTriggerFactoryBean">
<property name="jobDetail">
<ref bean="jobtask"/>
</property>
<!-- cron表达式 -->
<property name="cronExpression">
<!-- 00:10执行一次-->
<value>0 10 00 * * ? *</value>
</property>
</bean>
<!-- 总管理类 如果将lazy-init='false'那么容器启动就会执行调度程序 -->
<bean id="startQuertz" lazy-init="false" class="org.springframework.scheduling.quartz.SchedulerFactoryBean">
<property name="triggers">
<list>
<ref bean="doTime"/>
<ref bean="doTimetwo"/>
</list>
</property>
</bean>
</beans>
0 0
- spring定时器的配置
- spring 定时器时间配置
- Spring定时器配置
- spring中配置定时器
- java Spring定时器配置
- Spring定时器配置
- spring quartz配置定时器
- spring定时器配置
- spring 定时器配置
- spring 定时器时间配置
- SPRING定时器配置
- spring quartz 配置(定时器)
- Spring中配置定时器
- Spring定时器的配置
- Spring定时器配置
- spring定时器配置
- spring定时器时间配置
- spring定时器简单配置
- V$session_longops解释
- Random 随机数
- oracle编程入门笔记2015-01-30--model子句性能
- ANSI,Unicode,UTF-8编码详解
- Ubuntu 9.10 SSH的安装与使用
- spring定时器配置
- 使用innodb_data_file_path修改数据文件位置,发生The server quit without updating PID file错误的解决原因及方法。
- iOS strong和weak
- JAVA中文排序
- Lintcode - sort colors II
- 测试帖子测试帖子
- 开发checklist
- 浅谈Android Fragment嵌套使用存在的一些BUG以及解决方法
- C++常考面试题:实现内存拷贝函数