QuartzJobBuilder
Namespace: Quartz
Assembly: Quartz (in Quartz.dll) Version: 3.0.0
public class JobBuilder
The JobBuilder type exposes the following members.
Name | Description | |
---|---|---|
JobBuilder | Initializes a new instance of the JobBuilder class |
Name | Description | |
---|---|---|
Build |
Produce the IJobDetail instance defined by this JobBuilder.
| |
Create |
Create a JobBuilder with which to define a IJobDetail.
| |
Create(Type) |
Create a JobBuilder with which to define a IJobDetail,
and set the class name of the job to be executed.
| |
CreateT |
Create a JobBuilder with which to define a IJobDetail,
and set the class name of the job to be executed.
| |
CreateForAsyncT |
Create a JobBuilder with which to define a IJobDetail,
and set the class name of the job to be executed.
| |
Equals | Determines whether the specified object is equal to the current object. (Inherited from Object.) | |
Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) | |
GetHashCode | Serves as the default hash function. (Inherited from Object.) | |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) | |
OfType(Type) |
Set the class which will be instantiated and executed when a
Trigger fires that is associated with this JobDetail.
| |
OfTypeT |
Set the class which will be instantiated and executed when a
Trigger fires that is associated with this JobDetail.
| |
RequestRecovery |
Instructs the IScheduler whether or not the job
should be re-executed if a 'recovery' or 'fail-over' situation is
encountered.
| |
RequestRecovery(Boolean) |
Instructs the IScheduler whether or not the job
should be re-executed if a 'recovery' or 'fail-over' situation is
encountered.
| |
SetJobData | ||
StoreDurably |
Whether or not the job should remain stored after it is
orphaned (no ITriggers point to it).
| |
StoreDurably(Boolean) |
Whether or not the job should remain stored after it is
orphaned (no ITriggers point to it).
| |
ToString | Returns a string that represents the current object. (Inherited from Object.) | |
UsingJobData(JobDataMap) | ||
UsingJobData(String, Boolean) |
Add the given key-value pair to the JobDetail's JobDataMap.
| |
UsingJobData(String, Double) |
Add the given key-value pair to the JobDetail's JobDataMap.
| |
UsingJobData(String, Int32) |
Add the given key-value pair to the JobDetail's JobDataMap.
| |
UsingJobData(String, Int64) |
Add the given key-value pair to the JobDetail's JobDataMap.
| |
UsingJobData(String, Single) |
Add the given key-value pair to the JobDetail's JobDataMap.
| |
UsingJobData(String, String) |
Add the given key-value pair to the JobDetail's JobDataMap.
| |
WithDescription |
Set the given (human-meaningful) description of the Job.
| |
WithIdentity(String) |
Use a JobKey with the given name and default group to
identify the JobDetail.
| |
WithIdentity(JobKey) |
Use a JobKey to identify the JobDetail.
| |
WithIdentity(String, String) |
Use a JobKey with the given name and group to
identify the JobDetail.
|
The builder will always try to keep itself in a valid state, with reasonable defaults set for calling Build() at any point. For instance if you do not invoke WithIdentity(..) a job name will be generated for you.
Quartz provides a builder-style API for constructing scheduling-related entities via a Domain-Specific Language (DSL). The DSL can best be utilized through the usage of static imports of the methods on the classes TriggerBuilder, JobBuilder, DateBuilder, JobKey, TriggerKey and the various IScheduleBuilder implementations.
Client code can then use the DSL to write code such as this:
IJobDetail job = JobBuilder.Create<MyJob>() .WithIdentity("myJob") .Build(); ITrigger trigger = TriggerBuilder.Create() .WithIdentity("myTrigger", "myTriggerGroup") .WithSimpleSchedule(x => x.WithIntervalInHours(1).RepeatForever()) .StartAt(DateBuilder.FutureDate(10, IntervalUnit.Minute)) .Build(); scheduler.scheduleJob(job, trigger);