Sauron Software Projects Repository
cron4j
Overview Documentation Download

cron4j

cron4j is a scheduler for the Java platform which is very similar to the UNIX cron daemon. With cron4j you can launch, from within your Java applications, any task you need at the right time, according to some simple rules.

The Java 2 platform already has a built-in scheduler, implemented with the class java.util.Timer. The cron4j scheduler, however, acts in a different way. You can say to the java.util.Timer scheduler something like "launch this task after 5 minutes from now" or "launch it after 5 minutes from now, then repeat it every 10 minutes". That's all. The cron4j scheduler, instead, lets you do something a little more complex, like "launch this task every Monday, at 12:00", "launch it every 5 minutes, but don't launch it during the weekend", "launch it every hour between the 8:00AM and the 8:00PM and launch it every 5 minutes between the 8:00PM and the 8:00AM", "launch it once every day but Sunday, during every month but July and August" and so on, and all that with a single line of code.

Programming the cron4j scheduler is easy, you have to know just a few methods. The launching rules for every task must be expressed with a string called scheduling pattern, whose syntax is equal to the one used by the UNIX crontab entries. If you know how to manipulate the UNIX crontab, the most is done. If you can't, don't worry: crontab scheduling patterns rules are very simple and you can learn them in minutes. By the way, you will find them explained in the cron4j documentation.

Requirements

cron4j can run on any Java 2 (or later) platform.

License

cron4j is Free Software and it is licensed under LGPL (you will find a copy of the license bundled into the downloadable software distribution).

Feedback

You can send comments and requests to Carlo Pelliccia.

Make a donation

cron4j is free, but if you find it useful please make a donation via PayPal.

© Sauron Software 2007 - 2012 | Questa pagina in italiano