views:

91

answers:

2

Hi all,

I'm trying to integrate quartz scheduler into a struts2 web app. Just wondering where you configure the jobs? I think the best place would be to put their details in the quartz.properties, but i cannot find the documentation that shows how to do this.

All i can find is examples of how to programmatically create the jobs, but if i have to do that then i don't really see any advantage over simply using a java.util.Timer... Plus, in a web app, i can't think of a good place to put run-once startup code.

Any 'best practices' advice greatly appreciated.

+1  A: 

When you say 'configure the jobs' do you mean stuff like setting up how often they're run?

We use a database table (we are also using hibernate) - this allows for cron-like scheduling and you can change scheduling without having to redeploy anything.

This link might be useful as it covers a few different ways to approach the problem:

http://www.ibm.com/developerworks/java/library/j-quartz/

azp74
When i say 'configure the jobs' i mean scheduling them to run. Can this be done straight in the quartz.properties? Seems to me to be a logical place to do it.
Chris
A: 

Ah-ha: i think this is what i'm after:

http://www.quartz-scheduler.org/docs/cookbook/JobInitPlugin.html

Basically, lets me configure jobs without code. Very neat and tidy.

Chris