ONJava.com -- The Independent Source for Enterprise Java
oreilly.comSafari Books Online.Conferences.

advertisement

AddThis Social Bookmark Button
Article:
  Job Scheduling in Java
Subject:   A question need to be reply,thanks
Date:   2005-10-21 00:38:01
From:   psivakumar
Response to: A question need to be reply,thanks

Hi
i think it is possible.. i have gone through the given example in that job is rescheduled after the scheduler is started.
here is the snippet from the exapmle before starting the scheduler the job7 is repeated for 20 times like
// All of the jobs have been added to the scheduler, but none of the jobs
// will run until the scheduler has been started
sched.start();


log.info("------- Started Scheduler -----------------");


// jobs can also be scheduled after start() has been called...
// job7 will repeat 20 times, repeat every five minutes
job = new JobDetail("job7", "group1", SimpleJob.class);
trigger = new SimpleTrigger("trigger7", "group1", "job7", "group1",
new Date(ts), null, 20, 300000L);
ft = sched.scheduleJob(job, trigger);



// jobs can be re-scheduled...
// job 7 will run immediately and repeat 10 times for every second
log.info("------- Rescheduling... --------------------");
trigger = new SimpleTrigger("trigger7", "group1", "job7", "group1",
new Date(), null, 10, 1000L);
ft = sched.rescheduleJob("trigger7", "group1", trigger);


i had run this it is taking the latest one. iam also new to this.. if iam wrong please correct me.


1 to 2 of 2
1 to 2 of 2