Question

My goal is to get a Quartz job scheduled at the time the Tomcat server starts up. I created a test class (in Java) that sets up the scheduling the way that I need, as well as a class that it would run when it triggers (again, Java).

I'm following the "option 2" of this thread, as well as its answer from the Quartz site:

Integration of tomcat and Quartz scheduler on startup

It says I need to: "....start the scheduler inside the contextInitialized method and shutdown the scheduler inside contextDestroyed method"

Where are those two methods? I'm assuming I would put some kind of reference to the "scheduling class" I made above, which connects to the "job class".

Or am I off base, and should be doing this through some other means? I found this link, but I think I would run into the sample problem.

Quartz run job on startup

Tomcat 7 Quartz 2.2.1

Was it helpful?

Solution

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top