0

I have serveral "jobs" currently running as scheduled task on my webapp-windows-server. I want to "integrate" them (as they are simple java-commandline-apps) into my JSF/Tomcat webapp and trigger them from there.

So I need some good "Cronjob"-Functionality-Library or similar, to that I can execute these "Runnables" from the running JSF-Application by cronjob-style-configuration ("* * * * *") - defined by the user.

The cronjob should also be abortable (I want to hold a list which contains all these threads to be able to kill them on demand).

As there are no best-practises, I want to figure out what a possible solution would be.

What I don't know is how to execute these "Runnables" automatically by the before mentioned cronjob-excecution-plan. There may be solutions (as Quartz-Scheduler (http://www.quartz-scheduler.org/)), but I don't have any experience with them and if I start wrong, the whole application could suffer.

So the question is: How do other "cronjob"-framework work inside (so that I can answer the side-question: Is is a good idea to build an own (ApplicationScoped) "Scheduler" which checks e.g. by a thread every second if there is any fitting runnable to execut?)

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
Niko
  • 1,054
  • 5
  • 25
  • 52
  • I don't see the post about spawning threads answer my question which deals with CRONJOB-best practice in JSF (and why use Quartz or any other scheduler) – Niko Nov 09 '15 at 08:23
  • Hi, I have refactored my question to be more specific. thanks for your input – Niko Nov 09 '15 at 08:42
  • I have the option to build an own applicationscoped watcher (which checks every e.g. 1 minute for fitting crobjob-configuarted tasks)... If that is the way this could be done property, I would write my own. So I am asking for how theses schedulers are working inside, which is a clear question in my optinion. – Niko Nov 09 '15 at 09:12

0 Answers0