spring 定时任务配置使用


1,自定义类

package com.jd.service.meeting.worker;

public class MyWorker {
public void running(){
System.out.println("hello, world!");
}
}

二 ,配置使用

 <?xml version="1.0" encoding="GBK"?> 

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.xsd"
default-autowire="byName">




  

    
        
    
        
      false
    
  
      
  
  
    running
  
  
  
  
    0/10 * * * * ?
  
  
    
  
  

相关