jt-cron - an implementation of unix cron in Java released under the terms of the Apache License Version 2.0.
This project grew out of the need for scheduled processes to have access to objects in memory. Another benefit is that an application's scheduled processes can be included in the application thus eliminating the need to configure cron externally. This can be extremely useful when providing updates as everything related to the application is packaged together.
v1.5 - Java 1.2/1.3 - no longer maintained
v2.0 - Java 1.4+ - jdom.jar dependency removed
v3.0.6 - Java 1.5+ - major refactoring; now utilizing generics (may work on older versions, but must be compiled with Java 1.5+)
- How do I use jt-cron?
- The simplest way it to use com.jarretttaylor.cron.xml.XmlCron; however, this is not the only way.
- What is the format for the XML settings file?
- The settings file is in XML format and must validate using the included DTD.
- What is the purpose of the compensation attribute?
- The compensation attribute is a way to account for any drift that might occur while Cron is sleeping. Cron calculates the next time it needs to wake up and kick off a process. If Cron will be sleeping for long periods of time, a compensation amount can be specifed in milliseconds (per day) you can specify how many minutes early it should wake up and begin running on a minute-by-minute basis prior to kicking off a scheduled process.
- What logging framework does jt-cron use?
- jt-cron implements the Jakarta Commons Logging framework to provide the user with the ability to use the logger of his/her choice.
- Why is there no email functionality included?
- It was decided that the logger should be responsible for email notification. Log4j's SMTPAppender is one possible solution.
- What is the reasoning behind running multiple classes as one cron job?
- To provide the user with the best possible opportunity for code reuse, jt-cron allows the user to run a series of classes in sequence with the ability to halt the job if a class fails.
- What is the startup option?
- Jobs with the startup option enabled will be run when Cron initializes. This works similarly to a servlet that is run on startup within a web container.
- How can jt-cron be started automatically when run inside a webapp?
- This can be accomplished via a ServletContextListener. A basic implementation (TestListener.java) is included in the examples.