IScheduler Interface

Quartz.NET 3.0 API Documentation
This is the main interface of a Quartz Scheduler.

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

C#
public interface IScheduler

The IScheduler type exposes the following members.

Properties

  NameDescription
Public propertyContext
Returns the SchedulerContext of the IScheduler.
Public propertyInStandbyMode
Reports whether the IScheduler is in stand-by mode.
Public propertyIsShutdown
Reports whether the IScheduler has been Shutdown.
Public propertyIsStarted
Whether the scheduler has been started.
Public propertyJobFactory
Set the JobFactory that will be responsible for producing instances of IJob classes.
Public propertyListenerManager
Get a reference to the scheduler's IListenerManager, through which listeners may be registered.
Public propertySchedulerInstanceId
Returns the instance Id of the IScheduler.
Public propertySchedulerName
Returns the name of the IScheduler.
Top
Methods

  NameDescription
Public methodAddCalendar
Add (register) the given ICalendar to the Scheduler.
Public methodAddJob(IJobDetail, Boolean, CancellationToken)
Add the given IJob to the Scheduler - with no associated ITrigger. The IJob will be 'dormant' until it is scheduled with a ITrigger, or TriggerJob(JobKey, CancellationToken) is called for it.
Public methodAddJob(IJobDetail, Boolean, Boolean, CancellationToken)
Add the given IJob to the Scheduler - with no associated ITrigger. The IJob will be 'dormant' until it is scheduled with a ITrigger, or TriggerJob(JobKey, CancellationToken) is called for it.
Public methodCheckExists(JobKey, CancellationToken)
Determine whether a IJob with the given identifier already exists within the scheduler.
Public methodCheckExists(TriggerKey, CancellationToken)
Determine whether a ITrigger with the given identifier already exists within the scheduler.
Public methodClear
Clears (deletes!) all scheduling data - all IJobs, ITriggers ICalendars.
Public methodDeleteCalendar
Delete the identified ICalendar from the Scheduler.
Public methodDeleteJob
Delete the identified IJob from the Scheduler - and any associated ITriggers.
Public methodDeleteJobs
Delete the identified jobs from the Scheduler - and any associated ITriggers.
Public methodGetCalendar
Get the ICalendar instance with the given name.
Public methodGetCalendarNames
Get the names of all registered ICalendar.
Public methodGetCurrentlyExecutingJobs
Return a list of IJobExecutionContext objects that represent all currently executing Jobs in this Scheduler instance.
Public methodGetJobDetail
Get the IJobDetail for the IJob instance with the given key .
Public methodGetJobGroupNames
Get the names of all known IJobDetail groups.
Public methodGetJobKeys
Get the keys of all the IJobDetails in the matching groups.
Public methodGetMetaData
Get a SchedulerMetaData object describing the settings and capabilities of the scheduler instance.
Public methodGetPausedTriggerGroups
Get the names of all ITrigger groups that are paused.
Public methodGetTrigger
Get the ITrigger instance with the given key.
Public methodGetTriggerGroupNames
Get the names of all known ITrigger groups.
Public methodGetTriggerKeys
Get the names of all the ITriggers in the given groups.
Public methodGetTriggersOfJob
Get all ITrigger s that are associated with the identified IJobDetail.
Public methodGetTriggerState
Get the current state of the identified ITrigger.
Public methodInterrupt(String, CancellationToken)
Request the cancellation, within this Scheduler instance, of the identified executing job instance.
Public methodInterrupt(JobKey, CancellationToken)
Request the cancellation, within this Scheduler instance, of all currently executing instances of the identified IJob.
Public methodIsJobGroupPaused
returns true if the given JobGroup is paused
Public methodIsTriggerGroupPaused
returns true if the given TriggerGroup is paused
Public methodPauseAll
Pause all triggers - similar to calling PauseTriggers(GroupMatcherTriggerKey, CancellationToken) on every group, however, after using this method ResumeAll(CancellationToken) must be called to clear the scheduler's state of 'remembering' that all new triggers will be paused as they are added.
Public methodPauseJob
Pause the IJobDetail with the given key - by pausing all of its current ITriggers.
Public methodPauseJobs
Pause all of the IJobDetails in the matching groups - by pausing all of their ITriggers.
Public methodPauseTrigger
Pause the ITrigger with the given key.
Public methodPauseTriggers
Pause all of the ITriggers in the groups matching.
Public methodRescheduleJob
Remove (delete) the ITrigger with the given key, and store the new given one - which must be associated with the same job (the new trigger must have the job name & group specified) - however, the new trigger need not have the same name as the old trigger.
Public methodResumeAll
Public methodResumeJob
Resume (un-pause) the IJobDetail with the given key.
Public methodResumeJobs
Resume (un-pause) all of the IJobDetails in matching groups.
Public methodResumeTrigger
Resume (un-pause) the ITrigger with the given key.
Public methodResumeTriggers
Resume (un-pause) all of the ITriggers in matching groups.
Public methodScheduleJob(ITrigger, CancellationToken)
Schedule the given ITrigger with the IJob identified by the ITrigger's settings.
Public methodScheduleJob(IJobDetail, ITrigger, CancellationToken)
Add the given IJobDetail to the Scheduler, and associate the given ITrigger with it.
Public methodScheduleJob(IJobDetail, IReadOnlyCollectionITrigger, Boolean, CancellationToken)
Schedule the given job with the related set of triggers.
Public methodScheduleJobs
Schedule all of the given jobs with the related set of triggers.
Public methodShutdown(CancellationToken)
Halts the IScheduler's firing of ITriggers, and cleans up all resources associated with the Scheduler. Equivalent to Shutdown(false).
Public methodShutdown(Boolean, CancellationToken)
Halts the IScheduler's firing of ITriggers, and cleans up all resources associated with the Scheduler.
Public methodStandby
Temporarily halts the IScheduler's firing of ITriggers.
Public methodStart
Starts the IScheduler's threads that fire ITriggers. When a scheduler is first created it is in "stand-by" mode, and will not fire triggers. The scheduler can also be put into stand-by mode by calling the Standby(CancellationToken) method.
Public methodStartDelayed
Calls Start(CancellationToken) after the indicated delay. (This call does not block). This can be useful within applications that have initializers that create the scheduler immediately, before the resources needed by the executing jobs have been fully initialized.
Public methodTriggerJob(JobKey, CancellationToken)
Trigger the identified IJobDetail (Execute it now).
Public methodTriggerJob(JobKey, JobDataMap, CancellationToken)
Trigger the identified IJobDetail (Execute it now).
Public methodUnscheduleJob
Remove the indicated ITrigger from the scheduler.

