啟用計劃

Spring 提供了一個有用的任務排程支援。要啟用它,只需標註你的任何 @Configuration 類與 @EnableScheduling :

 @Configuration
 @EnableScheduling
 public class MyConfig {

     // Here it goes your configuration
 }