Quartz : http://www.opensymphony.com/
tutorial : http://quartz-scheduler.org/docs/tutorial/index.html
추가 Library
- Apache Commons Collections >> http://commons.apache.org/collections/
- Apache Commons Logging >> http://commons.apache.org/logging/
- Apache Log4j >> http://logging.apache.org/log4j/1.2/index.html
참고 : http://blog.naver.com/kst7132?Redirect=Log&logNo=140101991602
http://blog.naver.com/minis24?Redirect=Log&logNo=80105633208
스트러츠에서 Quartz 사용 : http://mygeni.tistory.com/79
스프링에서 Quartz 사용 : http://suya55.springnote.com/pages/1126992
CronTrigger 사용한 예제
먼저 테스트로 사용할 Job 클래스 두개를 아래와 같이 만들어 준다. import java.util.Date; import org.quartz.Job; import org.quartz.JobExecutionContext; public class TestJob1 implements Job { public void execute(JobExecutionContext context) { System.out.println("TestJob1.execute() is Executed... : " + new Date()); } }
import java.util.Date; import org.quartz.Job; import org.quartz.JobExecutionContext; public class TestJob2 implements Job { public void execute(JobExecutionContext context) { System.out.println("TestJob2.execute() is Executed... : " + new Date()); } }
import java.text.ParseException; import org.quartz.CronTrigger; import org.quartz.JobDetail; import org.quartz.Scheduler; import org.quartz.SchedulerException; import org.quartz.SchedulerFactory; import org.quartz.impl.StdSchedulerFactory; public class TestCronTrigger { private SchedulerFactory schedFact; private Scheduler sched; public TestCronTrigger() { try { // 스케쥴 생성후 시작 schedFact = new StdSchedulerFactory(); sched = schedFact.getScheduler(); sched.start(); // Job1 생성 (Parameter : 1.Job Name, 2.Job Group Name, 3.Job Class) JobDetail job1 = new JobDetail("job1", "group1", TestJob1.class);
TestJob1.execute() is Executed... : Tue Jun 16 19:09:00 KST 2009
TestJob2.execute() is Executed... : Tue Jun 16 19:09:30 KST 2009 TestJob1.execute() is Executed... : Tue Jun 16 19:10:00 KST 2009 TestJob2.execute() is Executed... : Tue Jun 16 19:10:30 KST 2009 TestJob1.execute() is Executed... : Tue Jun 16 19:11:00 KST 2009
1. Seconds (0-59) - * / 2. Minutes (0-59) - * / 3. Hours (0-23) - * / 4. Day-of-month (1-31) - * ? / L W C 5. Month (1-12 or JAN-DEC) - * / 6. Day-of-week (1-7 or SUN-SAT) - * ? / L C # 7. Year (optional, empty, 1970-2099) - * /
|
SimpleTrigger을 사용한 예제
[ex : Job 구현 클래스]
[ex : 잡스케줄링]
|
'SPRING' 카테고리의 다른 글
Spring - @mvc - @SessionAttributes 와 SessionStatus (0) | 2014.03.25 |
---|---|
Spring - Validation (0) | 2014.03.25 |
Spring scheduler (quartz)사용 (0) | 2014.02.20 |
[Java] 자바 타이머(timer), 스케줄링(scheduling) 사용하기 (0) | 2014.02.19 |
Quartz 스케줄러 사용하기 (0) | 2014.02.19 |
What Is Quartz (0) | 2014.02.19 |
Quartz 에 관련된 글 (0) | 2014.02.19 |
Quartz - Quartz 1 - CronTriggers Tutorial (0) | 2014.02.19 |