JAVA2015. 4. 30. 15:26

1. Insert "task" namespae in root-context.xml



2. Add this line in root-context.xml


<task:annotation-driven />

     

    <bean id="myAppScheduleJobs" class="com.laby.crontab.Scheduler" />



3. Add Class file



package com.laby.crontab;


import org.springframework.scheduling.annotation.Scheduled;


public class Scheduler {

/**

* 10

*/

@Scheduled(fixedDelay=5000)

public void anaisysMeta(){

System.out.println("Meta Call");

}

}



4. Testing.....




GOOD!!!! 

Posted by 원찬식