If the related job does not have any other triggers, and the job is not durable, then the job will also be deleted.

Public methodUnscheduleJobs
Remove all of the indicated ITriggers from the scheduler.
Top
Remarks

A IScheduler maintains a registry of IJobDetails and ITriggers. Once registered, the IScheduler is responsible for executing IJob s when their associated ITrigger s fire (when their scheduled time arrives).

IScheduler instances are produced by a ISchedulerFactory. A scheduler that has already been created/initialized can be found and used through the same factory that produced it. After a IScheduler has been created, it is in "stand-by" mode, and must have its Start(CancellationToken) method called before it will fire any IJobs.

IJob s are to be created by the 'client program', by defining a class that implements the IJob interface. IJobDetail objects are then created (also by the client) to define a individual instances of the IJob. IJobDetail instances can then be registered with the IScheduler via the %IScheduler.ScheduleJob(JobDetail, Trigger)% or %IScheduler.AddJob(JobDetail, bool)% method.

ITrigger s can then be defined to fire individual IJob instances based on given schedules. ISimpleTrigger s are most useful for one-time firings, or firing at an exact moment in time, with N repeats with a given delay between them. ICronTrigger s allow scheduling based on time of day, day of week, day of month, and month of year.

IJob s and ITrigger s have a name and group associated with them, which should uniquely identify them within a single IScheduler. The 'group' feature may be useful for creating logical groupings or categorizations of IJobs and ITriggers. If you don't have need for assigning a group to a given IJobs of ITriggers, then you can use the DefaultGroup constant defined on this interface.

Stored IJob s can also be 'manually' triggered through the use of the %IScheduler.TriggerJob(string, string)% function.

Client programs may also be interested in the 'listener' interfaces that are available from Quartz. The IJobListener interface provides notifications of IJob executions. The ITriggerListener interface provides notifications of ITrigger firings. The ISchedulerListener interface provides notifications of IScheduler events and errors. Listeners can be associated with local schedulers through the IListenerManager interface.

The setup/configuration of a IScheduler instance is very customizable. Please consult the documentation distributed with Quartz.

See Also

Reference