Quartz.Net – The IJobDetail Interface

This is another of the documentation series posts. This post will be documenting the IJobDetail interface. Here it is:

namespace Quartz
{
    /// <summary>
    /// Conveys the detail properties of a given job instance. 
    /// JobDetails are to be created/defined with <see cref="JobBuilder" />.
    /// </summary>
    /// <remarks>
    /// Quartz does not store an actual instance of a <see cref="IJob" /> type, but
    /// instead allows you to define an instance of one, through the use of a <see cref="IJobDetail" />.
    /// <para>
    /// <see cref="IJob" />s have a name and group associated with them, which
    /// should uniquely identify them within a single <see cref="IScheduler" />.
    /// </para>
    /// <para>
    /// <see cref="ITrigger" /> s are the 'mechanism' by which <see cref="IJob" /> s
    /// are scheduled. Many <see cref="ITrigger" /> s can point to the same <see cref="IJob" />,
    /// but a single <see cref="ITrigger" /> can only point to one <see cref="IJob" />.
    /// </para>
    /// </remarks>
    /// <seealso cref="IJob" />
    /// <seealso cref="DisallowConcurrentExecutionAttribute"/>
    /// <seealso cref="PersistJobDataAfterExecutionAttribute"/>
    /// <seealso cref="Quartz.JobDataMap"/>
    /// <seealso cref="ITrigger"/>
    /// <author>James House</author>
    /// <author>Marko Lahma (.NET)</author>
    public interface IJobDetail : ICloneable
    {
        /// <summary>
        /// The key that identifies this jobs uniquely.
        /// </summary>
        JobKey Key { get; }
    /// &lt;summary&gt;
    /// Get or set the description given to the &lt;see cref="IJob" /&gt; instance by its
    /// creator (if any).
    /// &lt;/summary&gt;
    string Description { get; }

    /// &lt;summary&gt;
    /// Get or sets the instance of &lt;see cref="IJob" /&gt; that will be executed.
    /// &lt;/summary&gt;
    Type JobType { get; }

    /// &lt;summary&gt;
    /// Get or set the &lt;see cref="JobDataMap" /&gt; that is associated with the &lt;see cref="IJob" /&gt;.
    /// &lt;/summary&gt;
    JobDataMap JobDataMap { get; }

    /// &lt;summary&gt;
    /// Whether or not the &lt;see cref="IJob" /&gt; should remain stored after it is
    /// orphaned (no &lt;see cref="ITrigger" /&gt;s point to it).
    /// &lt;/summary&gt;
    /// &lt;remarks&gt;
    /// If not explicitly set, the default value is &lt;see langword="false" /&gt;.
    /// &lt;/remarks&gt;
    /// &lt;returns&gt; 
    /// &lt;see langword="true" /&gt; if the Job should remain persisted after being orphaned.
    /// &lt;/returns&gt;
    bool Durable { get; }

    /// &lt;summary&gt;
    /// Whether the associated Job class carries the &lt;see cref="PersistJobDataAfterExecutionAttribute" /&gt;.
    /// &lt;/summary&gt;
    /// &lt;seealso cref="PersistJobDataAfterExecutionAttribute" /&gt;
    bool PersistJobDataAfterExecution { get; }

    /// &lt;summary&gt;
    /// Whether the associated Job class carries the &lt;see cref="DisallowConcurrentExecutionAttribute" /&gt;.
    /// &lt;/summary&gt;
    /// &lt;seealso cref="DisallowConcurrentExecutionAttribute"/&gt;
    bool ConcurrentExecutionDisallowed { get; }

    /// &lt;summary&gt;
    /// Set whether or not the the &lt;see cref="IScheduler" /&gt; should re-Execute
    /// the &lt;see cref="IJob" /&gt; if a 'recovery' or 'fail-over' situation is
    /// encountered.
    /// &lt;/summary&gt;
    /// &lt;remarks&gt;
    /// If not explicitly set, the default value is &lt;see langword="false" /&gt;.
    /// &lt;/remarks&gt;
    /// &lt;seealso cref="IJobExecutionContext.Recovering" /&gt;
    bool RequestsRecovery { get; }

    /// &lt;summary&gt;
    /// Get a &lt;see cref="JobBuilder" /&gt; that is configured to produce a 
    /// &lt;see cref="IJobDetail" /&gt; identical to this one.
    /// &lt;/summary&gt;
    JobBuilder GetJobBuilder();
}

}

Continue Reading

Quartz.Net &ndash; The Quartz.IJob Interface

This post is part of the documenation series. It just provides a place to document some of the classes and interfaces that are not available in the API documentation.

In this post we are documenting the IJob interface. Without further ado, here it is:

namespace Quartz
{
	/// <summary> 
	/// The interface to be implemented by classes which represent a 'job' to be
	/// performed.
	/// </summary>
	/// <remarks>
	/// Instances of this interface must have a <see langword="public" />
	/// no-argument constructor. <see cref="JobDataMap" /> provides a mechanism for 'instance member data'
	/// that may be required by some implementations of this interface.
    /// </remarks>
	/// <seealso cref="IJobDetail" />
    /// <seealso cref="JobBuilder" />
    /// <seealso cref="DisallowConcurrentExecutionAttribute" />
    /// <seealso cref="PersistJobDataAfterExecutionAttribute" />
	/// <seealso cref="ITrigger" />
	/// <seealso cref="IScheduler" />
	/// <author>James House</author>
	/// <author>Marko Lahma (.NET)</author>
	public interface IJob
	{
		/// <summary>
		/// Called by the <see cref="IScheduler" /> when a <see cref="ITrigger" />
		/// fires that is associated with the <see cref="IJob" />.
        /// </summary>
		/// <remarks>
		/// The implementation may wish to set a  result object on the 
		/// JobExecutionContext before this method exits.  The result itself
		/// is meaningless to Quartz, but may be informative to 
		/// <see cref="IJobListener" />s or 
		/// <see cref="ITriggerListener" />s that are watching the job's 
		/// execution.
		/// </remarks>
		/// <param name="context">The execution context.</param>
        void Execute(IJobExecutionContext context);
	}
}

 

Continue Reading

Quartz.Net &ndash; The Missing API Documentation

Unfortunately it seems that the Quartz.Net API documentation that is available online is not complete. Since I would like to link to some of these classes and interfaces from some of my posts, I’m going to start adding them as separate posts, all tagged as documentation.

At some point I’ll tackle generating another set of API documents with all the missing classes but until then, these posts will have to do.

Continue Reading

Quartz.NET 2 Tutorial - Lesson 1: Using Quartz

Lesson 1: Using Quartz

There are at least two ways to use Quartz.Net: embedded (hosted) in your application or as a standalone windows service.

Embedding Quartz.Net in Your Application

If you are going to host the Quartz.Net scheduler in your application, you’ll need to create a scheduler. This can be easily done through the scheduler factory provided in the distribution. The scheduler factory configures your scheduler for you.

Continue Reading