recurring-events

Create Scheduler in Java


I'm building functionality that will enable users to schedule recurring and non-recurring tasks. I need to save these schedules in the database and read active schedules once daily to see if they should be triggered today.

I am using spring/java. I fear if I write this logic myself it will be lacking and not as efficient as it could be.

Required schedule configurations are just like the Outlook calendar, except for being concerned with time. (probably easier to open outlook recurring meeting than read my rendition):


What is simple pattern for implementing this? Thanks for any help


Solution

  • Quartz Job Scheduler

    What you are looking for can be accomplished easily with the Quartz Job Scheduler Library.

    It allows for scheduling of future event, and even with using cron syntax.

    Excerpt from project page:

    What is Quartz Job Scheduling Library?

    Quartz is a richly featured, open source job scheduling library that can be integrated within virtually any Java application - from the smallest stand-alone application to the largest e-commerce system. Quartz can be used to create simple or complex schedules for executing tens, hundreds, or even tens-of-thousands of jobs; jobs whose tasks are defined as standard Java components that may execute virtually anything you may program them to do. The Quartz Scheduler includes many enterprise-class features, such as support for JTA transactions and clustering.

    Quartz is freely usable, licensed under the Apache 2.0 license.

    See Overview.

    See example # 3.