Interface IJobConfigurator<TJob>
- Namespace
- Quartz
- Assembly
- Quartz.dll
Declares one job inside AddQuartz(…): its key, its description, its durability and its
job data.
public interface IJobConfigurator<TJob> where TJob : IJob
Type Parameters
TJobThe job type being declared.
- Extension Methods
Remarks
The job type is the type argument rather than a value, which is what lets the data-map members take a property expression and what carries the trimming annotation to the container.
Methods
DisallowConcurrentExecution(bool)
Instructs the IScheduler whether or not concurrent execution of the job should be disallowed.
IJobConfigurator<TJob> DisallowConcurrentExecution(bool concurrentExecutionDisallowed = true)
Parameters
concurrentExecutionDisallowedboolIndicates whether or not concurrent execution of the job should be disallowed.
Returns
- IJobConfigurator<TJob>
The updated IJobConfigurator<TJob>.
Remarks
If not explicitly set, concurrent execution of a job is only disallowed if either the JobType itself, one of its ancestors or one of the interfaces that it implements, is annotated with DisallowConcurrentExecutionAttribute.
- See Also
PersistJobDataAfterExecution(bool)
Instructs the IScheduler whether or not job data should be re-stored when execution of the job completes.
IJobConfigurator<TJob> PersistJobDataAfterExecution(bool persistJobDataAfterExecution = true)
Parameters
persistJobDataAfterExecutionboolIndicates whether or not job data should be re-stored when execution of the job completes.
Returns
- IJobConfigurator<TJob>
The updated IJobConfigurator<TJob>.
Remarks
If not explicitly set, job data is only re-stored if either the JobType itself, one of its ancestors or one of the interfaces that it implements, is annotated with PersistJobDataAfterExecutionAttribute.
- See Also
RequestRecovery(bool)
Instructs the IScheduler whether or not the job should be re-executed if a 'recovery' or 'fail-over' situation is encountered.
IJobConfigurator<TJob> RequestRecovery(bool shouldRecover = true)
Parameters
shouldRecoverbool
Returns
- IJobConfigurator<TJob>
the updated JobBuilder
Remarks
If not explicitly set, the default value is false.
StoreDurably(bool)
Whether or not the job should remain stored after it is orphaned (no ITriggers point to it).
IJobConfigurator<TJob> StoreDurably(bool durability = true)
Parameters
durabilityboolthe value to set for the durability property.
Returns
- IJobConfigurator<TJob>
the updated JobBuilder
Remarks
If not explicitly set, the default value is false.
- See Also
UsingJobData(JobDataMap)
Add all the data from the given JobDataMap to the IJobDetail's JobDataMap.
IJobConfigurator<TJob> UsingJobData(JobDataMap newJobDataMap)
Parameters
newJobDataMapJobDataMap
Returns
- IJobConfigurator<TJob>
the updated JobBuilder
- See Also
UsingJobData(string, object?)
Add the given key-value pair to the JobDetail's JobDataMap.
IJobConfigurator<TJob> UsingJobData(string key, object? value)
Parameters
Returns
- IJobConfigurator<TJob>
the updated JobBuilder
Remarks
The value is stored as given. A persistent job store can only hold what its serializer
round-trips, and AdoJobStore's StoreJobDataAsStrings mode only strings.
- See Also
UsingJobData<TValue>(Expression<Func<TJob, TValue>>, TValue)
Add a value to the JobDetail's JobDataMap under the name of the job property it is meant to end up on.
IJobConfigurator<TJob> UsingJobData<TValue>(Expression<Func<TJob, TValue>> jobProperty, TValue value)
Parameters
jobPropertyExpression<Func<TJob, TValue>>an expression naming the job property, such as
job => job.ParametervalueTValuethe value to bind to that property
Returns
- IJobConfigurator<TJob>
the updated JobBuilder
Type Parameters
TValue
Remarks
The property is named rather than spelled, so the key cannot be mistyped and the value cannot be of the wrong type. It has to be a public settable property read directly off the job - a path through another property has nowhere to land, since the job factory sets properties on the job instance itself - and it is rejected here rather than dropped silently when the job runs. Properties inherited from a base job are fine.
The value is stored in the property's own type, so an implicit widening at the call site is undone and a value that does not fit is rejected here. An enum property takes the enum's name.
The same care applies as to any other job data: a persistent job store can only hold what its
serializer round-trips, and AdoJobStore's StoreJobDataAsStrings mode only strings. Nothing beyond
enums is converted for you.
- See Also
WithDescription(string?)
Set the given (human-meaningful) description of the Job.
IJobConfigurator<TJob> WithDescription(string? description)
Parameters
descriptionstringthe description for the Job
Returns
- IJobConfigurator<TJob>
the updated JobBuilder
- See Also
WithIdentity(JobKey)
Use a JobKey to identify the JobDetail.
IJobConfigurator<TJob> WithIdentity(JobKey key)
Parameters
keyJobKeythe Job's JobKey
Returns
- IJobConfigurator<TJob>
the updated JobBuilder
Remarks
If none of the 'withIdentity' methods are set on the JobBuilder, then a random, unique JobKey will be generated.
- See Also
WithIdentity(string)
Use a JobKey with the given name and default group to identify the JobDetail.
IJobConfigurator<TJob> WithIdentity(string name)
Parameters
namestringthe name element for the Job's JobKey
Returns
- IJobConfigurator<TJob>
the updated JobBuilder
Remarks
If none of the 'withIdentity' methods are set on the JobBuilder, then a random, unique JobKey will be generated.
- See Also
WithIdentity(string, string)
Use a JobKey with the given name and group to identify the JobDetail.
IJobConfigurator<TJob> WithIdentity(string name, string group)
Parameters
namestringthe name element for the Job's JobKey
groupstringthe group element for the Job's JobKey
Returns
- IJobConfigurator<TJob>
the updated JobBuilder
Remarks
If none of the 'withIdentity' methods are set on the JobBuilder, then a random, unique JobKey will be generated.
- See Also