1、POJO方法:

  

@Service
public class testSchdule {

    @Scheduled(cron="0/5 * *  * * ? ")
    public static void syso(){
        System.out.println("这是定时器!");
    }
}

2、引入包:quartz-2.2.2.jar

3、配置文件:

  

//新增
xmlns:task="http://www.springframework.org/schema/task" xsi:schemaLocation="http://www.springframework.org/schema/task http://www.springframework.org/schema/task/spring-task-3.0.xsd"   <context:annotation-config />
  //扫描 <context:component-scan base-package="com.rbao.east.test" />   //定时器模式 <task:annotation-driven scheduler="qbScheduler" mode="proxy"/> <task:scheduler />

 

  

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-05-19
  • 2022-12-23
  • 2021-11-29
猜你喜欢
  • 2022-12-23
  • 2021-09-16
  • 2022-12-23
  • 2021-08-08
  • 2022-12-23
  • 2021-12-30
  • 2022-12-23
相关资源
相似解决方案