THIS IS A TEST INSTANCE. ALL YOUR CHANGES WILL BE LOST!!!!
...
The following code schedules an e-mail action:
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
Scheduler scheduler = StdSchedulerFactory.getDefaultScheduler(); JobDetail jobDetail = new JobDetail("email.send", scheduler.DEFAULT_GROUP, WebWorkJob.class); Map m = jobDetail.getJobDataMap(); m.put("to", "me@bogusdomain.com"); m.put("subject", "quartz test"); m.put("body", "This is a quartz test, Hey ho"); m.put("smtpServer", "smtp.bogusdomain.com"); m.put("from", "quartz@bogusdomain.com"); SimpleTrigger trigger = new SimpleTrigger("myTrigger", scheduler.DEFAULT_GROUP, new Date(), null, 0, 0L); scheduler.deleteJob("email.send", scheduler.DEFAULT_GROUP); scheduler.scheduleJob(jobDetail, trigger); |