Quartz Getting Started

Source: Internet
Author: User

What is quartz?

Quartz is a opensymphony open source organization in the Job scheduling (Task Scheduler) field another open source project, which can be combined with the Java EE and J2SE application can also be used alone. Quartz can be used to create a simple or complex day table that runs 10, hundreds, or even tens of thousands of jobs. Jobs can be made into standard Java components or EJBs. we have calendars on our phones, we can not only look at the date, but also add activities, time to trigger. Quartz is a task scheduling management system (acting as an alarm), a system that executes (or notifies) other software components when a predetermined (scheduled) time arrives . Quartz publishes a file (. jar file) with a small Java library that contains all the quartz core features. The primary interface (API) for these features is the scheduler interface. It provides simple operations such as scheduling tasks or canceling them from the schedule, starting/stopping/pausing schedule progress.

It's easy to think that quartz is a timer.

For some simple tasks, do not use quartz can also, such as the execution of every minute, not applicable quartz, can start a thread, do a dead loop, the middle stop a minute

Download:

Core interface

scheduler– Core Schedulerjob– Tasksjobdetail– Task DescriptionTrigger--Trigger

In these interfaces, the trigger interface is the most important interface, and it is divided into two categories

    • Simpletrigger
      • A simple trigger
    • Crontrigger
      • Expression triggering
the Simpletrigger is used to trigger a task that only executes once or is triggered at a given time and repeats n times for a certain amount of time per execution. • If you want the trigger to execute on January 11, 2014, 11:23:54 seconds, then repeat once every 10 seconds, and repeat 5 times. Then Simpletrigger will be able to meet your requirements. • Crontriggers is usually more useful than simpletrigger if you need to trigger tasks on a schedule like a calendar instead of triggering each interval at specific intervals like Simpletrigger. • With Crontrigger, you can specify a schedule such as "Every Friday noon" or "9:30 per weekday" or "every five minutes from 9:00 to 10:00 every Monday, Wednesday, and Friday". Even, like Simpletrigger, Crontrigger has a starttime to specify when the schedule starts, and an (optional) Endtime to specify when the schedule no longer continues.

Quartz Getting Started

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.