java task scheduler (Quartz篇)
1, Timer describes the establishment of the task: Use the Timer scheduling tasks should inherit the TimerTask abstract class that implements Runnable interface, because some have multi-threading capabilities, to achieve the interface run method, which is required a high degree of task execution body.
Scheduled Tasks: Scheduled Tasks Timer class through the completion of the task scheduling methods through the schedul completed check java doc document:

void schedule (TimerTask task, Date time)
Arranged at the specified time to implement the specified tasks.
void schedule (TimerTask task, Date firstTime, long period)
Arrangements for the tasks assigned at the appointed time to begin to repeat a fixed delay in the implementation.
void schedule (TimerTask task, long delay)
Arrangements after a specified delay in the implementation of the specified task.
void schedule (TimerTask task, long delay, long period)
Arrangements for the tasks assigned from the specified delay repeated after a fixed delay in the implementation.

2, Quartz Job Description: Job is a mission of the java class, can be any java code, you can only achieve org.quartz.job interface. Job interface contains a method execute (), execute method body is the operating schedule body. Once the realization of Job interface and execute () method, Quartz determine the operating time of the operation, it will call the execute () method body.
Trigger: There are two types of SimpleTrigger and CronTrigger.
Scheduler: scheduler is used to trigger associated with the job, a job can be associated with multiple triggers, so that each flip-flop can be triggered by the operation of implementation; a flip-flop can be used to control the number of operations, when the trigger is triggered, all of job will be scheduling. Quartz scheduler interface embodied by the Scheduler.

3, details of Cron expression (CronTriggerBean creation is based on Cron triggers expression)
Cron expression is a string, the string of 5 or 6 separated by a space, sub-started 6 or 7 domains, each domain represents a meaning, Cron has the following two kinds of syntax:
Seconds Minutes Hours DayofMonth Month DayofWeek Year or
Seconds Minutes Hours DayofMonth Month DayofWeek

Each of the characters in a domain may appear as follows:

Seconds: may appear, - * / 4 characters, valid range is 0-59 integer
Minutes: to appear, - * / 4 characters, valid range is 0-59 integer
Hours: may appear, - * / 4 characters, valid range is 0-23 integer
DayofMonth: can occur, - * /? LWC eight characters, valid range is 0-31 integer
Month: may appear, - * / 4 characters, valid range is 1-12 integer or JAN-DEc
DayofWeek: can occur, - * /? LC # 4 characters, valid range is 1-7 integer or SUN-SAT two areas. 1, said Sunday, two said on Monday, and so on
Year: may appear, - * / 4 characters, valid range of 1970-2099 years

Each domain is the use of digital, but it can appear as a special character, and their meanings are:

(1) *: Indicates that the field matches any value, if in Minutes a domain to use *, it means that every minute trigger events.

(2)?: Can only be used in DayofMonth and DayofWeek two domains. It also matches the domain of any value, but the actual no. Because DayofMonth and DayofWeek will affect each other. For example, on the 20th of each month to trigger scheduling, regardless of the week on the 20th in the end, you can only use the following wording: 13.13152 million *?, Which can only use the last one? , But can not use *, no matter if you use * that will trigger a few weeks, in fact not the case.

(3) -: that the scope of, for example, the use of 5-20 in the Minutes field that assigned 20 minutes from 5 minutes to trigger once every

(4) /: that the starting time to start is triggered, and then trigger a fixed time intervals, for example, Minutes domain using 5 / 20, it means that 5 minutes to trigger once, 25,45, respectively, once triggered.

(5),: enumeration value is the value that is listed. For example: the use of 5,20 in the Minutes field, it means that in the 5 and 20 minutes to trigger once per minute.

(6) L: said, finally they appear in the DayofWeek and DayofMonth domain, if the use of DayofWeek domain 5L, means that in the last one on Thursday, triggering.

(7) W: that the effective working days (Monday to Friday), only appears in the DayofMonth domain, the system will be specified from the effective date of the last days triggering events. For example: In DayofMonth use 5W, if 5 was a Saturday, it will in the recent days: Friday, that is triggered on the 4th. If 5 is a Sunday, then on the 6th trigger; if 5 in the day, Monday through Friday, then on 5 trigger. Another point, W will not go beyond the most recent month for

(8) LW: These two characters can be used in conjunction, that the last working day in a month, that is the last Friday.

(9) #: is used to determine the first month, a few weeks, only appears in the DayofMonth domain. For example, in 4 # 2, said that a certain second Wednesday of the month.

0 0 2 1 *? * Indicates the 1 day of each month 2:00 Scheduled Tasks
0 15 10? * MON-FRI, said Monday to Friday 10:15 every morning, the implementation of operations
0 15 10? 6L 2002-2006 indicated that 200-2006 years, the last Friday of every month 10:15 am Executive Job