Spring对Quartz调度的支持 simpleTrigger

阅读更多
一直都用CronTriggerBean,都还不知道有SimpleTriggerBean,
失败!
做个记录

转自:http://blog.163.com/jianlizhao@126/blog/static/1732511632011124112234761/s

Spring对Quartz调度的支持
    Spring对Quartz集成与其对JDK Timer调度集成类似,你可以在配置文件中配置任务调度。仅需要在程序里加载ApplicationContext,Spring会自动启动调度器。


quartz.xml
Java代码
 
 
 

  
            class="org.springframework.scheduling.quartz.JobDetailBean"> 
         
            com.learnworld.quartz.MessageJob  
       
 
         
             
                 
                    This is a message from Spring Quartz configuration! 
               
 
           
 
       
 
   
 

   
     
         
            1000 
       
 
         
            3000 
       
 
         
             
       
 
   
 
 

   
     
         
             
                 
           
 
       
 
   
 
 


SimpleSpringQuartzIntegration.java
Java代码


package com.learnworld.quartz;    
import org.springframework.context.ApplicationContext; 
import org.springframework.context.support.FileSystemXmlApplicationContext; 
 
public class SimpleSpringQuartzIntegration { 
 
    public static void main(String[] args) { 
 
        ApplicationContext ac = new FileSystemXmlApplicationContext("src/conf/quartz.xml"); 
    } 
 

你可能感兴趣的:(Spring对Quartz调度的支持 simpleTrigger)