• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Paul Clapham
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Roland Mueller
  • Piet Souris
Bartenders:

Reschedule quartz trigger

 
Ranch Hand
Posts: 91
3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am trying to learn quartz. I have main method



Which works fine. It prints to the console on 3rd day of the week at 12:38 pm.
Now, what I want to do is to reschedule the trigger, so that it deletes the previous stored trigger and creates a new trigger with new schedule.

I read a lot of things at a lot of places but I just can't seem to understand clearly what I actually have to do, for ex:



and also this:

// Define a new Trigger

// tell the scheduler to remove the old trigger with the given key, and
// put the new one in its place


but I can't understand the approach(I do understand what is happening in the code though). Thanks in advance.
 
Bartender
Posts: 1558
5
Eclipse IDE Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi arushi,

Though I'm not much aware of quartz (looks like a job scheduler) - I think this question is more quartz specific than Java specific.

Did you try to get in touch with somebody who knows quartz?
 
arushi tomar
Ranch Hand
Posts: 91
3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Anayonkar Shivalkar wrote:Hi arushi


Yes it is, but I could not find Quartz forum here. And I don't know people who know quartz so I'm stuck all by myself.
 
Anayonkar Shivalkar
Bartender
Posts: 1558
5
Eclipse IDE Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes that is why I couldn't move your post to proper forum

Anyways I just checked API documentation (please note that I have zero knowledge in quartz internals) and found that rescheduleJob(<-click) needs a new trigger with same job name and group name.

I can see that your new trigger does not contain job name. Maybe you can try forJob(<-click).

I hope this helps.
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
While rescheduling a job it fire at once before the scheduled time..did any body faced this issue
 
Saloon Keeper
Posts: 28765
211
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I put this in "Other Application Frameworks". It may not be the best forum for it, but it fits. Quartz is a framework for doing scheduled operations, much like the Unix "cron" service does.

I haven't worked with Quartz lately, but I believe it supports both one-shot tasks and regularly repeated tasks. You can keep the task schedule in persistent storage or just in-memory.

There's also a Spring Scheduling module and it supports Quartz.

I think the question was in how to get work done at a regularly-scheduled interval, and yes, Quartz is very much about that. You don't have to manually re-schedule repeated tasks, just set up the time/day(s) that it should do the task and Quartz will handle dispatching that task automatically.
 
reply
    Bookmark Topic Watch Topic
  • New Topic