JFinal如何实现定时任务

public class AppConfig extends JFinalConfig {
 
    private static Logger logger = Logger.getLogger(AppConfig.class);
    private Timer timer = new Timer();
     
    @Override
    public void afterJFinalStart() {
        super.afterJFinalStart();
        timer.schedule(new TaskService(), 0, 60000);
    }
 
    @Override
    public void beforeJFinalStop() {
        super.beforeJFinalStop();
        timer.cancel();
    }
}

你可能感兴趣的:(JFinal如何实现定时任务)