Interface ISchedulerPlugin
- Namespace
- Quartz.Extensibility
- Assembly
- Quartz.dll
Provides an interface for a class to become a "plugin" to Quartz.
public interface ISchedulerPlugin
Remarks
Plugins can do virtually anything you wish, though the most interesting ones will obviously interact with the scheduler in some way - either actively: by invoking actions on the scheduler, or passively: by being a IJobListener, ITriggerListener, and/or ISchedulerListener.
A plugin is registered with the scheduler it extends, either with AddPlugin or by a
quartz.plugin.<name>.* key, and the scheduler initializes and starts it -
look at the configuration docs for details.
If you need direct access your plugin, you can have it explicitly put a reference to itself in the IScheduler's SchedulerContext as part of its Initialize(string, IScheduler, CancellationToken) method.
Methods
Initialize(string, IScheduler, CancellationToken)
Called during creation of the IScheduler in order to give the ISchedulerPlugin a chance to Initialize.
ValueTask Initialize(string pluginName, IScheduler scheduler, CancellationToken cancellationToken = default)
Parameters
pluginNamestringThe name by which the plugin is identified.
schedulerISchedulerThe scheduler to which the plugin is registered.
cancellationTokenCancellationTokenThe cancellation instruction.
Returns
Remarks
At this point, the Scheduler's IJobStore is not yet
If you need direct access your plugin, you can have it explicitly put a reference to itself in the IScheduler's SchedulerContext as part of its Initialize(string, IScheduler, CancellationToken) method.
Shutdown(CancellationToken)
Called in order to inform the ISchedulerPlugin that it should free up all of it's resources because the scheduler is shutting down.
ValueTask Shutdown(CancellationToken cancellationToken = default)
Parameters
cancellationTokenCancellationToken
Returns
Remarks
Does nothing unless the plugin says otherwise. Most plugins do all their work in Initialize(string, IScheduler, CancellationToken) — attaching a listener, registering a resolver — and have nothing to say at the two lifecycle moments; implement this only when there is something that cannot happen until the scheduler is running.
Start(CancellationToken)
Called when the associated IScheduler is started, in order to let the plug-in know it can now make calls into the scheduler if it needs to.
ValueTask Start(CancellationToken cancellationToken = default)
Parameters
cancellationTokenCancellationToken
Returns
Remarks
Does nothing unless the plugin says otherwise. Most plugins do all their work in Initialize(string, IScheduler, CancellationToken) — attaching a listener, registering a resolver — and have nothing to say at the two lifecycle moments; implement this only when there is something that cannot happen until the scheduler is running.