Quartz Scheduler Example Programs and Sample Code : Quartz Code Snippets : How-To: Schedule a Job
How-To: Schedule a Job
Scheduling a Job
// Define job instance
JobDetail job1 = newJob(ColorJob.class)
.withIdentity("job1", "group1")
.build();

// Define a Trigger that will fire "now", and not repeat
Trigger trigger = newTrigger()
.withIdentity("trigger1", "group1")
.startNow()
.build();

// Schedule the job with the trigger
sched.scheduleJob(job, trigger);
Copyright © 2010-2015 Software AG, Darmstadt, Germany.

Product Logo |   Feedback