Schedule tasks with Quartz

One of the important problems of big projects is scheduling and running some background tasks. Perl or PHP based applications can use abilities of operation system (crontab for OS *NIX, for example) and scripts. For Java/J2EE based projects it’s difficult to realise this possibility. One solution is to use Quartz.
Quartz is opensource framework which allows to schedule jobs as many as you need. Also it can be integrated with any J2EE or J2SE applications. This is very power tool. You can use it together with Sleep – an embeddable scripting solution for Java applications to build background functionality for your application.

4 responses to “Schedule tasks with Quartz”

  1. What’s wrong with using crontab to schedule Java jobs? Those are just executable binaries, aren’t they? 🙂

  2. Nothing wrong with crontab. It’s still the best thing but there are at least two reasons to use Quarz.
    The first one is portability (this is the most important advantage of Java :)). Under Linux you should use crontab, under Windows – task manager, under Mac – something similar. So, you’ll have different approaches for each OS. Using Quartz makes your life easier.
    The second reason is possibility to integrate Quartz in the Java application. It gives you a full control at jobs from application level.

  3. By the way, cron is also very portable. There are cron implementations for all major operating systems.

  4. Probably, but in this case your application will depend on this implementation of cron. In case Quarz you can embed it in your application. Also, scheduling of jobs is not only one feature of Quarz.

Leave a Reply

Your email address will not be published. Required fields are marked *