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.

Main Topics Oldest First

Showing messages 1 through 2 of 2.

  • A question need to be reply,thanks
    2007-05-10 21:11:42  VishalThakur [View]

    Hi all,
    you are close but its not going to work..job always looses its reference once executed.So to make more than one trigger point to a single job ...you need to set jobDetail "setDurability" property as true.
  • A question need to be reply,thanks
    2007-02-01 21:52:10  bhumireddy [View]

    This code is not executing the job after reschedule.
    But it still returns the date ft.