定时器
来源:互联网 发布:聚宝盆直播软件安卓版 编辑:程序博客网 时间:2024/05/23 11:45
xml配置
<!-- 定时器配置 --><bean id="quartzJob" class="com.service.impl.QuartzServiceImpl"><property name="configFilePath"><value>${configFilePath}</value></property></bean><!-- 定义调用对象和调用对象的方法 --><bean id="jobtask"class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean"><!-- 调用的类 --><property name="targetObject"><ref bean="quartzJob" /></property><!-- 调用类中的方法 --><property name="targetMethod"><value>refreshData</value></property></bean><!-- 定义触发时间 --><bean id="doTime" class="org.springframework.scheduling.quartz.CronTriggerBean"><property name="jobDetail"><ref bean="jobtask" /></property><!-- cron表达式 --><property name="cronExpression"><value>${quartz.time}</value></property></bean><!-- 总管理类 如果将lazy-init='false'那么容器启动就会执行调度程序 --><bean id="startQuertz" lazy-init="false" autowire="no"class="org.springframework.scheduling.quartz.SchedulerFactoryBean"><property name="triggers"><list><ref bean="doTime" /></list></property></bean>
properties xml配置 : quartz.time=0 0/1 * * * ?
java代码
public interface QuartzService { public void refreshData();}public class QuartzServiceImpl implements QuartzService { public void refreshData() { //实现代码 }}
0 0
- 定时器
- 定时器
- 定时器
- 定时器
- 定时器
- 定时器
- 定时器
- 定时器
- 定时器
- 定时器
- 定时器
- 定时器
- 定时器
- 定时器
- 定时器
- 定时器
- 定时器
- 定时器
- VS 2010 快捷键大全
- hdoj1262 寻找素数对
- 建联合主键报错DB2 Database Error: ERROR [42997] [IBM][DB2/AIX64] SQL0270N Function not supported (Reason c
- Vuforia Unity Camera Image Access
- 从模板生成代码
- 定时器
- 第二课:Android的事件处理(基于回调)
- IO-FileReader、FileWriter类
- mysql优化之sql语句优化
- Qt QMap
- 关于http 缓存处理的步奏
- Linux内核中的双链表
- Extjs组件重绘
- HDU 2149 Public Sale【取石子类简单博弈】