Spring注解定时任务

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


 <task:scheduler id="myScheduler" pool-size="5"/>  
    <task:annotation-driven scheduler="myScheduler"/> 



@Scheduled(cron = "0/5 * * * * ?")
    public void login()throws Exception{
        System.out.println("王华");
    }
        

猜你喜欢

转载自www.cnblogs.com/wwwcf1982603555/p/9090079.html