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");
}
}
==============================================================
项目实践看附件