Hi, I am trying to integrate a scheduler into my web application. I believe my question is probably very trivial but I am missing some vital Java knowledge. Please let me explain… My web application currently allows users to choose, customise and run reports. I now need to add a detailed scheduler so that users can choose when to run the reports and how often etc.
I'm using Spring for the db access, and I was going to use Quartz for scheduling. A basic Quartz schedule looks something like the following: public class SimpleExample { public void run() throws Exception { // First we must get a reference to a scheduler // This schedule info is stored in a db, defined in the quartz.properties file. SchedulerFactory sf = new StdSchedulerFactory(); Scheduler sched = sf.getScheduler(); // Add jobs and triggers to schedule. // Start up the scheduler (nothing can actually run until the // scheduler has been started) sched.start(); // Wait for a short period of time so scheduler has chance to run jobs. sched.shutdown(); } public static void main(String[] args) throws Exception { SimpleExample example = new SimpleExample(); example.run(); } } More details about a really basic example can be found here: http://wiki.opensymphony.com/display/QRTZ1/TutorialLesson1 I can run this fine as a standalone test. The basics of my web application are as follows: MyApp which extends WebApplication. Loads of classes which extend WebPage A MySession class which extends WebSession What I'm not sure about is where I should be instantiating the SchedulerFactory within my application so that all users can update any schedule (i.e. so there is kind-of-like global access to the scheduler object) and so that the SchedulerFactory is only instantiated the once. I can't instantiate it in a web page as this will be user specific. I could instantiate it in the MyApp class but then I don't have access to it from the web pages. Any help whatsoever, just to point me in the right direction, would be much appreciated. Thanks Will -- View this message in context: http://www.nabble.com/Integrating-Scheduler-into-Web-Application-tp20960629p20960629.html Sent from the Wicket - User mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org