JobBuilder Class

Quartz.NET 3.0 API Documentation
JobBuilder is used to instantiate IJobDetails.
Inheritance Hierarchy

SystemObject
  QuartzJobBuilder

Namespace:  Quartz
Assembly:  Quartz (in Quartz.dll) Version: 3.0.0
Syntax

C#
public class JobBuilder

The JobBuilder type exposes the following members.

Constructors

  NameDescription
Protected methodJobBuilder
Initializes a new instance of the JobBuilder class
Top
Methods

  NameDescription
Public methodBuild
Produce the IJobDetail instance defined by this JobBuilder.
Public methodStatic memberCreate
Create a JobBuilder with which to define a IJobDetail.
Public methodStatic memberCreate(Type)
Create a JobBuilder with which to define a IJobDetail, and set the class name of the job to be executed.
Public methodStatic memberCreateT
Create a JobBuilder with which to define a IJobDetail, and set the class name of the job to be executed.
Public methodStatic memberCreateForAsyncT
Create a JobBuilder with which to define a IJobDetail, and set the class name of the job to be executed.
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodOfType(Type)
Set the class which will be instantiated and executed when a Trigger fires that is associated with this JobDetail.
Public methodOfTypeT
Set the class which will be instantiated and executed when a Trigger fires that is associated with this JobDetail.
Public methodRequestRecovery
Instructs the IScheduler whether or not the job should be re-executed if a 'recovery' or 'fail-over' situation is encountered.
Public methodRequestRecovery(Boolean)
Instructs the IScheduler whether or not the job should be re-executed if a 'recovery' or 'fail-over' situation is encountered.
Public methodSetJobData
Replace the IJobDetail's JobDataMap with the given JobDataMap.
Public methodStoreDurably
Whether or not the job should remain stored after it is orphaned (no ITriggers point to it).
Public methodStoreDurably(Boolean)
Whether or not the job should remain stored after it is orphaned (no ITriggers point to it).
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Public methodUsingJobData(JobDataMap)
Add all the data from the given JobDataMap to the IJobDetail's JobDataMap.
Public methodUsingJobData(String, Boolean)
Add the given key-value pair to the JobDetail's JobDataMap.
Public methodUsingJobData(String, Double)
Add the given key-value pair to the JobDetail's JobDataMap.
Public methodUsingJobData(String, Int32)
Add the given key-value pair to the JobDetail's JobDataMap.
Public methodUsingJobData(String, Int64)
Add the given key-value pair to the JobDetail's JobDataMap.
Public methodUsingJobData(String, Single)
Add the given key-value pair to the JobDetail's JobDataMap.
Public methodUsingJobData(String, String)
Add the given key-value pair to the JobDetail's JobDataMap.
Public methodWithDescription
Set the given (human-meaningful) description of the Job.
Public methodWithIdentity(String)
Use a JobKey with the given name and default group to identify the JobDetail.
Public methodWithIdentity(JobKey)
Use a JobKey to identify the JobDetail.
Public methodWithIdentity(String, String)
Use a JobKey with the given name and group to identify the JobDetail.
Top
Remarks

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);
See Also

Reference