Created
November 30, 2010 00:33
-
-
Save sharrissf/720910 to your computer and use it in GitHub Desktop.
Quartz Scheduler Example 3 comparison
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Quartz 1.8.4 Example 3 snippet | |
// job 7 will run every 30 seconds but only on Weekends (Saturday and | |
// Sunday) | |
job = new JobDetail("job7", "group1", SimpleJob.class); | |
trigger = new CronTrigger("trigger7", "group1", "job7", "group1", | |
"0,30 * * ? * SAT,SUN"); | |
sched.addJob(job, true); | |
ft = sched.scheduleJob(trigger); | |
//Quartz 2.0 Example 3 snippet | |
// job 7 will run every 30 seconds but only on Weekends (Saturday and Sunday) | |
job = newJob(SimpleJob.class) | |
.withIdentity("job7", "group1") | |
.build(); | |
trigger = newTrigger() | |
.withIdentity("trigger7", "group1") | |
.withSchedule(cronSchedule("0,30 * * ? * SAT,SUN")) | |
.build(); | |
ft = sched.scheduleJob(job, trigger); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment