감지 할 수있을 것이다.
1. @Scheduled
주석의 고정 지연 속성을 사용하는 작업 스케줄링. 등록 정보 파일에서 크론 표현식을 사용하여 @Scheduled
주석
@Scheduled(cron = "*/5 * * * * ?")
public void demoServiceMethod() {
System.out.println("Method executed at every 5 seconds. Current time is :: " + new Date());
}
3. 작업 스케줄링에서 크론 표현식을 사용하여
public class DemoServiceBasicUsageFixedDelay {
@Scheduled(fixedDelay = 5000)
// @Scheduled(fixedRate = 5000)
public void demoServiceMethod() {
System.out.println("Method executed at every 5 seconds. Current time is :: " + new Date());
}
}
2. 작업 스케줄링.
@Scheduled(cron = "${cron.expression}")
public void demoServiceMethod() {
System.out.println("Method executed at every 5 seconds. Current time is :: " + new Date());
}
4. 작업 스케줄링 사용 크론 표현은 http://howtodoinjava.com/2013/04/23/4-ways-to-schedule-tasks-in-spring-3-scheduled-example/
에 # 4
<task:scheduled-tasks>
<task:scheduled ref="demoServiceXmlConfig" method="demoServiceMethod" cron="#{applicationProps['cron.expression']}"></task:scheduled>
</task:scheduled-tasks>
자세한 설명은
public class DemoServiceXmlConfig {
public void demoServiceMethod() {
System.out.println("Method executed at every 5 seconds. Current time is :: " + new Date());
}
}
XML의 설정 상황에 맞는 구성으로 구성3210
희망이 도움이됩니다.
http://docs.spring.io/spring/docs/current/spring-framework-reference/htmlsingle/#scheduling-quartz는 읽을만한 가치가 있습니다. –
Checkout [작업 실행 및 예약] (http://docs.spring.io/spring/docs/current/spring-framework-reference/html/scheduling.html) 장 – ponomandr