首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > Web前端 >

Spring中Quartz的配备(守护进程)(本人亲自测试)

2012-11-23 
Spring中Quartz的配置(守护进程)(本人亲自测试)?xml version1.0 encodingUTF-8? !DOCTYPE beans

Spring中Quartz的配置(守护进程)(本人亲自测试)
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">

<beans>   
         <!-- 要调用的工作类 -->
         <bean id="quartzJob" lazy-init="false" autowire="no" class="org.springframework.scheduling.quartz.SchedulerFactoryBean">
            <property name="triggers">
                 <list>
                     <ref bean="doTime"/>
                 </list>
             </property>
            
         </bean>
    
</beans>

============================================================
http://chinaxxren.iteye.com/blog/839630-----cron 表达式的格式
============================================================
package com.bj.quatrz;

import org.springframework.beans.factory.BeanFactory;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class Test {

/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
BeanFactory bf = new ClassPathXmlApplicationContext("applicationContext-*.xml");
System.out.println("test-quartz1-------------------------------------->test-quartz1");
}

public void messagin(){
System.out.println("test-quartz2-------------------------------------->test-quartz2");
}

}
==============================================================
项目实践看附件

热点排行