일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | ||||
4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 |
- plugin
- IntelliJ
- web.xml
- find
- Source
- Mac
- GIT
- profile
- import
- grep
- maVen
- xargs
- netsh
- lsof
- ssh
- port
- 줄바꿈 문자
- VirtualBox
- context
- Eclipse
- vscode
- Quartz
- resource
- JavaScript
- 네트워크
- 단축키
- Windows
- tomcat
- Windows 10
- bash
- Today
- Total
develog
quartz 본문
quartz 버전
Quartz 2.2.0 full distribution |
jar 파일
lib/log4j-1.2.16.jar lib/quartz-2.2.0.jar lib/slf4j-api-1.6.6.jar lib/slf4j-log4j12-1.6.6.jar |
TestMain.java
import org.quartz.CronTrigger; import org.quartz.Job; import org.quartz.JobDetail; import org.quartz.JobExecutionContext; import org.quartz.JobExecutionException; import org.quartz.Scheduler; import org.quartz.SchedulerFactory; import org.quartz.impl.StdSchedulerFactory; import static org.quartz.JobBuilder.*; import static org.quartz.TriggerBuilder.*; import static org.quartz.CronScheduleBuilder.*; public class TestMain implements Job { public static void main(String[] args) throws Exception {
try { JobDetail job = newJob(TestMain.class) .withIdentity("job1", "group1") .build();
CronTrigger trigger = newTrigger() .withIdentity("trigger1", "group1") .startNow() .withSchedule(cronSchedule("0/1 * * * * ?")) .build();
SchedulerFactory sf = new StdSchedulerFactory(); Scheduler scheduler = sf.getScheduler(); scheduler.scheduleJob(job, trigger); scheduler.start(); } finally {
} } @Override public void execute(JobExecutionContext arg0) throws JobExecutionException { System.out.println(">> TestMain.execute()"); } }
|
'Dev > Java' 카테고리의 다른 글
POI 정리 (0) | 2013.10.16 |
---|---|
quartz, Cron Expressions (0) | 2013.09.05 |
Apache Derby 설치 (0) | 2013.08.24 |
java file copy test (0) | 2013.08.21 |
[Maven] pom.xml (0) | 2013.08.13 |