Quartz. NET 2.0 job scheduling framework, quartz. net2.0
Quartz. NET is an open-source job scheduling framework and is a. NET port of the Quartz API of OpenSymphony. It is written in C # and can be used in winform and asp.net applications. It provides great flexibility without sacrificing simplicity. You can use it to create simple or complex scheduling for executing a job. It has many features, such as database support, clusters, plug-ins, and cron-like expressions.
To schedule a Quartz job, you must: The scheduler (ischedil), the job (JobDetail), and the Trigger (Trigger)
The following code does not require the configuration file:
Using Quartz. impl; using System; namespace Quartz {class Program {static void Main (string [] args) {// The scheduler constructs the factory ISchedulerFactory = new StdSchedulerFactory (); // Step 1: construct the scheduler IScheduler scheduler = factory. getScheduler (); scheduler. start (); // Start the scheduler // Step 2: Define the job JobDetailImpl job = new JobDetailImpl ("MyJob1", typeof (HandleClass); // Step 3: define trigger ITrigger trigger = TriggerBuilder. create (). withIdentity ("t 1 ") // trigger name. forJob (job ). startNow (). withSimpleSchedule (x => x. repeatForever (). withIntervalInSeconds (1) // execute once every 1 s. build (); // Add the task and trigger to the scheduler: scheduler. scheduleJob (job, trigger) ;}/// <summary> /// work class /// </summary> public class HandleClass: IJob {// <summary> /// Method for calling the task /// </summary> public void Execute (IJobExecutionContext context) {Console. writeLine ("hello work! ");}}}
Source Code address: Quartz.zip
There are many java task scheduling frameworks. Which of the following is better to use quartz? Can someone tell me?
It is basically Quartz. I have seen that all projects use Quartz.
Quartz supports Cron expressions to define time points and SimpleTrigger corresponding time points, which can accurately define time points.
Quartz supports clusters and can be automatically allocated to different servers on multiple servers (together with one database) for execution.
Quartz supports multiple error handling methods (such as not executing the error next time, re-executing immediately, and re-executing the error next time)
Quartz supports multiple types of triggering failures (such as shutdown and triggering failures)
Quartz has many advantages. Similar frameworks are basically incomparable with Quartz.
What is the net framework 20?
NET Framework is a support library for Microsoft's next-generation platform (Dot Net. Programs Developed Using. net must run under the NET Framework. For example, the vb program requires the vb Runtime Library, and the java program requires the same jvm.
Net Framework is a new development platform developed by Microsoft following WindowsDNA .. Net Framework is a programming platform similar to the virtual machine running and management of Java systems. Based on CLR, it supports multiple languages (C #, VB. NET, C ++, Python, etc.
Reference: Definition of google NET Framework