使用Spring執行定時器
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
只需要引入Spring的context包即可
@Component
//啓動開啓定時任務
@EnableScheduling
public class HbaseFileReload {
//執行任務週期 cron表達式
@Scheduled(cron = "0 0/1 * * * ?")
public void run() {
System.out.println("test");
}
}