일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- port
- Eclipse
- maVen
- 단축키
- find
- grep
- GIT
- IntelliJ
- context
- import
- 줄바꿈 문자
- Windows 10
- vscode
- xargs
- JavaScript
- Source
- tomcat
- Mac
- plugin
- VirtualBox
- Quartz
- lsof
- ssh
- resource
- netsh
- 네트워크
- Windows
- profile
- web.xml
- 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 |