[Released] quartz. Net sample program: Enterprise scheduler v0.2 source code

Source: Internet
Author: User

Enterprise scheduler (entsched0.1) v0.1 source code is provided in the quartz. NET architecture and source code analysis series Part 3: trigger triggers, which implement basic job scheduling and triggering. On this basis, v0.2 has implemented the following implementation:

    1. Custom job Extension. You can develop your own job as needed and add it to entscheduler.
    2. New trigger Configuration. "Weekly, monthly, and international festivals" can now be configured freely.
Source Code Description

Figure 1 shows the solution of the sample program, including five projects: quart.2008 is quartz. net source program, entscheduler. win32 is an application project in windows, entscheduler. the extendable extensible library and two job extensions that implement the extensible library: mail service and shutdown service.

Figure 1 solution diagram of the enterprise scheduler sample program

Custom job Extension

EntschedulerYesDevelop your own jobsExtensionAnd the development extension is very convenient. You only need to implement the doho. entscheduler. extendable. iextendedjob and doho. entscheduler. extendable. ijobconfigpanel interfaces. The two interfaces are defined as follows:

Code
/// <Summary>
/// Extends the interface inherited by the job, which inherits quartz. ijob
/// </Summary>
Public interface iextendedjob: ijob
{
/// <Summary>
/// Return to the configuration panel instance
/// </Summary>
/// <Returns> </returns>
Usercontrol getconfigpanel ();
}

/// <Summary>
/// Interface inherited by the configuration panel
/// </Summary>
Public interface ijobconfigpanel
{
/// <Summary>
/// Return the configured job information: jobdetail
/// </Summary>
/// <Returns> </returns>
Jobdetail getjobdetail ();
}

For detailed extension definitions, refer to the code of the "email service, shutdown service" project.

Next implementation
  • Stop the task and view the execution status of the task.
  • Add some practical jobs: scheduled text messages, start-up task execution, shutdown and save work windows (automatically restored upon next boot)
  • Implementation of the lunar calendar trigger (very useful. Have you ever thought about sending text messages and emails to friends before every year on New Year's Eve? It's a pleasant surprise to her !)
  • Can be combined?FetionTo implement the automatic text message function (every morningVery diligentSend a blessing to your girlfriend! Is it true?Cool?)
Source code

Quartz. Net sample program: Enterprise scheduler v0.2 source code

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.