diff --git a/Quartz.2010.5.1.ReSharper b/Quartz.2010.5.1.ReSharper
index 491f2e042..6036c04b6 100644
--- a/Quartz.2010.5.1.ReSharper
+++ b/Quartz.2010.5.1.ReSharper
@@ -82,7 +82,7 @@
/// The implementation may wish to set a result object on the
@@ -44,7 +44,7 @@ public class TriggerEchoJob : IJob
/// The execution context.
///
/// The implementation may wish to set a result object on the
@@ -46,7 +46,7 @@ public class BadJob2 : IStatefulJob
///
/// The implementation may wish to set a result object on the
@@ -43,7 +43,7 @@ public class SimpleJob : IJob
///
/// The implementation may wish to set a result object on the
@@ -44,7 +44,7 @@ public class SimpleJob1 : IJob
///
/// The implementation may wish to set a result object on the
@@ -37,7 +37,7 @@ public class TestJob : IJob
/// CalendarIntervalScheduleBuilder
is a {@link ScheduleBuilder}
- * that defines calendar time (day, week, month, year) interval-based
- * schedules for Trigger
s.
- *
- *
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 ScheduleBuilder
implementations.
Client code can then use the DSL to write code such as this:
- *- * JobDetail job = newJob(MyJob.class) - * .withIdentity("myJob") - * .build(); - * - * Trigger trigger = newTrigger() - * .withIdentity(triggerKey("myTrigger", "myTriggerGroup")) - * .withSchedule(simpleSchedule() - * .withIntervalInHours(1) - * .repeatForever()) - * .startAt(futureDate(10, MINUTES)) - * .build(); - * - * scheduler.scheduleJob(job, trigger); - *- * - * @see CalenderIntervalTrigger - * @see CronScheduleBuilder - * @see ScheduleBuilder - * @see SimpleScheduleBuilder - * @see TriggerBuilder - */ - + ////// - ///+ /// + ///CalendarIntervalScheduleBuilder
is a {@link ScheduleBuilder} + /// that defines calendar time (day, week, month, year) interval-based + /// schedules forTrigger
s. + ///+ /// + ///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 variousScheduleBuilder
implementations.Client code can then use the DSL to write code such as this:
+ ///+ /// JobDetail job = newJob(MyJob.class) + /// .withIdentity("myJob") + /// .build(); + /// Trigger trigger = newTrigger() + /// .withIdentity(triggerKey("myTrigger", "myTriggerGroup")) + /// .withSchedule(simpleSchedule() + /// .withIntervalInHours(1) + /// .repeatForever()) + /// .startAt(futureDate(10, MINUTES)) + /// .build(); + /// scheduler.scheduleJob(job, trigger); + ///+ ///+ /// + /// + /// + /// public class CalendarIntervalScheduleBuilder : ScheduleBuilder { private int interval = 1; @@ -52,25 +48,21 @@ private CalendarIntervalScheduleBuilder() { } - /** - * Create a CalendarIntervalScheduleBuilder. - * - * @return the new CalendarIntervalScheduleBuilder - */ - - public static CalendarIntervalScheduleBuilder CalendarIntervalSchedule() + /// + /// Create a CalendarIntervalScheduleBuilder. + /// + ///+ public static CalendarIntervalScheduleBuilder Create() { return new CalendarIntervalScheduleBuilder(); } - /** - * Build the actual Trigger -- NOT intended to be invoked by end users, - * but will rather be invoked by a TriggerBuilder which this - * ScheduleBuilder is given to. - * - * @see TriggerBuilder#withSchedule(ScheduleBuilder) - */ - + /// + /// Build the actual Trigger -- NOT intended to be invoked by end users, + /// but will rather be invoked by a TriggerBuilder which this + /// ScheduleBuilder is given to. + /// + ///public override IMutableTrigger Build() { CalendarIntervalTriggerImpl st = new CalendarIntervalTriggerImpl(); @@ -80,193 +72,194 @@ public override IMutableTrigger Build() return st; } - /** - * Specify the time unit and interval for the Trigger to be produced. - * - * @param interval the interval at which the trigger should repeat. - * @param unit the time unit (IntervalUnit) of the interval. - * @return the updated CalendarIntervalScheduleBuilder - * @see CalendarIntervalTrigger#getRepeatInterval() - * @see CalendarIntervalTrigger#getRepeatIntervalUnit() - */ - - public CalendarIntervalScheduleBuilder withInterval(int interval, IntervalUnit unit) + /// + /// Specify the time unit and interval for the Trigger to be produced. + /// + ///+ /// + /// the interval at which the trigger should repeat. + /// the time unit (IntervalUnit) of the interval. + ///the updated CalendarIntervalScheduleBuilder + ///+ /// + public CalendarIntervalScheduleBuilder WithInterval(int interval, IntervalUnit unit) { - validateInterval(interval); + ValidateInterval(interval); this.interval = interval; this.intervalUnit = unit; return this; } - /** - * Specify an interval in the IntervalUnit.SECOND that the produced - * Trigger will repeat at. - * - * @param intervalInSeconds the number of seconds at which the trigger should repeat. - * @return the updated CalendarIntervalScheduleBuilder - * @see CalendarIntervalTrigger#getRepeatInterval() - * @see CalendarIntervalTrigger#getRepeatIntervalUnit() - */ - - public CalendarIntervalScheduleBuilder withIntervalInSeconds(int intervalInSeconds) + /// + /// Specify an interval in the IntervalUnit.SECOND that the produced + /// Trigger will repeat at. + /// + ///+ /// + /// the number of seconds at which the trigger should repeat. + ///the updated CalendarIntervalScheduleBuilder + ///+ /// + public CalendarIntervalScheduleBuilder WithIntervalInSeconds(int intervalInSeconds) { - validateInterval(intervalInSeconds); + ValidateInterval(intervalInSeconds); this.interval = intervalInSeconds; this.intervalUnit = IntervalUnit.Second; return this; } - /** - * Specify an interval in the IntervalUnit.MINUTE that the produced - * Trigger will repeat at. - * - * @param intervalInMinutes the number of minutes at which the trigger should repeat. - * @return the updated CalendarIntervalScheduleBuilder - * @see CalendarIntervalTrigger#getRepeatInterval() - * @see CalendarIntervalTrigger#getRepeatIntervalUnit() - */ - - public CalendarIntervalScheduleBuilder withIntervalInMinutes(int intervalInMinutes) + /// + /// Specify an interval in the IntervalUnit.MINUTE that the produced + /// Trigger will repeat at. + /// + ///+ /// + /// the number of minutes at which the trigger should repeat. + ///the updated CalendarIntervalScheduleBuilder + ///+ /// + public CalendarIntervalScheduleBuilder WithIntervalInMinutes(int intervalInMinutes) { - validateInterval(intervalInMinutes); + ValidateInterval(intervalInMinutes); this.interval = intervalInMinutes; this.intervalUnit = IntervalUnit.Minute; return this; } - /** - * Specify an interval in the IntervalUnit.HOUR that the produced - * Trigger will repeat at. - * - * @param intervalInHours the number of hours at which the trigger should repeat. - * @return the updated CalendarIntervalScheduleBuilder - * @see CalendarIntervalTrigger#getRepeatInterval() - * @see CalendarIntervalTrigger#getRepeatIntervalUnit() - */ - - public CalendarIntervalScheduleBuilder withIntervalInHours(int intervalInHours) + /// + /// Specify an interval in the IntervalUnit.HOUR that the produced + /// Trigger will repeat at. + /// + ///+ /// + /// the number of hours at which the trigger should repeat. + ///the updated CalendarIntervalScheduleBuilder + ///+ /// + public CalendarIntervalScheduleBuilder WithIntervalInHours(int intervalInHours) { - validateInterval(intervalInHours); + ValidateInterval(intervalInHours); this.interval = intervalInHours; this.intervalUnit = IntervalUnit.Hour; return this; } - /** - * Specify an interval in the IntervalUnit.DAY that the produced - * Trigger will repeat at. - * - * @param intervalInDays the number of days at which the trigger should repeat. - * @return the updated CalendarIntervalScheduleBuilder - * @see CalendarIntervalTrigger#getRepeatInterval() - * @see CalendarIntervalTrigger#getRepeatIntervalUnit() - */ - - public CalendarIntervalScheduleBuilder withIntervalInDays(int intervalInDays) + /// + /// Specify an interval in the IntervalUnit.DAY that the produced + /// Trigger will repeat at. + /// + ///+ /// + /// the number of days at which the trigger should repeat. + ///the updated CalendarIntervalScheduleBuilder + ///+ /// + public CalendarIntervalScheduleBuilder WithIntervalInDays(int intervalInDays) { - validateInterval(intervalInDays); + ValidateInterval(intervalInDays); this.interval = intervalInDays; this.intervalUnit = IntervalUnit.Day; return this; } - /** - * Specify an interval in the IntervalUnit.WEEK that the produced - * Trigger will repeat at. - * - * @param intervalInWeeks the number of weeks at which the trigger should repeat. - * @return the updated CalendarIntervalScheduleBuilder - * @see CalendarIntervalTrigger#getRepeatInterval() - * @see CalendarIntervalTrigger#getRepeatIntervalUnit() - */ - - public CalendarIntervalScheduleBuilder withIntervalInWeeks(int intervalInWeeks) + /// + /// Specify an interval in the IntervalUnit.WEEK that the produced + /// Trigger will repeat at. + /// + ///+ /// + /// the number of weeks at which the trigger should repeat. + ///the updated CalendarIntervalScheduleBuilder + ///+ /// + public CalendarIntervalScheduleBuilder WithIntervalInWeeks(int intervalInWeeks) { - validateInterval(intervalInWeeks); + ValidateInterval(intervalInWeeks); this.interval = intervalInWeeks; this.intervalUnit = IntervalUnit.Week; return this; } - /** - * Specify an interval in the IntervalUnit.MONTH that the produced - * Trigger will repeat at. - * - * @param intervalInMonths the number of months at which the trigger should repeat. - * @return the updated CalendarIntervalScheduleBuilder - * @see CalendarIntervalTrigger#getRepeatInterval() - * @see CalendarIntervalTrigger#getRepeatIntervalUnit() - */ - - public CalendarIntervalScheduleBuilder withIntervalInMonths(int intervalInMonths) + /// + /// Specify an interval in the IntervalUnit.MONTH that the produced + /// Trigger will repeat at. + /// + ///+ /// + /// the number of months at which the trigger should repeat. + ///the updated CalendarIntervalScheduleBuilder + ///+ /// + public CalendarIntervalScheduleBuilder WithIntervalInMonths(int intervalInMonths) { - validateInterval(intervalInMonths); + ValidateInterval(intervalInMonths); this.interval = intervalInMonths; this.intervalUnit = IntervalUnit.Month; return this; } - /** - * Specify an interval in the IntervalUnit.YEAR that the produced - * Trigger will repeat at. - * - * @param intervalInYears the number of years at which the trigger should repeat. - * @return the updated CalendarIntervalScheduleBuilder - * @see CalendarIntervalTrigger#getRepeatInterval() - * @see CalendarIntervalTrigger#getRepeatIntervalUnit() - */ - - public CalendarIntervalScheduleBuilder withIntervalInYears(int intervalInYears) + /// + /// Specify an interval in the IntervalUnit.YEAR that the produced + /// Trigger will repeat at. + /// + ///+ /// + /// the number of years at which the trigger should repeat. + ///the updated CalendarIntervalScheduleBuilder + ///+ /// + public CalendarIntervalScheduleBuilder WithIntervalInYears(int intervalInYears) { - validateInterval(intervalInYears); + ValidateInterval(intervalInYears); this.interval = intervalInYears; this.intervalUnit = IntervalUnit.Year; return this; } - /** - * If the Trigger misfires, use the - * {@link Trigger#MISFIRE_INSTRUCTION_IGNORE_MISFIRE_POLICY} instruction. - * - * @return the updated CronScheduleBuilder - * @see Trigger#MISFIRE_INSTRUCTION_IGNORE_MISFIRE_POLICY - */ - public CalendarIntervalScheduleBuilder withMisfireHandlingInstructionIgnoreMisfires() + /// + /// If the Trigger misfires, use the + /// {@link Trigger#MISFIRE_INSTRUCTION_IGNORE_MISFIRE_POLICY} instruction. + /// + ///+ /// + ///the updated CronScheduleBuilder + ///+ public CalendarIntervalScheduleBuilder WithMisfireHandlingInstructionIgnoreMisfires() { misfireInstruction = MisfireInstruction.IgnoreMisfirePolicy; return this; - } - + } - /** - * If the Trigger misfires, use the - * {@link CalendarIntervalTrigger#MISFIRE_INSTRUCTION_DO_NOTHING} instruction. - * - * @return the updated CalendarIntervalScheduleBuilder - * @see CalendarIntervalTrigger#MISFIRE_INSTRUCTION_DO_NOTHING - */ - public CalendarIntervalScheduleBuilder withMisfireHandlingInstructionDoNothing() + /// + /// If the Trigger misfires, use the + /// + ///instruction. + /// + /// + ///the updated CalendarIntervalScheduleBuilder + ///+ public CalendarIntervalScheduleBuilder WithMisfireHandlingInstructionDoNothing() { misfireInstruction = MisfireInstruction.CalendarIntervalTrigger.DoNothing; return this; } - /** - * If the Trigger misfires, use the - * {@link CalendarIntervalTrigger#MISFIRE_INSTRUCTION_FIRE_ONCE_NOW} instruction. - * - * @return the updated CalendarIntervalScheduleBuilder - * @see CalendarIntervalTrigger#MISFIRE_INSTRUCTION_FIRE_ONCE_NOW - */ - - public CalendarIntervalScheduleBuilder withMisfireHandlingInstructionFireAndProceed() + /// + /// If the Trigger misfires, use the + /// + ///instruction. + /// + /// + ///the updated CalendarIntervalScheduleBuilder + ///+ public CalendarIntervalScheduleBuilder WithMisfireHandlingInstructionFireAndProceed() { misfireInstruction = MisfireInstruction.CalendarIntervalTrigger.FireOnceNow; return this; } - private void validateInterval(int interval) + private static void ValidateInterval(int interval) { if (interval <= 0) { @@ -274,7 +267,7 @@ private void validateInterval(int interval) } } - internal CalendarIntervalScheduleBuilder withMisfireHandlingInstruction(int readMisfireInstructionFromString) + internal CalendarIntervalScheduleBuilder WithMisfireHandlingInstruction(int readMisfireInstructionFromString) { misfireInstruction = readMisfireInstructionFromString; return this; diff --git a/src/Quartz/Core/JobRunShell.cs b/src/Quartz/Core/JobRunShell.cs index b01e1445f..ad6941887 100644 --- a/src/Quartz/Core/JobRunShell.cs +++ b/src/Quartz/Core/JobRunShell.cs @@ -31,7 +31,7 @@ namespace Quartz.Core /// JobRunShell instances are responsible for providing the 'safe' environment /// for s to run in, and for performing all of the work of /// executing the , catching ANY thrown exceptions, updating - /// the with the 's completion code, + /// the with the 's completion code, /// etc. /// /// A
- /// - /// - ///instance is created by a @@ -43,7 +43,7 @@ namespace Quartz.Core /// /// /// - /// + /// /// James House ///Marko Lahma (.NET) public class JobRunShell : SchedulerListenerSupport, IThreadRunnable diff --git a/src/Quartz/Core/ListenerManagerImpl.cs b/src/Quartz/Core/ListenerManagerImpl.cs index 156b2a80d..1f4016340 100644 --- a/src/Quartz/Core/ListenerManagerImpl.cs +++ b/src/Quartz/Core/ListenerManagerImpl.cs @@ -21,7 +21,7 @@ public class ListenerManagerImpl : IListenerManager public void AddJobListener(IJobListener jobListener, params IMatcher[] matchers) { - AddJobListener(jobListener, matchers); + AddJobListener(jobListener, new List >(matchers)); } public void AddJobListener(IJobListener jobListener, IList > matchers) @@ -144,7 +144,7 @@ public IJobListener GetJobListener(string name) public void AddTriggerListener(ITriggerListener triggerListener, params IMatcher [] matchers) { - AddTriggerListener(triggerListener, matchers); + AddTriggerListener(triggerListener, new List >(matchers)); } public void AddTriggerListener(ITriggerListener triggerListener, IList > matchers) @@ -169,7 +169,7 @@ public void AddTriggerListener(ITriggerListener triggerListener, IList matcher) + public void AddTriggerListener(ITriggerListener triggerListener, IMatcher matcher) { if (matcher == null) { @@ -184,8 +184,7 @@ public void addTriggerListener(ITriggerListener triggerListener, IMatcher > matchers = new List >(); - matchers.Add(matcher); + var matchers = new List > {matcher}; globalTriggerListenersMatchers[triggerListener.Name] = matchers; } } diff --git a/src/Quartz/Core/QuartzScheduler.cs b/src/Quartz/Core/QuartzScheduler.cs index 7fdf7bc21..ddc7001b4 100644 --- a/src/Quartz/Core/QuartzScheduler.cs +++ b/src/Quartz/Core/QuartzScheduler.cs @@ -225,7 +225,7 @@ public virtual bool IsStarted } /// - /// Return a list of /// The DB connection - /// The name of the trigger. - /// The group containing the trigger + /// The key identifying the trigger. /// The new state for the trigger /// The old state the trigger must be in ///objects that + /// Return a list of objects that /// represent all currently executing Jobs in this Scheduler instance. /// /// This method is not cluster aware. That is, it will only return Jobs @@ -398,9 +398,9 @@ public virtual bool RemoveNoGCObject(object obj) } ///
- /// Starts the @@ -473,7 +473,7 @@ public void Run() } ///'s threads that fire s. + /// Starts the 's threads that fire s. /// - /// All
///s that have misfired will + /// All s that have misfired will /// be passed to the appropriate TriggerListener(s). /// - /// Temporarily halts the void SchedulerError(string msg, SchedulerException cause); diff --git a/src/Quartz/ISimpleTrigger.cs b/src/Quartz/ISimpleTrigger.cs index 7ab5084ef..2c890ed1d 100644 --- a/src/Quartz/ISimpleTrigger.cs +++ b/src/Quartz/ISimpleTrigger.cs @@ -1,12 +1,14 @@ using System; +using Quartz.Impl.Triggers; + namespace Quartz { ///'s firing of s. + /// Temporarily halts the 's firing of s. /// /// The scheduler is not destroyed, and can be re-started at any time. ///
@@ -518,7 +518,7 @@ public bool Clustered } ///- /// Halts the ///'s firing of s, + /// Halts the 's firing of s, /// and cleans up all resources associated with the QuartzScheduler. /// Equivalent to . /// @@ -531,7 +531,7 @@ public virtual void Shutdown() } ///
/// - ///- /// Halts the 's firing of s, + /// Halts the 's firing of s, /// and cleans up all resources associated with the QuartzScheduler. /// /// The scheduler cannot be re-started. @@ -643,8 +643,8 @@ public virtual void ValidateState() ///
+ /// + /// + /// the Date to round, if/// Add the identified by the given - /// to the Scheduler, and - /// associate the given with it. + /// to the Scheduler, and + /// associate the given with it. /// /// If the given Trigger does not reference any
- * - * @param date - * the Date to round, if, then it /// will be set to reference the Job passed with it into this method. @@ -713,8 +713,8 @@ public virtual DateTimeOffset ScheduleJob(IJobDetail jobDetail, ITrigger trigger } /// - /// Schedule the given public virtual DateTimeOffset ScheduleJob(ITrigger trigger) { @@ -754,8 +754,8 @@ public virtual DateTimeOffset ScheduleJob(ITrigger trigger) ///with the - /// identified by the 's settings. + /// Schedule the given with the + /// identified by the 's settings. /// /// Add the given ///to the Scheduler - with no associated - /// . The will be 'dormant' until - /// it is scheduled with a , or + /// . The will be 'dormant' until + /// it is scheduled with a , or /// is called for it. /// /// The
must by definition be 'durable', if it is not, @@ -778,7 +778,7 @@ public virtual void AddJob(IJobDetail jobDetail, bool replace) /// /// Delete the identified ///from the Scheduler - and any - /// associated s. + /// associated s. /// true if the Job was found and deleted. public virtual bool DeleteJob(JobKey jobKey) @@ -828,8 +828,6 @@ public void ScheduleJobs(IDictionary> triggersAndJob { ValidateState(); - bool result = false; - resources.JobStore.StoreJobsAndTriggers(triggersAndJobs, replace); NotifySchedulerThread(null); foreach (IJobDetail job in triggersAndJobs.Keys) @@ -854,7 +852,7 @@ public bool UnscheduleJobs(IList triggerKeys) } /// - /// Remove the indicated public virtual bool UnscheduleJob(TriggerKey triggerKey) @@ -876,15 +874,14 @@ public virtual bool UnscheduleJob(TriggerKey triggerKey) ///from the + /// Remove the indicated from the /// scheduler. /// - /// Remove (delete) the - /// The name of thewith the + /// Remove (delete) the with the /// given name, and store the new given one - which must be associated /// with the same job. /// to be removed. - /// The group name of the to be removed. - /// The new to be stored. + /// the key of the trigger + /// The new to be stored. /// - /// @@ -986,7 +983,7 @@ public virtual void TriggerJob(JobKey jobKey, JobDataMap data) } ///if a with the given + /// if a with the given /// name and group was not found and removed from the store, otherwise /// the first fire time of the newly scheduled trigger. /// - /// Pause the public virtual void PauseTrigger(TriggerKey triggerKey) { @@ -998,7 +995,7 @@ public virtual void PauseTrigger(TriggerKey triggerKey) } ///with the given name. + /// Pause the with the given name. /// - /// Pause all of the public virtual void PauseTriggerGroup(string groupName) { @@ -1015,8 +1012,8 @@ public virtual void PauseTriggerGroup(string groupName) } ///s in the given group. + /// Pause all of the s in the given group. /// - /// Pause the public virtual void PauseJob(JobKey jobKey) { @@ -1028,8 +1025,8 @@ public virtual void PauseJob(JobKey jobKey) } ///with the given - /// name - by pausing all of its current s. + /// Pause the with the given + /// name - by pausing all of its current s. /// - /// Pause all of the public virtual void PauseJobGroup(string groupName) { @@ -1046,11 +1043,11 @@ public virtual void PauseJobGroup(string groupName) } ///s in the - /// given group - by pausing all of their s. + /// Pause all of the s in the + /// given group - by pausing all of their s. /// - /// Resume (un-pause) the public virtual void ResumeTrigger(TriggerKey triggerKey) @@ -1063,11 +1060,11 @@ public virtual void ResumeTrigger(TriggerKey triggerKey) } ///with the given + /// Resume (un-pause) the with the given /// name. /// - /// If the
///missed one or more fire-times, then the - /// 's misfire instruction will be applied. + /// If the missed one or more fire-times, then the + /// 's misfire instruction will be applied. /// - /// Resume (un-pause) all of the public virtual void ResumeTriggerGroup(string groupName) @@ -1094,11 +1091,11 @@ public virtual Collection.ISets in the + /// Resume (un-pause) all of the s in the /// given group. /// - /// If any
///missed one or more fire-times, then the - /// 's misfire instruction will be applied. + /// If any missed one or more fire-times, then the + /// 's misfire instruction will be applied. /// GetPausedTriggerGroups() } /// - /// Resume (un-pause) the @@ -1112,11 +1109,11 @@ public virtual void ResumeJob(JobKey jobKey) } ///with + /// Resume (un-pause) the with /// the given name. /// - /// If any of the
///'s s missed one - /// or more fire-times, then the 's misfire + /// If any of the 's s missed one + /// or more fire-times, then the 's misfire /// instruction will be applied. /// - /// Resume (un-pause) all of the @@ -1157,8 +1154,8 @@ public virtual void PauseAll() /// Resume (un-pause) all triggers - equivalent of callings + /// Resume (un-pause) all of the s /// in the given group. /// - /// If any of the
///s had s that - /// missed one or more fire-times, then the 's + /// If any of the s had s that + /// missed one or more fire-times, then the 's /// misfire instruction will be applied. /// /// on every group. /// - /// If any
///missed one or more fire-times, then the - /// 's misfire instruction will be applied. + /// If any missed one or more fire-times, then the + /// 's misfire instruction will be applied. /// @@ -1198,8 +1195,8 @@ public virtual IList GetJobKeys(string groupName) } /// - /// Get all public virtual ILists that are associated with the - /// identified . + /// Get all s that are associated with the + /// identified . /// GetTriggersOfJob(JobKey jobKey) { @@ -1209,7 +1206,7 @@ public virtual IList GetTriggersOfJob(JobKey jobKey) } /// - /// Get the names of all known public virtual IList+ /// Get the names of all known /// groups. /// GetTriggerGroupNames() @@ -1219,7 +1216,7 @@ public virtual IList GetTriggerGroupNames() } /// - /// Get the names of all the public virtual ILists in + /// Get the names of all the s in /// the given group. /// GetTriggerKeys(string groupName) @@ -1235,7 +1232,7 @@ public virtual IList GetTriggerKeys(string groupName) } /// - /// Get the public virtual IJobDetail GetJobDetail(JobKey jobKey) @@ -1246,7 +1243,7 @@ public virtual IJobDetail GetJobDetail(JobKey jobKey) } ///for the + /// Get the for the /// instance with the given name and group. /// - /// Get the public virtual ITrigger GetTrigger(TriggerKey triggerKey) @@ -1256,15 +1253,14 @@ public virtual ITrigger GetTrigger(TriggerKey triggerKey) return resources.JobStore.RetrieveTrigger(triggerKey); } - /** - * Determine whether a {@link Job} with the given identifier already - * exists within the scheduler. - * - * @param jobKey the identifier to check for - * @return true if a Job exists with the given identifier - * @throws SchedulerException - */ - + ///instance with the given name and + /// Get the instance with the given name and /// group. /// + /// Determine whether a {@link Job} with the given identifier already + /// exists within the scheduler. + /// + ///+ /// + /// the identifier to check for + ///true if a Job exists with the given identifier public bool CheckExists(JobKey jobKey) { ValidateState(); @@ -1272,15 +1268,14 @@ public bool CheckExists(JobKey jobKey) return resources.JobStore.CheckExists(jobKey); } - /** - * Determine whether a {@link Trigger} with the given identifier already - * exists within the scheduler. - * - * @param triggerKey the identifier to check for - * @return true if a Trigger exists with the given identifier - * @throws SchedulerException - */ - + ///+ /// Determine whether a {@link Trigger} with the given identifier already + /// exists within the scheduler. + /// + ///+ /// + /// the identifier to check for + ///true if a Trigger exists with the given identifier public bool CheckExists(TriggerKey triggerKey) { ValidateState(); @@ -1288,13 +1283,10 @@ public bool CheckExists(TriggerKey triggerKey) return resources.JobStore.CheckExists(triggerKey); } - /** - * Clears (deletes!) all scheduling data - all {@link Job}s, {@link Trigger}s - * {@link Calendar}s. - * - * @throws SchedulerException - */ - + ///+ /// Clears (deletes!) all scheduling data - all {@link Job}s, {@link Trigger}s + /// {@link Calendar}s. + /// public void Clear() { ValidateState(); @@ -1304,7 +1296,7 @@ public void Clear() } ///- /// Get the current state of the identified ///. + /// Get the current state of the identified . /// public virtual TriggerState GetTriggerState(TriggerKey triggerKey) @@ -1966,7 +1958,6 @@ public virtual void NotifySchedulerListenersPausedJob(JobKey jobKey) /// /// Notifies the scheduler listeners about paused job. /// - /// The name. /// The group. public virtual void NotifySchedulerListenersPausedJobs(string group) { @@ -2012,7 +2003,6 @@ public virtual void NotifySchedulerListenersResumedJob(JobKey jobKey) ////// Notifies the scheduler listeners about resumed job. /// - /// The name. /// The group. public virtual void NotifySchedulerListenersResumedJobs(string group) { diff --git a/src/Quartz/Core/QuartzSchedulerThread.cs b/src/Quartz/Core/QuartzSchedulerThread.cs index 4a2be1df3..39cfc0920 100644 --- a/src/Quartz/Core/QuartzSchedulerThread.cs +++ b/src/Quartz/Core/QuartzSchedulerThread.cs @@ -30,12 +30,12 @@ namespace Quartz.Core { ///- /// The thread responsible for performing the work of firing ///+ /// The thread responsible for performing the work of firing /// s that are registered with the . /// /// - /// + /// /// James House ///Marko Lahma (.NET) public class QuartzSchedulerThread : QuartzThread diff --git a/src/Quartz/CronExpression.cs b/src/Quartz/CronExpression.cs index 80e9da362..7d43c8b3b 100644 --- a/src/Quartz/CronExpression.cs +++ b/src/Quartz/CronExpression.cs @@ -466,7 +466,7 @@ public virtual bool IsSatisfiedBy(DateTimeOffset dateUtc) ////// Sets or gets the time zone for which the public virtual TimeZoneInfo TimeZone { diff --git a/src/Quartz/CronScheduleBuilder.cs b/src/Quartz/CronScheduleBuilder.cs index 7dd126f7a..dbbddf4a3 100644 --- a/src/Quartz/CronScheduleBuilder.cs +++ b/src/Quartz/CronScheduleBuilder.cs @@ -26,42 +26,39 @@ namespace Quartz { -/** - *of this - /// will be resolved. + /// will be resolved. /// CronScheduleBuilder
is a {@link ScheduleBuilder} that defines - * {@link CronExpression}-based schedules forTrigger
s. - * - *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 variousScheduleBuilder
implementations.Client code can then use the DSL to write code such as this:
- *- * JobDetail job = newJob(MyJob.class) - * .withIdentity("myJob") - * .build(); - * - * Trigger trigger = newTrigger() - * .withIdentity(triggerKey("myTrigger", "myTriggerGroup")) - * .withSchedule(simpleSchedule() - * .withIntervalInHours(1) - * .repeatForever()) - * .startAt(futureDate(10, MINUTES)) - * .build(); - * - * scheduler.scheduleJob(job, trigger); - *- * - * @see CronExpression - * @see CronTrigger - * @see ScheduleBuilder - * @see SimpleScheduleBuilder - * @see CalendarIntervalScheduleBuilder - * @see TriggerBuilder - */ + ///+ /// + ///CronScheduleBuilder
is a {@link ScheduleBuilder} that defines + /// {@link CronExpression}-based schedules forTrigger
s. + ///+ /// + ///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 variousScheduleBuilder
implementations.Client code can then use the DSL to write code such as this:
+ ///+ /// JobDetail job = newJob(MyJob.class) + /// .withIdentity("myJob") + /// .build(); + /// Trigger trigger = newTrigger() + /// .withIdentity(triggerKey("myTrigger", "myTriggerGroup")) + /// .withSchedule(simpleSchedule() + /// .withIntervalInHours(1) + /// .repeatForever()) + /// .startAt(futureDate(10, MINUTES)) + /// .build(); + /// scheduler.scheduleJob(job, trigger); + ///+ ///+ /// + /// + /// + /// + /// public class CronScheduleBuilder : ScheduleBuilder { private readonly string cronExpression; @@ -73,14 +70,14 @@ private CronScheduleBuilder(string cronExpression) this.cronExpression = cronExpression; } - /** - * Build the actual Trigger -- NOT intended to be invoked by end users, - * but will rather be invoked by a TriggerBuilder which this - * ScheduleBuilder is given to. - * - * @see TriggerBuilder#withSchedule(ScheduleBuilder) - */ - + /// + /// Build the actual Trigger -- NOT intended to be invoked by end users, + /// but will rather be invoked by a TriggerBuilder which this + /// ScheduleBuilder is given to. + /// + ///+ /// + ///public override IMutableTrigger Build() { CronTriggerImpl ct = new CronTriggerImpl(); @@ -101,105 +98,101 @@ public override IMutableTrigger Build() return ct; } - /** - * Create a CronScheduleBuilder with the given cron-expression. - * - * @param cronExpression the cron expression to base the schedule on. - * @return the new CronScheduleBuilder - * @throws ParseException - * @see CronExpression - */ - + /// + /// Create a CronScheduleBuilder with the given cron-expression. + /// + ///+ /// + /// the cron expression to base the schedule on. + ///the new CronScheduleBuilder + ///public static CronScheduleBuilder CronSchedule(string cronExpression) { CronExpression.ValidateExpression(cronExpression); return new CronScheduleBuilder(cronExpression); } - /** - * Create a CronScheduleBuilder with a cron-expression that sets the - * schedule to fire every day at the given time (hour and minute). - * - * @param hour the hour of day to fire - * @param minute the minute of the given hour to fire - * @return the new CronScheduleBuilder - * @throws ParseException - * @see CronExpression - */ - + /// + /// Create a CronScheduleBuilder with a cron-expression that sets the + /// schedule to fire every day at the given time (hour and minute). + /// + ///+ /// + /// the hour of day to fire + /// the minute of the given hour to fire + ///the new CronScheduleBuilder + ///public static CronScheduleBuilder DailyAtHourAndMinute(int hour, int minute) { - DateBuilder.validateHour(hour); - DateBuilder.validateMinute(minute); + DateBuilder.ValidateHour(hour); + DateBuilder.ValidateMinute(minute); string cronExpression = String.Format("0 {0} {1} ? * *", minute, hour); return new CronScheduleBuilder(cronExpression); } - /** - * Create a CronScheduleBuilder with a cron-expression that sets the - * schedule to fire one per week on the given day at the given time - * (hour and minute). - * - * @param dayOfWeek the day of the week to fire - * @param hour the hour of day to fire - * @param minute the minute of the given hour to fire - * @return the new CronScheduleBuilder - * @throws ParseException - * @see CronExpression - * @see DateBuilder#MONDAY - * @see DateBuilder#TUESDAY - * @see DateBuilder#WEDNESDAY - * @see DateBuilder#THURSDAY - * @see DateBuilder#FRIDAY - * @see DateBuilder#SATURDAY - * @see DateBuilder#SUNDAY - */ - + /// + /// Create a CronScheduleBuilder with a cron-expression that sets the + /// schedule to fire one per week on the given day at the given time + /// (hour and minute). + /// + ///+ /// + /// the day of the week to fire + /// the hour of day to fire + /// the minute of the given hour to fire + ///the new CronScheduleBuilder + ///+ /// + /// + /// + /// + /// + /// + /// public static CronScheduleBuilder WeeklyOnDayAndHourAndMinute(int dayOfWeek, int hour, int minute) { - DateBuilder.validateDayOfWeek(dayOfWeek); - DateBuilder.validateHour(hour); - DateBuilder.validateMinute(minute); + DateBuilder.ValidateDayOfWeek(dayOfWeek); + DateBuilder.ValidateHour(hour); + DateBuilder.ValidateMinute(minute); string cronExpression = String.Format("0 {0} {1} ? * {2}", minute, hour, dayOfWeek); return new CronScheduleBuilder(cronExpression); } - /** - * Create a CronScheduleBuilder with a cron-expression that sets the - * schedule to fire one per month on the given day of month at the given - * time (hour and minute). - * - * @param dayOfMonth the day of the month to fire - * @param hour the hour of day to fire - * @param minute the minute of the given hour to fire - * @return the new CronScheduleBuilder - * @throws ParseException - * @see CronExpression - */ - + /// + /// Create a CronScheduleBuilder with a cron-expression that sets the + /// schedule to fire one per month on the given day of month at the given + /// time (hour and minute). + /// + ///+ /// + /// the day of the month to fire + /// the hour of day to fire + /// the minute of the given hour to fire + ///the new CronScheduleBuilder + ///public static CronScheduleBuilder MonthlyOnDayAndHourAndMinute(int dayOfMonth, int hour, int minute) { - DateBuilder.validateDayOfMonth(dayOfMonth); - DateBuilder.validateHour(hour); - DateBuilder.validateMinute(minute); + DateBuilder.ValidateDayOfMonth(dayOfMonth); + DateBuilder.ValidateHour(hour); + DateBuilder.ValidateMinute(minute); string cronExpression = String.Format("0 {0} {1} {2} * ?", minute, hour, dayOfMonth); return new CronScheduleBuilder(cronExpression); } - /** - * The TimeZone
in which to base the schedule. - * - * @param tz the time-zone for the schedule. - * @return the updated CronScheduleBuilder - * @see CronExpression#getTimeZone() - */ - + ///+ /// The + ///TimeZone
in which to base the schedule. + ///+ /// + /// the time-zone for the schedule. + ///the updated CronScheduleBuilder + ///public CronScheduleBuilder InTimeZone(TimeZoneInfo tz) { this.tz = tz; @@ -207,42 +200,42 @@ public CronScheduleBuilder InTimeZone(TimeZoneInfo tz) } - /** - * If the Trigger misfires, use the - * {@link Trigger#MISFIRE_INSTRUCTION_IGNORE_MISFIRE_POLICY} instruction. - * - * @return the updated CronScheduleBuilder - * @see Trigger#MISFIRE_INSTRUCTION_IGNORE_MISFIRE_POLICY - */ - + /// + /// If the Trigger misfires, use the + /// {@link Trigger#MISFIRE_INSTRUCTION_IGNORE_MISFIRE_POLICY} instruction. + /// + ///+ /// + ///the updated CronScheduleBuilder + ///public CronScheduleBuilder WithMisfireHandlingInstructionIgnoreMisfires() { misfireInstruction = MisfireInstruction.IgnoreMisfirePolicy; return this; } - /** - * If the Trigger misfires, use the - * {@link CronTrigger#MISFIRE_INSTRUCTION_DO_NOTHING} instruction. - * - * @return the updated CronScheduleBuilder - * @see CronTrigger#MISFIRE_INSTRUCTION_DO_NOTHING - */ - + /// + /// If the Trigger misfires, use the + /// {@link CronTrigger#MISFIRE_INSTRUCTION_DO_NOTHING} instruction. + /// + ///+ /// + ///the updated CronScheduleBuilder + ///public CronScheduleBuilder WithMisfireHandlingInstructionDoNothing() { misfireInstruction = MisfireInstruction.CronTrigger.DoNothing; return this; } - /** - * If the Trigger misfires, use the - * {@link CronTrigger#MISFIRE_INSTRUCTION_FIRE_ONCE_NOW} instruction. - * - * @return the updated CronScheduleBuilder - * @see CronTrigger#MISFIRE_INSTRUCTION_FIRE_ONCE_NOW - */ - + /// + /// If the Trigger misfires, use the + /// {@link CronTrigger#MISFIRE_INSTRUCTION_FIRE_ONCE_NOW} instruction. + /// + ///+ /// + ///the updated CronScheduleBuilder + ///public CronScheduleBuilder WithMisfireHandlingInstructionFireAndProceed() { misfireInstruction = MisfireInstruction.CronTrigger.FireOnceNow; diff --git a/src/Quartz/DateBuilder.cs b/src/Quartz/DateBuilder.cs index ebcbd180c..45a35da73 100644 --- a/src/Quartz/DateBuilder.cs +++ b/src/Quartz/DateBuilder.cs @@ -23,249 +23,213 @@ namespace Quartz { -/** - * DateBuilder
is used to conveniently create - *java.util.Date
instances that meet particular criteria. - * - *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 variousScheduleBuilder
implementations.Client code can then use the DSL to write code such as this:
- *- * JobDetail job = newJob(MyJob.class) - * .withIdentity("myJob") - * .build(); - * - * Trigger trigger = newTrigger() - * .withIdentity(triggerKey("myTrigger", "myTriggerGroup")) - * .withSchedule(simpleSchedule() - * .withIntervalInHours(1) - * .repeatForever()) - * .startAt(futureDate(10, MINUTES)) - * .build(); - * - * scheduler.scheduleJob(job, trigger); - *- * - * @see TriggerBuilder - * @see JobBuilder - */ - + ///+ /// + ///DateBuilder
is used to conveniently create + ///java.util.Date
instances that meet particular criteria. + ///+ /// + ///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 variousScheduleBuilder
implementations.Client code can then use the DSL to write code such as this:
+ ///+ /// JobDetail job = newJob(MyJob.class) + /// .withIdentity("myJob") + /// .build(); + /// Trigger trigger = newTrigger() + /// .withIdentity(triggerKey("myTrigger", "myTriggerGroup")) + /// .withSchedule(simpleSchedule() + /// .withIntervalInHours(1) + /// .repeatForever()) + /// .startAt(futureDate(10, MINUTES)) + /// .build(); + /// scheduler.scheduleJob(job, trigger); + ///+ ///+ /// public class DateBuilder { public enum IntervalUnit { - MILLISECOND, - SECOND, - MINUTE, - HOUR, - DAY, - WEEK, - MONTH, - YEAR + Millisecond, + Second, + Minute, + Hour, + Day, + Week, + Month, + Year } ; - public const int SUNDAY = 1; + public const int Sunday = 1; - public const int MONDAY = 2; + public const int Monday = 2; - public const int TUESDAY = 3; + public const int Tuesday = 3; - public const int WEDNESDAY = 4; + public const int Wednesday = 4; - public const int THURSDAY = 5; + public const int Thursday = 5; - public const int FRIDAY = 6; + public const int Friday = 6; - public const int SATURDAY = 7; + public const int Saturday = 7; - public const long MILLISECONDS_IN_MINUTE = 60l*1000l; + public const long MillisecondsInMinute = 60l*1000l; - public const long MILLISECONDS_IN_HOUR = 60l*60l*1000l; + public const long MillisecondsInHour = 60l*60l*1000l; - public const long SECONDS_IN_MOST_DAYS = 24l*60l*60L; + public const long SecondsInMostDays = 24l*60l*60L; - public const long MILLISECONDS_IN_DAY = SECONDS_IN_MOST_DAYS*1000l; + public const long MillisecondsInDay = SecondsInMostDays*1000l; private DateBuilder() { } - public static DateTimeOffset futureDate(int interval, IntervalUnit unit) + public static DateTimeOffset FutureDate(int interval, IntervalUnit unit) { - DateTimeOffset c = Calendar.getInstance(); - c.setTime(new DateTimeOffset()); - c.setLenient(true); - - c.add(translate(unit), interval); - - return c.getTime(); + return TranslatedAdd(DateTimeOffset.UtcNow, unit, interval); } - private static int translate(IntervalUnit unit) + private static DateTimeOffset TranslatedAdd(DateTimeOffset date, IntervalUnit unit, int amountToAdd) { switch (unit) { - case DAY: - return Calendar.DAY_OF_YEAR; - case HOUR: - return Calendar.HOUR_OF_DAY; - case MINUTE: - return Calendar.MINUTE; - case MONTH: - return Calendar.MONTH; - case SECOND: - return Calendar.SECOND; - case MILLISECOND: - return Calendar.MILLISECOND; - case WEEK: - return Calendar.WEEK_OF_YEAR; - case YEAR: - return Calendar.YEAR; + case IntervalUnit.Day: + return date.AddDays(amountToAdd); + case IntervalUnit.Hour: + return date.AddHours(amountToAdd); + case IntervalUnit.Minute: + return date.AddMinutes(amountToAdd); + case IntervalUnit.Month: + return date.AddMonths(amountToAdd); + case IntervalUnit.Second: + return date.AddSeconds(amountToAdd); + case IntervalUnit.Millisecond: + return date.AddMilliseconds(amountToAdd); + case IntervalUnit.Week: + return date.AddDays(amountToAdd * 7); + case IntervalUnit.Year: + return date.AddYears(amountToAdd); default: throw new ArgumentException("Unknown IntervalUnit"); } } - /** - * - * Get a
- * - * @param second - * The value (0-59) to give the seconds field of the date - * @param minute - * The value (0-59) to give the minutes field of the date - * @param hour - * The value (0-23) to give the hours field of the date - * @return the new date - */ - - public static DateTimeOffset dateOf(int hour, int minute, int second) + ///Date
object that represents the given time, on - * today's date. - *+ /// + ///+ /// Get a
+ ///Date
object that represents the given time, on + /// today's date. + ///+ /// + /// + /// The value (0-59) to give the seconds field of the date + /// + /// The value (0-59) to give the minutes field of the date + /// + /// The value (0-23) to give the hours field of the date + ///the new date + public static DateTimeOffset DateOf(int hour, int minute, int second) { - validateSecond(second); - validateMinute(minute); - validateHour(hour); - - DateTimeOffset c = Calendar.getInstance(); + ValidateSecond(second); + ValidateMinute(minute); + ValidateHour(hour); - c.set(Calendar.HOUR_OF_DAY, hour); - c.set(Calendar.MINUTE, minute); - c.set(Calendar.SECOND, second); - c.set(Calendar.MILLISECOND, 0); + DateTimeOffset c = SystemTime.UtcNow(); - return c; + return new DateTimeOffset(c.Year, c.Month, c.Day, hour, minute, second, TimeSpan.Zero); } - /** - *- * Get a
- * - * @param second - * The value (0-59) to give the seconds field of the date - * @param minute - * The value (0-59) to give the minutes field of the date - * @param hour - * The value (0-23) to give the hours field of the date - * @param dayOfMonth - * The value (1-31) to give the day of month field of the date - * @param month - * The value (1-12) to give the month field of the date - * @return the new date - */ - - public static DateTimeOffset dateOf(int hour, int minute, int second, + ///Date
object that represents the given time, on the - * given date. - *+ /// Get a + /// + /// The value (0-59) to give the seconds field of the date + /// + /// The value (0-59) to give the minutes field of the date + /// + /// The value (0-23) to give the hours field of the date + /// + /// The value (1-31) to give the day of month field of the date + /// + /// The value (1-12) to give the month field of the date + ///Date
object that represents the given time, on the + /// given date. + ///the new date + public static DateTimeOffset DateOf(int hour, int minute, int second, int dayOfMonth, int month) { - validateSecond(second); - validateMinute(minute); - validateHour(hour); - validateDayOfMonth(dayOfMonth); - validateMonth(month); - - DateTimeOffset c = Calendar.getInstance(); - - c.set(Calendar.MONTH, month - 1); - c.set(Calendar.DAY_OF_MONTH, dayOfMonth); - c.set(Calendar.HOUR_OF_DAY, hour); - c.set(Calendar.MINUTE, minute); - c.set(Calendar.SECOND, second); - c.set(Calendar.MILLISECOND, 0); - - return c.getTime(); + ValidateSecond(second); + ValidateMinute(minute); + ValidateHour(hour); + ValidateDayOfMonth(dayOfMonth); + ValidateMonth(month); + + DateTimeOffset c = SystemTime.UtcNow(); + + return new DateTimeOffset(c.Year, month, dayOfMonth, hour, minute, second, TimeSpan.Zero); } - /** - *- * Get a
- * - * @param second - * The value (0-59) to give the seconds field of the date - * @param minute - * The value (0-59) to give the minutes field of the date - * @param hour - * The value (0-23) to give the hours field of the date - * @param dayOfMonth - * The value (1-31) to give the day of month field of the date - * @param month - * The value (1-12) to give the month field of the date - * @param year - * The value (1970-2099) to give the year field of the date - * @return the new date - */ - - public static DateTimeOffset dateOf(int hour, int minute, int second, + ///Date
object that represents the given time, on the - * given date. - *+ /// + ///+ /// Get a
+ ///Date
object that represents the given time, on the + /// given date. + ///+ /// + /// + /// The value (0-59) to give the seconds field of the date + /// + /// The value (0-59) to give the minutes field of the date + /// + /// The value (0-23) to give the hours field of the date + /// + /// The value (1-31) to give the day of month field of the date + /// + /// The value (1-12) to give the month field of the date + /// + /// The value (1970-2099) to give the year field of the date + ///the new date + public static DateTimeOffset DateOf(int hour, int minute, int second, int dayOfMonth, int month, int year) { - validateSecond(second); - validateMinute(minute); - validateHour(hour); - validateDayOfMonth(dayOfMonth); - validateMonth(month); - validateYear(year); - - DateTimeOffset c = Calendar.getInstance(); - - c.set(Calendar.YEAR, year); - c.set(Calendar.MONTH, month - 1); - c.set(Calendar.DAY_OF_MONTH, dayOfMonth); - c.set(Calendar.HOUR_OF_DAY, hour); - c.set(Calendar.MINUTE, minute); - c.set(Calendar.SECOND, second); - c.set(Calendar.MILLISECOND, 0); - - return c.getTime(); - } + ValidateSecond(second); + ValidateMinute(minute); + ValidateHour(hour); + ValidateDayOfMonth(dayOfMonth); + ValidateMonth(month); + ValidateYear(year); + DateTimeOffset c = SystemTime.UtcNow(); + + return new DateTimeOffset(year, month, dayOfMonth, hour, minute, second, TimeSpan.Zero); + } - /** - *- * Returns a date that is rounded to the next even hour after the current time. - *
- * - *- * For example a current time of 08:13:54 would result in a date - * with the time of 09:00:00. If the date's time is in the 23rd hour, the - * date's 'day' will be promoted, and the time will be set to 00:00:00. - *
- * - * @return the new rounded date - */ - - public static DateTimeOffset evenHourDateAfterNow() + ///+ /// + ///+ /// Returns a date that is rounded to the next even hour after the current time. + ///
+ ///+ /// + ///+ /// For example a current time of 08:13:54 would result in a date + /// with the time of 09:00:00. If the date's time is in the 23rd hour, the + /// date's 'day' will be promoted, and the time will be set to 00:00:00. + ///
+ ///the new rounded date + public static DateTimeOffset EvenHourDateAfterNow() { - return evenHourDate(null); + return EvenHourDate(null); } ///@@ -310,23 +274,22 @@ public static DateTimeOffset EvenHourDateBefore(DateTimeOffset? dateUtc) return new DateTimeOffset(dateUtc.Value.Year, dateUtc.Value.Month, dateUtc.Value.Day, dateUtc.Value.Hour, 0, 0, dateUtc.Value.Offset); } - /** - * - * Returns a date that is rounded to the next even minute after the current time. - *
- * - *- * For example a current time of 08:13:54 would result in a date - * with the time of 08:14:00. If the date's time is in the 59th minute, - * then the hour (and possibly the day) will be promoted. - *
- * - * @return the new rounded date - */ - - public static DateTimeOffset evenMinuteDateAfterNow() + ///+ /// + ///+ /// Returns a date that is rounded to the next even minute after the current time. + ///
+ ///+ /// + ///+ /// For example a current time of 08:13:54 would result in a date + /// with the time of 08:14:00. If the date's time is in the 59th minute, + /// then the hour (and possibly the day) will be promoted. + ///
+ ///the new rounded date + public static DateTimeOffset EvenMinuteDateAfterNow() { - return evenMinuteDate(DateTimeOffset.UtcNow); + return EvenMinuteDate(DateTimeOffset.UtcNow); } ///@@ -374,182 +337,165 @@ public static DateTimeOffset EvenMinuteDateBefore(DateTimeOffset? dateUtc) return new DateTimeOffset(d.Year, d.Month, d.Day, d.Hour, d.Minute, 0, d.Offset); } - /** - * - * Returns a date that is rounded to the next even second after the current time. - *
- * - * @return the new rounded date - */ - - public static DateTimeOffset evenSecondDateAfterNow() + ///+ /// + ///+ /// Returns a date that is rounded to the next even second after the current time. + ///
+ ///+ /// + ///the new rounded date + public static DateTimeOffset EvenSecondDateAfterNow() { - return evenSecondDate(DateTimeOffset.UtcNow); + return EvenSecondDate(DateTimeOffset.UtcNow); } - /** - *- * Returns a date that is rounded to the next even second above the given - * date. - *
- * - * @param date - * the Date to round, ifnull
the current time will - * be used - * @return the new rounded date - */ - - public static DateTimeOffset evenSecondDate(DateTimeOffset date) + ///+ /// + ///+ /// Returns a date that is rounded to the next even second above the given + /// date. + ///
+ ///+ /// + /// + /// the Date to round, ifnull
the current time will + /// be used + ///the new rounded date + public static DateTimeOffset EvenSecondDate(DateTimeOffset date) { - DateTimeOffset c = Calendar.getInstance(); - - c.set(Calendar.SECOND, c.get(Calendar.SECOND) + 1); - c.set(Calendar.MILLISECOND, 0); - - return c.getTime(); + date = date.AddSeconds(1); + return new DateTimeOffset(date.Year, date.Month, date.Day, date.Hour, date.Minute, date.Second, 0, date.Offset); } - /** - *- * Returns a date that is rounded to the previous even second below the - * given date. - *
- * - *- * For example an input date with a time of 08:13:54.341 would result in a - * date with the time of 08:13:00.000. - *
- * - * @param date - * the Date to round, ifnull
the current time will - * be used - * @return the new rounded date - */ - - public static DateTimeOffset evenSecondDateBefore(DateTimeOffset date) + ///+ /// + ///+ /// Returns a date that is rounded to the previous even second below the + /// given date. + ///
+ ///+ /// + /// + /// the Date to round, if+ /// For example an input date with a time of 08:13:54.341 would result in a + /// date with the time of 08:13:00.000. + ///
+ ///null
the current time will + /// be used + ///the new rounded date + public static DateTimeOffset EvenSecondDateBefore(DateTimeOffset date) { - DateTimeOffset c = Calendar.getInstance(); - - c.set(Calendar.MILLISECOND, 0); - - return c.getTime(); + return new DateTimeOffset(date.Year, date.Month, date.Day, date.Hour, date.Minute, date.Second, 0, date.Offset); } - /** - *- * Returns a date that is rounded to the next even multiple of the given - * minute. - *
- * - *- * For example an input date with a time of 08:13:54, and an input - * minute-base of 5 would result in a date with the time of 08:15:00. The - * same input date with an input minute-base of 10 would result in a date - * with the time of 08:20:00. But a date with the time 08:53:31 and an - * input minute-base of 45 would result in 09:00:00, because the even-hour - * is the next 'base' for 45-minute intervals. - *
- * - *- * More examples:
- *
- *- * - *Input Time - *Minute-Base - *Result Time - *- * - *11:16:41 - *20 - *11:20:00 - *- * - *11:36:41 - *20 - *11:40:00 - *- * - *11:46:41 - *20 - *12:00:00 - *- * - *11:26:41 - *30 - *11:30:00 - *- * - *11:36:41 - *30 - *12:00:00 - *11:16:41 - *17 - *11:17:00 - * - * - *11:17:41 - *17 - *11:34:00 - * - * - *11:52:41 - *17 - *12:00:00 - * - * - *11:52:41 - *5 - *11:55:00 - * - * - *11:57:41 - *5 - *12:00:00 - * - * - *11:17:41 - *0 - *12:00:00 - * - * - *11:17:41 - *1 - *11:08:00 - * - *null
the current time will - * be used - * @param minuteBase - * the base-minute to set the time on - * @return the new rounded date - * - * @see #nextGivenSecondDate(Date, int) - */ - - public static DateTimeOffset nextGivenMinuteDate(DateTimeOffset date, int minuteBase) + ///+ /// + ///+ /// Returns a date that is rounded to the next even multiple of the given + /// minute. + ///
+ ///+ /// + /// For example an input date with a time of 08:13:54, and an input + /// minute-base of 5 would result in a date with the time of 08:15:00. The + /// same input date with an input minute-base of 10 would result in a date + /// with the time of 08:20:00. But a date with the time 08:53:31 and an + /// input minute-base of 45 would result in 09:00:00, because the even-hour + /// is the next 'base' for 45-minute intervals. + ///
+ ///+ /// More examples:
+ ///
+ ///+ /// + ///Input Time + ///Minute-Base + ///Result Time + ///+ /// + ///11:16:41 + ///20 + ///11:20:00 + ///+ /// + ///11:36:41 + ///20 + ///11:40:00 + ///+ /// + ///11:46:41 + ///20 + ///12:00:00 + ///+ /// + ///11:26:41 + ///30 + ///11:30:00 + ///+ /// + ///11:36:41 + ///30 + ///12:00:00 + ///+ /// + ///11:16:41 + ///17 + ///11:17:00 + ///+ /// + ///11:17:41 + ///17 + ///11:34:00 + ///+ /// + ///11:52:41 + ///17 + ///12:00:00 + ///+ /// + ///11:52:41 + ///5 + ///11:55:00 + ///+ /// + ///11:57:41 + ///5 + ///12:00:00 + ///+ /// + ///11:17:41 + ///0 + ///12:00:00 + ///+ /// + ///11:17:41 + ///1 + ///11:08:00 + ///null
the current time will + /// be used + /// + /// the base-minute to set the time on + ///the new rounded date + ///+ public static DateTimeOffset NextGivenMinuteDate(DateTimeOffset date, int minuteBase) { if (minuteBase < 0 || minuteBase > 59) { throw new ArgumentException("minuteBase must be >=0 and <= 59"); } - - DateTimeOffset c = Calendar.getInstance(); + DateTimeOffset c = date; if (minuteBase == 0) { - c.set(Calendar.HOUR_OF_DAY, c.get(Calendar.HOUR_OF_DAY) + 1); - c.set(Calendar.MINUTE, 0); - c.set(Calendar.SECOND, 0); - c.set(Calendar.MILLISECOND, 0); - - return c.getTime(); + return new DateTimeOffset(c.Year, c.Month, c.Day, c.Hour + 1, 0, 0, 0, TimeSpan.Zero); } - int minute = c.get(Calendar.MINUTE); + int minute = c.Minute; int arItr = minute/minuteBase; @@ -557,63 +503,44 @@ public static DateTimeOffset nextGivenMinuteDate(DateTimeOffset date, int minute if (nextMinuteOccurance < 60) { - c.set(Calendar.MINUTE, nextMinuteOccurance); - c.set(Calendar.SECOND, 0); - c.set(Calendar.MILLISECOND, 0); - - return c.getTime(); + return new DateTimeOffset(c.Year, c.Month, c.Day, c.Hour, nextMinuteOccurance, 0, 0, TimeSpan.Zero); } else { - c.set(Calendar.HOUR_OF_DAY, c.get(Calendar.HOUR_OF_DAY) + 1); - c.set(Calendar.MINUTE, 0); - c.set(Calendar.SECOND, 0); - c.set(Calendar.MILLISECOND, 0); - - return c.getTime(); + return new DateTimeOffset(c.Year, c.Month, c.Day, c.Hour + 1, 0, 0, 0, TimeSpan.Zero); } } - - /** - * - * Returns a date that is rounded to the next even multiple of the given - * minute. - *
- * - *- * The rules for calculating the second are the same as those for - * calculating the minute in the method - *
- * - * @param date the Date to round, ifgetNextGivenMinuteDate(..)
. - *
null
the current time will - * be used - * @param secondBase the base-second to set the time on - * @return the new rounded date - * - * @see #nextGivenMinuteDate(Date, int) - */ - - public static DateTimeOffset nextGivenSecondDate(DateTimeOffset date, int secondBase) + ///+ /// + ///+ /// Returns a date that is rounded to the next even multiple of the given + /// minute. + ///
+ ///+ /// The rules for calculating the second are the same as those for + /// calculating the minute in the method + /// + /// the Date to round, ifgetNextGivenMinuteDate(..)
. + ///null
the current time will + /// be used + /// the base-second to set the time on + ///the new rounded date + ///+ public static DateTimeOffset NextGivenSecondDate(DateTimeOffset date, int secondBase) { if (secondBase < 0 || secondBase > 59) { throw new ArgumentException("secondBase must be >=0 and <= 59"); } - - DateTimeOffset c = Calendar.getInstance(); + DateTimeOffset c = date; if (secondBase == 0) { - c.set(Calendar.MINUTE, c.get(Calendar.MINUTE) + 1); - c.set(Calendar.SECOND, 0); - c.set(Calendar.MILLISECOND, 0); - - return c.getTime(); + return new DateTimeOffset(c.Year, c.Month, c.Day, c.Hour, c.Minute + 1, 0, 0, TimeSpan.Zero); } - int second = c.get(Calendar.SECOND); + int second = c.Second; int arItr = second/secondBase; @@ -621,18 +548,11 @@ public static DateTimeOffset nextGivenSecondDate(DateTimeOffset date, int second if (nextSecondOccurance < 60) { - c.set(Calendar.SECOND, nextSecondOccurance); - c.set(Calendar.MILLISECOND, 0); - - return c.getTime(); + return new DateTimeOffset(c.Year, c.Month, c.Day, c.Hour, c.Minute, nextSecondOccurance, 0, TimeSpan.Zero); } else { - c.set(Calendar.MINUTE, c.get(Calendar.MINUTE) + 1); - c.set(Calendar.SECOND, 0); - c.set(Calendar.MILLISECOND, 0); - - return c.getTime(); + return new DateTimeOffset(c.Year, c.Month, c.Day, c.Hour, c.Minute + 1, 0, 0, TimeSpan.Zero); } } @@ -645,7 +565,7 @@ public static DateTimeOffset nextGivenSecondDate(DateTimeOffset date, int second /// the original time-zone /// the destination time-zone /// the translated UTC date - public static DateTimeOffset translateTime(DateTimeOffset date, TimeZoneInfo src, TimeZoneInfo dest) + public static DateTimeOffset TranslateTime(DateTimeOffset date, TimeZoneInfo src, TimeZoneInfo dest) { DateTimeOffset newDate = SystemTime.UtcNow(); double offset = (GetOffset(date, dest) - GetOffset(date, src)); @@ -676,15 +596,15 @@ private static double GetOffset(DateTimeOffset date, TimeZoneInfo tz) //////////////////////////////////////////////////////////////////////////////////////////////////// - public static void validateDayOfWeek(int dayOfWeek) + public static void ValidateDayOfWeek(int dayOfWeek) { - if (dayOfWeek < SUNDAY || dayOfWeek > SATURDAY) + if (dayOfWeek < Sunday || dayOfWeek > Saturday) { throw new ArgumentException("Invalid day of week."); } } - public static void validateHour(int hour) + public static void ValidateHour(int hour) { if (hour < 0 || hour > 23) { @@ -692,7 +612,7 @@ public static void validateHour(int hour) } } - public static void validateMinute(int minute) + public static void ValidateMinute(int minute) { if (minute < 0 || minute > 59) { @@ -700,7 +620,7 @@ public static void validateMinute(int minute) } } - public static void validateSecond(int second) + public static void ValidateSecond(int second) { if (second < 0 || second > 59) { @@ -708,7 +628,7 @@ public static void validateSecond(int second) } } - public static void validateDayOfMonth(int day) + public static void ValidateDayOfMonth(int day) { if (day < 1 || day > 31) { @@ -716,7 +636,7 @@ public static void validateDayOfMonth(int day) } } - public static void validateMonth(int month) + public static void ValidateMonth(int month) { if (month < 1 || month > 12) { @@ -724,7 +644,7 @@ public static void validateMonth(int month) } } - public static void validateYear(int year) + public static void ValidateYear(int year) { if (year < 1970 || year > 2099) { diff --git a/src/Quartz/ICalendar.cs b/src/Quartz/ICalendar.cs index 6c82e5040..c3253c717 100644 --- a/src/Quartz/ICalendar.cs +++ b/src/Quartz/ICalendar.cs @@ -25,9 +25,9 @@ namespace Quartz { ////// An interface to be implemented by objects that define spaces of time during - /// which an associated @@ -35,7 +35,7 @@ namespace Quartz /// As such, it is often useful to think of Calendars as being used to exclude a block /// of time - as opposed to include a block of time. (i.e. the /// schedule "fire every five minutes except on Sundays" could be - /// implemented with amay (not) fire. Calendars + /// which an associated may (not) fire. Calendars /// do not define actual fire times, but rather are used to limit a - /// from firing on its normal schedule if necessary. Most + /// from firing on its normal schedule if necessary. Most /// Calendars include all times by default and allow the user to specify times /// to exclude. /// and a + /// implemented with a and a /// which excludes Sundays) /// /// Implementations MUST take care of being properly cloneable and Serializable. diff --git a/src/Quartz/ICronTrigger.cs b/src/Quartz/ICronTrigger.cs index 1981138cb..643a80b47 100644 --- a/src/Quartz/ICronTrigger.cs +++ b/src/Quartz/ICronTrigger.cs @@ -145,9 +145,8 @@ namespace Quartz /// /// - /// - /// + /// + /// /// Sharada Jambula ///James House ///Contributions from Mads Henderson @@ -161,11 +160,11 @@ public interface ICronTrigger : ITrigger string CronExpressionString { set; get; } ///- /// Sets the time zone for which the ///of this - /// will be resolved. + /// Sets the time zone for which the of this + /// will be resolved. /// - /// If is set after this + /// If is set after this /// property, the TimeZone setting on the CronExpression will "win". However /// if is set after this property, the /// time zone applied by this method will remain in effect, since the diff --git a/src/Quartz/IJob.cs b/src/Quartz/IJob.cs index ae7a6eb70..3691c61bc 100644 --- a/src/Quartz/IJob.cs +++ b/src/Quartz/IJob.cs @@ -32,14 +32,14 @@ namespace Quartz /// /// /// - /// + /// /// /// James House ///Marko Lahma (.NET) public interface IJob { ///- /// Called by the ///when a + /// Called by the when a /// fires that is associated with the . /// diff --git a/src/Quartz/IJobDetail.cs b/src/Quartz/IJobDetail.cs index ce55cb8f0..23063e9c1 100644 --- a/src/Quartz/IJobDetail.cs +++ b/src/Quartz/IJobDetail.cs @@ -31,21 +31,21 @@ namespace Quartz /// /// Quartz does not store an actual instance of a ///type, but - /// instead allows you to define an instance of one, through the use of a . + /// instead allows you to define an instance of one, through the use of a . /// ///
///s have a name and group associated with them, which /// should uniquely identify them within a single . /// - ///
///s are the 'mechanism' by which s - /// are scheduled. Many s can point to the same , - /// but a single can only point to one . + /// s are the 'mechanism' by which s + /// are scheduled. Many s can point to the same , + /// but a single can only point to one . /// /// /// - /// + /// /// James House ///Marko Lahma (.NET) public interface IJobDetail : ICloneable @@ -73,7 +73,7 @@ public interface IJobDetail : ICloneable ////// Whether or not the ///should remain stored after it is - /// orphaned (no s point to it). + /// orphaned (no s point to it). /// /// If not explicitly set, the default value is . @@ -84,13 +84,13 @@ public interface IJobDetail : ICloneable bool Durable { get; } /// - /// Whether the associated Job class carries the ///TODO annotation. + /// Whether the associated Job class carries the TODO annotation. /// bool PersistJobDataAfterExecution { get; } /// - /// Whether the associated Job class carries the ///TODO annotation. + /// Whether the associated Job class carries the TODO annotation. /// bool ConcurrentExectionDisallowed { get; } @@ -108,7 +108,7 @@ public interface IJobDetail : ICloneable /// /// Get a JobBuilder GetJobBuilder(); } diff --git a/src/Quartz/IJobExecutionContext.cs b/src/Quartz/IJobExecutionContext.cs index 8bc1bcd9f..92fc27364 100644 --- a/src/Quartz/IJobExecutionContext.cs +++ b/src/Quartz/IJobExecutionContext.cs @@ -11,13 +11,13 @@ public interface IJobExecutionContext IScheduler Scheduler { get; } ///that is configured to produce a - /// identical to this one. + /// identical to this one. /// - /// Get a handle to the ITrigger Trigger { get; } ///instance that fired the + /// Get a handle to the instance that fired the /// . /// - /// Get a handle to the ICalendar Calendar { get; } @@ -41,7 +41,7 @@ public interface IJobExecutionContext ///referenced by the + /// Get a handle to the referenced by the /// instance that fired the . /// /// The
found on this object serves as a convenience - /// it is a merge of the found on the - /// and the one found on the , with + /// and the one found on the , with /// the value in the latter overriding any same-named values in the former. /// It is thus considered a 'best practice' that the Execute code of a Job /// retrieve data from the JobDataMap found on this object. diff --git a/src/Quartz/IJobListener.cs b/src/Quartz/IJobListener.cs index 43f43a27b..f60b60435 100644 --- a/src/Quartz/IJobListener.cs +++ b/src/Quartz/IJobListener.cs @@ -17,6 +17,8 @@ */ #endregion +using Quartz.Spi; + namespace Quartz { /// @@ -41,7 +43,7 @@ public interface IJobListener /// ////// Called by the ///when a - /// is about to be executed (an associated + /// is about to be executed (an associated /// has occurred). /// /// This method will not be invoked if the execution of the Job was vetoed @@ -53,7 +55,7 @@ public interface IJobListener ///
/// Called by the @@ -63,8 +65,8 @@ public interface IJobListener ///when a - /// was about to be executed (an associated + /// was about to be executed (an associated /// has occurred), but a vetoed it's /// execution. /// /// Called by the void JobWasExecuted(IJobExecutionContext context, JobExecutionException jobException); } diff --git a/src/Quartz/IListenerManager.cs b/src/Quartz/IListenerManager.cs index 3f377cc99..ff9f77bd3 100644 --- a/src/Quartz/IListenerManager.cs +++ b/src/Quartz/IListenerManager.cs @@ -21,221 +21,220 @@ using System.Collections.Generic; +using Quartz.Impl.Matchers; + namespace Quartz { -/** - * Client programs may be interested in the 'listener' interfaces that are - * available from Quartz. Theafter a - /// has been executed, and be for the associated 's - /// method has been called. + /// has been executed, and be for the associated 's + /// method has been called. /// {@link JobListener}
interface - * provides notifications ofJob
executions. The - *{@link TriggerListener}
interface provides notifications of - *Trigger
firings. The{@link SchedulerListener}
- * interface provides notifications ofScheduler
events and - * errors. Listeners can be associated with local schedulers through the - * {@link ListenerManager} interface. - * - * @author jhouse - * @since 2.0 - previously listeners were managed directly on the Scheduler interface. - */ - + ///+ /// Client programs may be interested in the 'listener' interfaces that are + /// available from Quartz. The + ///{@link JobListener}
interface + /// provides notifications ofJob
executions. The + ///{@link TriggerListener}
interface provides notifications of + ///Trigger
firings. The{@link SchedulerListener}
+ /// interface provides notifications ofScheduler
events and + /// errors. Listeners can be associated with local schedulers through the + /// {@link ListenerManager} interface. + ///+ /// + ///jhouse + ///2.0 - previously listeners were managed directly on the Scheduler interface. public interface IListenerManager { - /** - * Add the given{@link JobListener}
to theScheduler
, - * and register it to receive events for Jobs that are matched by ANY of the - * given Matchers. - * - * If no matchers are provided, theEverythingMatcher
will be used. - * - * @see Matcher - * @see EverythingMatcher - */ + ///+ /// Add the given + ///{@link JobListener}
to theScheduler
, + /// and register it to receive events for Jobs that are matched by ANY of the + /// given Matchers. + ///+ /// If no matchers are provided, the + ///EverythingMatcher
will be used. + ///+ /// void AddJobListener(IJobListener jobListener, params IMatcher [] matchers); - /** - * Add the given {@link JobListener}
to theScheduler
, - * and register it to receive events for Jobs that are matched by ANY of the - * given Matchers. - * - * If no matchers are provided, theEverythingMatcher
will be used. - * - * @see Matcher - * @see EverythingMatcher - */ + ///+ /// Add the given + ///{@link JobListener}
to theScheduler
, + /// and register it to receive events for Jobs that are matched by ANY of the + /// given Matchers. + ///+ /// If no matchers are provided, the + ///EverythingMatcher
will be used. + ///+ /// void AddJobListener(IJobListener jobListener, IList > matchers); - /** - * Add the given Matcher to the set of matchers for which the listener - * will receive events if ANY of the matchers match. - * - * @param listenerName the name of the listener to add the matcher to - * @param matcher the additional matcher to apply for selecting events - * @return true if the identified listener was found and updated - * @throws SchedulerException - */ + /// + /// Add the given Matcher to the set of matchers for which the listener + /// will receive events if ANY of the matchers match. + /// + ///+ /// + /// the name of the listener to add the matcher to + /// the additional matcher to apply for selecting events + ///true if the identified listener was found and updated bool AddJobListenerMatcher(string listenerName, IMatchermatcher); - /** - * Remove the given Matcher to the set of matchers for which the listener - * will receive events if ANY of the matchers match. - * - * @param listenerName the name of the listener to add the matcher to - * @param matcher the additional matcher to apply for selecting events - * @return true if the given matcher was found and removed from the listener's list of matchers - * @throws SchedulerException - */ + /// + /// Remove the given Matcher to the set of matchers for which the listener + /// will receive events if ANY of the matchers match. + /// + ///+ /// + /// the name of the listener to add the matcher to + /// the additional matcher to apply for selecting events + ///true if the given matcher was found and removed from the listener's list of matchers bool RemoveJobListenerMatcher(string listenerName, IMatchermatcher); - /** - * Set the set of Matchers for which the listener - * will receive events if ANY of the matchers match. - * - * Removes any existing matchers for the identified listener!
- * - * @param listenerName the name of the listener to add the matcher to - * @param matchers the matchers to apply for selecting events - * @return true if the given matcher was found and removed from the listener's list of matchers - * @throws SchedulerException - */ + ///+ /// Set the set of Matchers for which the listener + /// will receive events if ANY of the matchers match. + /// + ///+ /// + /// the name of the listener to add the matcher to + /// the matchers to apply for selecting events + ///Removes any existing matchers for the identified listener!
+ ///true if the given matcher was found and removed from the listener's list of matchers bool SetJobListenerMatchers(string listenerName, IList> matchers); - /** - * Get the set of Matchers for which the listener - * will receive events if ANY of the matchers match. - * - * - * @param listenerName the name of the listener to add the matcher to - * @return the matchers registered for selecting events for the identified listener - * @throws SchedulerException - */ + /// + /// Get the set of Matchers for which the listener + /// will receive events if ANY of the matchers match. + /// + ///+ /// + /// the name of the listener to add the matcher to + ///the matchers registered for selecting events for the identified listener IList> GetJobListenerMatchers(string listenerName); - /** - * Remove the identified {@link JobListener}
from theScheduler
. - * - * @return true if the identified listener was found in the list, and - * removed. - */ + ///+ /// Remove the identified + ///{@link JobListener}
from theScheduler
. + ///+ /// + ///true if the identified listener was found in the list, and removed. bool RemoveJobListener(string name); - /** - * Get a List containing all of the{@link JobListener}
s in - * theScheduler
. - */ + ///+ /// Get a List containing all of the IList{@link JobListener}
s in + /// theScheduler
. + ///GetJobListeners(); - /** - * Get the {@link JobListener}
that has the given name. - */ + ///+ /// Get the IJobListener GetJobListener(string name); - /** - * Add the given{@link JobListener}
that has the given name. + ///{@link TriggerListener}
to theScheduler
, - * and register it to receive events for Triggers that are matched by ANY of the - * given Matchers. - * - * If no matcher is provided, theEverythingMatcher
will be used. - * - * @see Matcher - * @see EverythingMatcher - */ + ///+ /// Add the given + ///{@link TriggerListener}
to theScheduler
, + /// and register it to receive events for Triggers that are matched by ANY of the + /// given Matchers. + ///+ /// If no matcher is provided, the + ///EverythingMatcher
will be used. + ///+ /// void AddTriggerListener(ITriggerListener triggerListener, params IMatcher [] matchers); - /** - * Add the given {@link TriggerListener}
to theScheduler
, - * and register it to receive events for Triggers that are matched by ANY of the - * given Matchers. - * - * If no matcher is provided, theEverythingMatcher
will be used. - * - * @see Matcher - * @see EverythingMatcher - */ + ///+ /// Add the given + ///{@link TriggerListener}
to theScheduler
, + /// and register it to receive events for Triggers that are matched by ANY of the + /// given Matchers. + ///+ /// If no matcher is provided, the + ///EverythingMatcher
will be used. + ///+ /// void AddTriggerListener(ITriggerListener triggerListener, IList > matchers); - /** - * Add the given Matcher to the set of matchers for which the listener - * will receive events if ANY of the matchers match. - * - * @param listenerName the name of the listener to add the matcher to - * @param matcher the additional matcher to apply for selecting events - * @return true if the identified listener was found and updated - * @throws SchedulerException - */ + /// + /// Add the given Matcher to the set of matchers for which the listener + /// will receive events if ANY of the matchers match. + /// + ///+ /// + /// the name of the listener to add the matcher to + /// the additional matcher to apply for selecting events + ///true if the identified listener was found and updated bool AddTriggerListenerMatcher(string listenerName, IMatchermatcher); - /** - * Remove the given Matcher to the set of matchers for which the listener - * will receive events if ANY of the matchers match. - * - * @param listenerName the name of the listener to add the matcher to - * @param matcher the additional matcher to apply for selecting events - * @return true if the given matcher was found and removed from the listener's list of matchers - * @throws SchedulerException - */ + /// + /// Remove the given Matcher to the set of matchers for which the listener + /// will receive events if ANY of the matchers match. + /// + ///+ /// + /// the name of the listener to add the matcher to + /// the additional matcher to apply for selecting events + ///true if the given matcher was found and removed from the listener's list of matchers bool RemoveTriggerListenerMatcher(string listenerName, IMatchermatcher); - /** - * Set the set of Matchers for which the listener - * will receive events if ANY of the matchers match. - * - * Removes any existing matchers for the identified listener!
- * - * @param listenerName the name of the listener to add the matcher to - * @param matchers the matchers to apply for selecting events - * @return true if the given matcher was found and removed from the listener's list of matchers - * @throws SchedulerException - */ + ///+ /// Set the set of Matchers for which the listener + /// will receive events if ANY of the matchers match. + /// + ///+ /// + /// the name of the listener to add the matcher to + /// the matchers to apply for selecting events + ///Removes any existing matchers for the identified listener!
+ ///true if the given matcher was found and removed from the listener's list of matchers bool SetTriggerListenerMatchers(string listenerName, IList> matchers); - /** - * Get the set of Matchers for which the listener - * will receive events if ANY of the matchers match. - * - * - * @param listenerName the name of the listener to add the matcher to - * @return the matchers registered for selecting events for the identified listener - * @throws SchedulerException - */ + /// + /// Get the set of Matchers for which the listener + /// will receive events if ANY of the matchers match. + /// + ///+ /// + /// the name of the listener to add the matcher to + ///the matchers registered for selecting events for the identified listener IList> GetTriggerListenerMatchers(string listenerName); - /** - * Remove the identified {@link TriggerListener}
from theScheduler
. - * - * @return true if the identified listener was found in the list, and - * removed. - */ + ///+ /// Remove the identified + ///{@link TriggerListener}
from theScheduler
. + ///+ /// + ///true if the identified listener was found in the list, and + /// removed. bool RemoveTriggerListener(string name); - /** - * Get a List containing all of the{@link TriggerListener}
s - * in theScheduler
. - */ + ///+ /// Get a List containing all of the IList{@link TriggerListener}
s + /// in theScheduler
. + ///GetTriggerListeners(); - /** - * Get the {@link TriggerListener}
that has the given name. - */ + ///+ /// Get the ITriggerListener GetTriggerListener(string name); - /** - * Register the given{@link TriggerListener}
that has the given name. + ///{@link SchedulerListener}
with the - *Scheduler
. - */ + ///+ /// Register the given void AddSchedulerListener(ISchedulerListener schedulerListener); - /** - * Remove the given{@link SchedulerListener}
with the + ///Scheduler
. + ///{@link SchedulerListener}
from the - *Scheduler
. - * - * @return true if the identified listener was found in the list, and - * removed. - */ + ///+ /// Remove the given + ///{@link SchedulerListener}
from the + ///Scheduler
. + ///+ /// + ///true if the identified listener was found in the list, and removed. bool RemoveSchedulerListener(ISchedulerListener schedulerListener); - /** - * Get a List containing all of the{@link SchedulerListener}
s - * registered with theScheduler
. - */ + ///+ /// Get a List containing all of the IList{@link SchedulerListener}
s + /// registered with theScheduler
. + ///GetSchedulerListeners(); } } \ No newline at end of file diff --git a/src/Quartz/IScheduler.cs b/src/Quartz/IScheduler.cs index 0c1f267fd..0c7a58f6d 100644 --- a/src/Quartz/IScheduler.cs +++ b/src/Quartz/IScheduler.cs @@ -32,9 +32,9 @@ namespace Quartz /// /// ////// A ///maintains a registry of - /// s and s. Once + /// s and s. Once /// registered, the is responsible for executing - /// s when their associated s + /// s when their associated s /// fire (when their scheduled time arrives). /// @@ -55,20 +55,20 @@ namespace Quartz /// Trigger)% or %IScheduler.AddJob(JobDetail, bool)% method. /// ///- /// ///s can then be defined to fire individual + /// s can then be defined to fire individual /// instances based on given schedules. - /// s are most useful for one-time firings, or + /// 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. s allow scheduling based on time of day, + /// them. s allow scheduling based on time of day, /// day of week, day of month, and month of year. /// - /// @@ -81,7 +81,7 @@ namespace Quartz /// available from Quartz. Thes and s have a name and + /// s and s have a name and /// group associated with them, which should uniquely identify them within a single /// . The 'group' feature may be useful for creating /// logical groupings or categorizations of s and - /// s. If you don't have need for assigning a group to a - /// given s of s, then you can use + /// s. If you don't have need for assigning a group to a + /// given s of s, then you can use /// the constant defined on /// this interface. /// interface provides /// notifications of executions. The /// interface provides notifications of - /// firings. The + /// firings. The /// interface provides notifications of events and /// errors. Listeners can be associated with local schedulers through the /// interface. @@ -93,7 +93,7 @@ namespace Quartz /// /// - /// + /// /// /// /// @@ -202,12 +202,12 @@ public interface IScheduler IList GetJobGroupNames(); /// - /// Get the names of all known IListgroups. + /// Get the names of all known groups. /// GetTriggerGroupNames(); /// - /// Get the names of all Collection.ISetgroups that are paused. + /// Get the names of all groups that are paused. /// GetPausedTriggerGroups(); @@ -217,7 +217,7 @@ public interface IScheduler IList CalendarNames { get; } /// - /// Starts the DateTimeOffset ScheduleJob(ITrigger trigger); - - /** - * Schedule all of the given jobs with the related set of triggers. - * - *'s threads that fire s. + /// Starts the 's threads that fire s. /// 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 method. @@ -257,7 +257,7 @@ public interface IScheduler bool IsStarted { get; } /// - /// Temporarily halts the ///'s firing of s. + /// Temporarily halts the 's firing of s. /// /// @@ -276,7 +276,7 @@ public interface IScheduler void Standby(); ///
- /// Halts the @@ -287,7 +287,7 @@ public interface IScheduler void Shutdown(); ///'s firing of s, + /// Halts the 's firing of s, /// and cleans up all resources associated with the Scheduler. Equivalent to /// . /// - /// Halts the ///'s firing of s, + /// Halts the 's firing of s, /// and cleans up all resources associated with the Scheduler. /// @@ -318,52 +318,49 @@ public interface IScheduler /// If any of the given jobs or triggers already exist (or more - * specifically, if the keys are not unique) and the replace - * parameter is not set to true then an exception will be thrown.
- * - * @throws ObjectAlreadyExistsException if the job/trigger keys - * are not unique and the replace flag is not set to true. - */ + ///+ /// Schedule all of the given jobs with the related set of triggers. + /// + ///+ /// void ScheduleJobs(IDictionaryIf any of the given jobs or triggers already exist (or more + /// specifically, if the keys are not unique) and the replace + /// parameter is not set to true then an exception will be thrown.
+ ///> triggersAndJobs, bool replace); /// - /// Remove the indicated bool UnscheduleJob(TriggerKey triggerKey); - /** - * Remove all of the indicatedfrom the scheduler. + /// Remove the indicated 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.
///{@link Trigger}
s 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.
- * - *Note that while this bulk operation is likely more efficient than - * invoking
- */ + ///unscheduleJob(TriggerKey triggerKey)
several - * times, it may have the adverse affect of holding data locks for a - * single long duration of time (rather than lots of small durations - * of time).+ /// Remove all of the indicated + ///{@link Trigger}
s from the scheduler. + ///+ /// bool UnscheduleJobs(IListIf the related job does not have any other triggers, and the job is + /// not durable, then the job will also be deleted.
+ /// Note that while this bulk operation is likely more efficient than + /// invokingunscheduleJob(TriggerKey triggerKey)
several + /// times, it may have the adverse affect of holding data locks for a + /// single long duration of time (rather than lots of small durations + /// of time). + ///triggerKeys); /// - /// Remove (delete) the /// - /// The newwith the + /// Remove (delete) the 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. /// to be stored. + /// The new to be stored. /// /// - /// @@ -371,8 +368,8 @@ public interface IScheduler ///if a with the given + /// if a with the given /// name and group was not found and removed from the store, otherwise /// the first fire time of the newly scheduled trigger. /// /// Add the given ///to the Scheduler - with no associated - /// . The will be 'dormant' until - /// it is scheduled with a , or + /// . The will be 'dormant' until + /// it is scheduled with a , or /// is called for it. /// @@ -383,27 +380,27 @@ public interface IScheduler /// /// Delete the identified ///from the Scheduler - and any - /// associated s. + /// associated s. /// true if the Job was found and deleted. bool DeleteJob(JobKey jobKey); - /** - * Delete the identifiedJob
s from the Scheduler - and any - * associatedTrigger
s. - * - *Note that while this bulk operation is likely more efficient than - * invoking
- * - * @return true if all of the Jobs were found and deleted, false if - * one or more were not deleted. - * @throws SchedulerException - * if there is an internal Scheduler error. - */ + ///deleteJob(JobKey jobKey)
several - * times, it may have the adverse affect of holding data locks for a - * single long duration of time (rather than lots of small durations - * of time).+ /// Delete the identified + ///Job
s from the Scheduler - and any + /// associatedTrigger
s. + ///+ /// + ///Note that while this bulk operation is likely more efficient than + /// invoking
+ ///deleteJob(JobKey jobKey)
several + /// times, it may have the adverse affect of holding data locks for a + /// single long duration of time (rather than lots of small durations + /// of time).+ /// true if all of the Jobs were found and deleted, false if + /// one or more were not deleted. + /// bool DeleteJobs(IListjobKeys); /// @@ -423,13 +420,13 @@ public interface IScheduler /// ////// Pause the void PauseJob(JobKey jobKey); ///with the given - /// key - by pausing all of its current s. + /// key - by pausing all of its current s. /// /// Pause all of the ///s in the - /// given group - by pausing all of their s. + /// given group - by pausing all of their s. /// /// The Scheduler will "remember" that the group is paused, and impose the @@ -440,12 +437,12 @@ public interface IScheduler void PauseJobGroup(string groupName); /// - /// Pause the void PauseTrigger(TriggerKey triggerKey); ///with the given key. + /// Pause the with the given key. /// - /// Pause all of the ///s in the given group. + /// Pause all of the s in the given group. /// /// The Scheduler will "remember" that the group is paused, and impose the @@ -460,8 +457,8 @@ public interface IScheduler /// the given key. /// - /// If any of the void ResumeJob(JobKey jobKey); @@ -471,30 +468,30 @@ public interface IScheduler /// in the given group. ///'s s missed one - /// or more fire-times, then the 's misfire + /// If any of the 's s missed one + /// or more fire-times, then the 's misfire /// instruction will be applied. /// - /// If any of the ///s had s that - /// missed one or more fire-times, then the 's + /// If any of the s had s that + /// missed one or more fire-times, then the 's /// misfire instruction will be applied. /// void ResumeJobGroup(string groupName); /// - /// Resume (un-pause) the ///with the given + /// Resume (un-pause) the with the given /// key. /// - /// If the void ResumeTrigger(TriggerKey triggerKey); ///missed one or more fire-times, then the - /// 's misfire instruction will be applied. + /// If the missed one or more fire-times, then the + /// 's misfire instruction will be applied. /// - /// Resume (un-pause) all of the ///s in the + /// Resume (un-pause) all of the s in the /// given group. /// - /// If any ///missed one or more fire-times, then the - /// 's misfire instruction will be applied. + /// If any missed one or more fire-times, then the + /// 's misfire instruction will be applied. /// void ResumeTriggerGroup(string groupName); @@ -519,8 +516,8 @@ public interface IScheduler /// on every group. /// - /// If any ///missed one or more fire-times, then the - /// 's misfire instruction will be applied. + /// If any missed one or more fire-times, then the + /// 's misfire instruction will be applied. /// void ResumeAll(); @@ -531,7 +528,7 @@ public interface IScheduler IList GetJobKeys(string groupName); /// - /// Get all ///s that are associated with the + /// Get all s that are associated with the /// identified . /// @@ -542,7 +539,7 @@ public interface IScheduler IList GetTriggersOfJob(JobKey jobKey); /// - /// Get the names of all the ILists in the given + /// Get the names of all the s in the given /// group. /// GetTriggerKeys(string groupName); @@ -559,7 +556,7 @@ public interface IScheduler IJobDetail GetJobDetail(JobKey jobKey); /// - /// Get the ///instance with the given key. + /// Get the instance with the given key. /// /// The returned Trigger object will be a snap-shot of the actual stored @@ -569,7 +566,7 @@ public interface IScheduler ITrigger GetTrigger(TriggerKey triggerKey); /// - /// Get the current state of the identified ///. + /// Get the current state of the identified . /// /// @@ -654,7 +651,7 @@ public interface IScheduler bool CheckExists(JobKey jobKey); /// - /// Determine whether a /// the identifier to check for @@ -662,7 +659,7 @@ public interface IScheduler bool CheckExists(TriggerKey triggerKey); ///with the given identifier already + /// Determine whether a with the given identifier already /// exists within the scheduler. /// - /// Clears (deletes!) all scheduling data - all void Clear(); diff --git a/src/Quartz/ISchedulerListener.cs b/src/Quartz/ISchedulerListener.cs index 49307f68d..c938cb34a 100644 --- a/src/Quartz/ISchedulerListener.cs +++ b/src/Quartz/ISchedulerListener.cs @@ -46,19 +46,19 @@ public interface ISchedulerListener void JobUnscheduled(TriggerKey triggerKey); ///s, s + /// Clears (deletes!) all scheduling data - all s, s /// s. /// - /// Called by the void TriggerFinalized(ITrigger trigger); ///when a + /// Called by the when a /// has reached the condition in which it will never fire again. /// - /// Called by the void TriggerPaused(TriggerKey triggerKey); ///a s has been paused. + /// Called by the a s has been paused. /// /// Called by the ///a group of - /// s has been paused. + /// s has been paused. /// /// If a all groups were paused, then the parameter @@ -68,14 +68,14 @@ public interface ISchedulerListener void TriggersPaused(string triggerGroup); /// - /// Called by the void TriggerResumed(TriggerKey triggerKey); ///when a + /// Called by the when a /// has been un-paused. /// /// Called by the ///when a - /// group of s has been un-paused. + /// group of s has been un-paused. /// /// If all groups were resumed, then the parameter @@ -131,7 +131,7 @@ public interface ISchedulerListener /// Called by the when a serious error has /// occurred within the scheduler - such as repeated failures in the , /// or the inability to instantiate a instance when its - /// has fired. + /// has fired. /// - /// A - ///that is used to fire a + /// A that is used to fire a /// at a given moment in time, and optionally repeated at a specified interval. /// + /// /// /// James House ///Contributions by Lieven Govaerts of Ebitec Nv, Belgium. @@ -14,19 +16,19 @@ namespace Quartz public interface ISimpleTrigger : ITrigger { ///- /// Get or set thhe number of times the - ///should + /// Get or set thhe number of times the should /// repeat, after which it will be automatically deleted. /// + /// int RepeatCount { get; set; } /// - /// Get or set the the time interval at which the TimeSpan RepeatInterval { get; set; } ///should repeat. + /// Get or set the the time interval at which the should repeat. /// - /// Get or set the number of times the int TimesTriggered { get; set; } diff --git a/src/Quartz/ITrigger.cs b/src/Quartz/ITrigger.cs index 13b48b0e7..ad6c71b51 100644 --- a/src/Quartz/ITrigger.cs +++ b/src/Quartz/ITrigger.cs @@ -25,31 +25,30 @@ namespace Quartz { ///has already + /// Get or set the number of times the has already /// fired. /// /// The base interface with properties common to all ///Trigger
s - - /// useto instantiate an actual Trigger. + /// use to instantiate an actual Trigger. /// /// - ///- ///
/// ///s have a associated with them, which + /// s have a associated with them, which /// should uniquely identify them within a single . /// - ///
/// ///s are the 'mechanism' by which s - /// are scheduled. Many s can point to the same , - /// but a single can only point to one . + /// s are the 'mechanism' by which s + /// are scheduled. Many s can point to the same , + /// but a single can only point to one . /// /// Triggers can 'send' parameters/data to
///s by placing contents - /// into the on the . + /// into the on the . /// + /// /// /// /// /// - /// /// /// /// James House @@ -62,21 +61,14 @@ public interface ITrigger : ICloneable, IComparableJobKey JobKey { get; } /// - /// Get a - ///that is configured to produce a - /// Trigger
identical to this one. - ///- ITriggerBuilder GetTriggerBuilder () where T : ITrigger; - - /// - /// Get a ///that is configured to produce a + /// Get a that is configured to produce a /// schedule identical to this trigger's schedule. /// - IScheduleBuilder GetScheduleBuilder () where T : ITrigger; + IScheduleBuilder GetScheduleBuilder(); /// - /// Get or set the description given to the string Description { get; } @@ -89,7 +81,7 @@ public interface ITrigger : ICloneable, IComparableinstance by + /// Get or set the description given to the instance by /// its creator (if any). /// /// /// Get or set the /// The DB Connection - /// The name of the trigger. - /// The group containing the trigger. + /// The key identifying the trigger. /// The new state for the trigger. ///that is associated with the - /// . + /// . /// /// Changes made to this map during job execution are not re-persisted, and /// in fact typically result in an illegal state. @@ -98,7 +90,7 @@ public interface ITrigger : ICloneable, IComparable
JobDataMap JobDataMap { get; } /// - /// Returns the last UTC time at which the /// the DB Connection - /// Name of the trigger. - /// Name of the group. + /// The key identifying the trigger. ///will fire, if + /// Returns the last UTC time at which the will fire, if /// the Trigger will repeat indefinitely, null will be returned. /// /// Note that the return time *may* be in the past. @@ -108,8 +100,8 @@ public interface ITrigger : ICloneable, IComparable
/// /// Get or set the instruction the ///should be given for - /// handling misfire situations for this - the - /// concrete type that you are using will have + /// handling misfire situations for this - the + /// concrete type that you are using will have /// defined a set of additional MISFIRE_INSTRUCTION_XXX /// constants that may be set to this property. /// @@ -143,8 +135,8 @@ public interface ITrigger : ICloneable, IComparable
DateTimeOffset StartTimeUtc { get; } /// - /// The priority of a @@ -152,21 +144,21 @@ public interface ITrigger : ICloneable, IComparableacts as a tie breaker such that if - /// two s have the same scheduled fire time, then Quartz + /// The priority of a acts as a tie breaker such that if + /// two s have the same scheduled fire time, then Quartz /// will do its best to give the one with the higher priority first access /// to a worker thread. /// /// If not explicitly set, the default value is 5. /// /// - /// + /// int Priority { get; set; } /// /// Used by the bool GetMayFireAgain(); ///to determine whether or not - /// it is possible for this to fire again. + /// it is possible for this to fire again. /// /// If the returned value is
///then the - /// may remove the from the . + /// may remove the from the . /// - /// Returns the next time at which the ///is scheduled to fire. If + /// Returns the next time at which the is scheduled to fire. If /// the trigger will not fire again, will be returned. Note that /// the time returned can possibly be in the past, if the time that was computed /// for the trigger to next fire has already arrived, but the scheduler has not yet @@ -174,21 +166,20 @@ public interface ITrigger : ICloneable, IComparable /// e.g. threads). /// - /// The value returned is not guaranteed to be valid until after the - ///+ /// The value returned is not guaranteed to be valid until after the /// has been added to the scheduler. /// /// DateTimeOffset? GetNextFireTimeUtc(); /// - /// Returns the previous time at which the - DateTimeOffset? PreviousFireTimeUtc { get; } + DateTimeOffset? GetPreviousFireTimeUtc(); ///fired. + /// Returns the previous time at which the fired. /// If the trigger has not yet fired, will be returned. /// - /// Returns the next time at which the diff --git a/src/Quartz/ITriggerListener.cs b/src/Quartz/ITriggerListener.cs index 1e59e5a49..edb3b73bd 100644 --- a/src/Quartz/ITriggerListener.cs +++ b/src/Quartz/ITriggerListener.cs @@ -17,16 +17,18 @@ */ #endregion +using Quartz.Spi; + namespace Quartz { ///will fire, + /// Returns the next time at which the will fire, /// after the given time. If the trigger will not fire after the given time, /// will be returned. /// /// The interface to be implemented by classes that want to be informed when a - /// - ///fires. In general, applications that use a + /// fires. In general, applications that use a /// will not have use for this mechanism. /// + /// /// - /// + /// /// /// /// James House @@ -39,7 +41,7 @@ public interface ITriggerListener string Name { get; } ///- /// Called by the - /// Thewhen a + /// Called by the when a /// has fired, and it's associated /// is about to be executed. /// @@ -47,14 +49,14 @@ public interface ITriggerListener /// interface. ///
///that has fired. + /// The that has fired. /// - /// The that will be passed to the 's method. + /// The that will be passed to the 's method. /// void TriggerFired(ITrigger trigger, IJobExecutionContext context); /// - /// Called by the - /// Thewhen a + /// Called by the when a /// has fired, and it's associated /// is about to be executed. /// @@ -63,15 +65,15 @@ public interface ITriggerListener /// returning
///, the job's execute method will not be called. /// that has fired. - /// The that will be passed to + /// The that has fired. + /// The that will be passed to /// the 's method. /// Returns true if job execution should be vetoed, false otherwise. bool VetoJobExecution(ITrigger trigger, IJobExecutionContext context); ///- /// Called by the - /// Thewhen a + /// Called by the when a /// has misfired. /// /// Consideration should be given to how much time is spent in this method, @@ -80,22 +82,22 @@ public interface ITriggerListener /// does a lot. ///
///that has misfired. + /// The that has misfired. void TriggerMisfired(ITrigger trigger); /// - /// Called by the - /// Thewhen a + /// Called by the when a /// has fired, it's associated - /// has been executed, and it's method has been + /// has been executed, and it's method has been /// called. /// that was fired. + /// The that was fired. /// /// The that was passed to the /// 's method. /// /// - /// The result of the call on the 's method. + /// The result of the call on the 's method. /// void TriggerComplete(ITrigger trigger, IJobExecutionContext context, SchedulerInstruction triggerInstructionCode); } diff --git a/src/Quartz/Impl/AdoJobStore/CalendarIntervalTriggerPersistenceDelegate.cs b/src/Quartz/Impl/AdoJobStore/CalendarIntervalTriggerPersistenceDelegate.cs index 598951cac..a54ee798b 100644 --- a/src/Quartz/Impl/AdoJobStore/CalendarIntervalTriggerPersistenceDelegate.cs +++ b/src/Quartz/Impl/AdoJobStore/CalendarIntervalTriggerPersistenceDelegate.cs @@ -51,8 +51,8 @@ protected override SimplePropertiesTriggerProperties GetTriggerProperties(IOpera protected override TriggerPropertyBundle GetTriggerPropertyBundle(SimplePropertiesTriggerProperties props) { - CalendarIntervalScheduleBuilder sb = CalendarIntervalScheduleBuilder.CalendarIntervalSchedule() - .withInterval( + CalendarIntervalScheduleBuilder sb = CalendarIntervalScheduleBuilder.Create() + .WithInterval( props.Int1, (IntervalUnit) Enum.Parse(typeof(IntervalUnit), props.String1, true)); diff --git a/src/Quartz/Impl/AdoJobStore/DBSemaphore.cs b/src/Quartz/Impl/AdoJobStore/DBSemaphore.cs index d76b8ef52..1ba5199d5 100644 --- a/src/Quartz/Impl/AdoJobStore/DBSemaphore.cs +++ b/src/Quartz/Impl/AdoJobStore/DBSemaphore.cs @@ -49,13 +49,13 @@ public abstract class DBSemaphore : StdAdoConstants, ISemaphore, ITablePrefixAwa private string expandedSQL; private string expandedInsertSQL; - private AdoUtil adoUtil; + private readonly AdoUtil adoUtil; /// /// Initializes a new instance of the /// The table prefix. - /// The SQL. + /// The SQL. /// The default SQL. /// The db provider. public DBSemaphore(string tablePrefix, string schedName, string defaultSQL, string defaultInsertSQL, IDbProvider dbProvider) @@ -72,7 +72,7 @@ public DBSemaphore(string tablePrefix, string schedName, string defaultSQL, stri /// Gets or sets the lock owners. ///class. /// The lock owners. - private static Collection.HashSetLockOwners + private static HashSet LockOwners { get { return LogicalThreadContext.GetData >(ThreadContextKeyLockOwners); } set { LogicalThreadContext.SetData(ThreadContextKeyLockOwners, value); } @@ -229,12 +229,12 @@ private void SetExpandedSql() { if (TablePrefix != null && SchedName != null && sql != null && insertSql != null) { - expandedSQL = AdoJobStoreUtil.ReplaceTablePrefix(this.sql, TablePrefix, SchedulerNameLiteral); - expandedInsertSQL = AdoJobStoreUtil.ReplaceTablePrefix(this.insertSql, TablePrefix, SchedulerNameLiteral); + expandedSQL = AdoJobStoreUtil.ReplaceTablePrefix(sql, TablePrefix, SchedulerNameLiteral); + expandedInsertSQL = AdoJobStoreUtil.ReplaceTablePrefix(insertSql, TablePrefix, SchedulerNameLiteral); } } - private String schedNameLiteral = null; + private String schedNameLiteral; protected string SchedulerNameLiteral { diff --git a/src/Quartz/Impl/AdoJobStore/IDriverDelegate.cs b/src/Quartz/Impl/AdoJobStore/IDriverDelegate.cs index 7a3e757d1..70befe646 100644 --- a/src/Quartz/Impl/AdoJobStore/IDriverDelegate.cs +++ b/src/Quartz/Impl/AdoJobStore/IDriverDelegate.cs @@ -95,12 +95,12 @@ public interface IDriverDelegate /// /// In order to preserve the ordering of the triggers, the fire time will be /// set from the ColumnFiredTime column in the TableFiredTriggers - /// table. The caller is responsible for calling /// The DB Connection - ///+ /// table. The caller is responsible for calling /// on each returned trigger. It is also up to the caller to insert the /// returned triggers to ensure that they are fired. /// An array of + ///objects An array of IListobjects SelectTriggersForRecoveringJobs(ConnectionAndTransactionHolder conn); /// @@ -144,35 +144,31 @@ public interface IDriverDelegate /// /// /// The DB Connection - /// The job name - /// The job group + /// The key identifying the job. IListSelectTriggerNamesForJob(ConnectionAndTransactionHolder conn, JobKey jobKey); /// /// Delete the job detail record for the given job. /// /// The DB Connection - /// the name of the job - /// Name of the group. - ///the number of rows deleted + /// The key identifying the job. + ///the number of rows deleted int DeleteJobDetail(ConnectionAndTransactionHolder conn, JobKey jobKey); ////// Check whether or not the given job is stateful. /// /// The DB Connection - /// The name of the job - /// The group containing the job - ///true if the job exists and is stateful, false otherwise + /// The key identifying the job. + ///true if the job exists and is stateful, false otherwise bool IsJobStateful(ConnectionAndTransactionHolder conn, JobKey jobKey); ////// Check whether or not the given job exists. /// /// The DB Connection - /// Name of the job. - /// Name of the group. - ///true if the job exists, false otherwise + /// The key identifying the job. + ///true if the job exists, false otherwise bool JobExists(ConnectionAndTransactionHolder conn, JobKey jobKey); ///@@ -187,8 +183,7 @@ public interface IDriverDelegate /// Select the JobDetail object for a given job name / group name. /// /// The DB Connection - /// The job name whose listeners are wanted - /// The group containing the job + /// The key identifying the job. /// The class load helper. ///The populated JobDetail object JobDetailImpl SelectJobDetail(ConnectionAndTransactionHolder conn, JobKey jobKey, ITypeLoadHelper classLoadHelper); @@ -259,8 +254,7 @@ public interface IDriverDelegate /// Check whether or not a trigger exists. ///the number of rows updated bool TriggerExists(ConnectionAndTransactionHolder conn, TriggerKey triggerKey); @@ -268,8 +262,7 @@ public interface IDriverDelegate /// Update the state for a given trigger. ///the number of rows updated int UpdateTriggerState(ConnectionAndTransactionHolder conn, TriggerKey triggerKey, string state); @@ -279,8 +272,7 @@ public interface IDriverDelegate /// old state. ///int the number of rows updated @@ -292,8 +284,7 @@ int UpdateTriggerStateFromOtherState(ConnectionAndTransactionHolder conn, Trigge /// given old states. /// /// The DB connection - /// The name of the trigger - /// The group containing the trigger + /// The key identifying the trigger. /// The new state for the trigger /// One of the old state the trigger must be in /// One of the old state the trigger must be in @@ -335,8 +326,7 @@ int UpdateTriggerGroupStateFromOtherStates(ConnectionAndTransactionHolder conn, /// Update the states of all triggers associated with the given job. /// /// The DB Connection - /// The name of the job. - /// The group containing the job. + /// The key identifying the job. /// The new state for the triggers. ///The number of rows updated int UpdateTriggerStatesForJob(ConnectionAndTransactionHolder conn, JobKey jobKey, string state); @@ -346,8 +336,7 @@ int UpdateTriggerGroupStateFromOtherStates(ConnectionAndTransactionHolder conn, /// are the given current state. /// /// The DB Connection - /// The name of the job - /// The group containing the job + /// The key identifying the job. /// The new state for the triggers /// The old state of the triggers ///the number of rows updated @@ -357,9 +346,8 @@ int UpdateTriggerGroupStateFromOtherStates(ConnectionAndTransactionHolder conn, /// Delete the BLOB trigger data for a trigger. /// /// The DB Connection - /// The name of the trigger - /// The group containing the trigger - ///The number of rows deleted + /// The key identifying the trigger. + ///The number of rows deleted int DeleteBlobTrigger(ConnectionAndTransactionHolder conn, TriggerKey triggerKey); @@ -367,29 +355,26 @@ int UpdateTriggerGroupStateFromOtherStates(ConnectionAndTransactionHolder conn, /// Delete the base trigger data for a trigger. /// /// The DB Connection - /// The name of the trigger - /// The group containing the trigger - ///the number of rows deleted + /// The key identifying the trigger. + ///the number of rows deleted int DeleteTrigger(ConnectionAndTransactionHolder conn, TriggerKey triggerKey); ////// Select the number of triggers associated with a given job. /// /// The DB Connection - /// The name of the job - /// The group containing the job - ///the number of triggers for the given job + /// The key identifying the job. + ///the number of triggers for the given job int SelectNumTriggersForJob(ConnectionAndTransactionHolder conn, JobKey jobKey); ////// Select the job to which the trigger is associated. /// /// The DB Connection - /// The name of the trigger - /// The group containing the trigger + /// The key identifying the trigger. /// The load helper. ///- /// The JobDetailImpl SelectJobForTrigger(ConnectionAndTransactionHolder conn, TriggerKey triggerKey, ITypeLoadHelper loadHelper); @@ -397,9 +382,8 @@ int UpdateTriggerGroupStateFromOtherStates(ConnectionAndTransactionHolder conn, /// Select the triggers for a job> /// /// The DB Connection - /// The name of the trigger - /// The group containing the trigger - ///object associated with the given trigger + /// The object associated with the given trigger /// an array of + /// The key identifying the job. + ///objects associated with a given job. an array of IListobjects associated with a given job. SelectTriggersForJob(ConnectionAndTransactionHolder conn, JobKey jobKey); /// @@ -408,7 +392,7 @@ int UpdateTriggerGroupStateFromOtherStates(ConnectionAndTransactionHolder conn, /// The DB Connection. /// Name of the calendar. /// /// The DB Connection. - /// The name of the trigger. - /// The group containing the trigger. - ///- /// An array of IListobjects associated with a given job. + /// An array of objects associated with a given job. /// SelectTriggersForCalendar(ConnectionAndTransactionHolder conn, string calName); @@ -416,9 +400,8 @@ int UpdateTriggerGroupStateFromOtherStates(ConnectionAndTransactionHolder conn, /// Select a trigger. /// The object. + /// The key identifying the trigger. + /// The IOperableTrigger SelectTrigger(ConnectionAndTransactionHolder conn, TriggerKey triggerKey); @@ -426,27 +409,24 @@ int UpdateTriggerGroupStateFromOtherStates(ConnectionAndTransactionHolder conn, /// Select a trigger's JobDataMap. /// /// The DB Connection. - /// The name of the trigger. - /// The group containing the trigger. - ///object. /// The + /// The key identifying the trigger. + ///of the Trigger, never null, but possibly empty. The JobDataMap SelectTriggerJobDataMap(ConnectionAndTransactionHolder conn, TriggerKey triggerKey); ///of the Trigger, never null, but possibly empty. /// Select a trigger's state value. /// /// The DB Connection. - /// The name of the trigger. - /// The group containing the trigger. - ///The + /// The key identifying the trigger. + ///object. The string SelectTriggerState(ConnectionAndTransactionHolder conn, TriggerKey triggerKey); ///object. /// Select a triggers status (state and next fire time). /// /// The DB Connection. - /// The name of the trigger. - /// The group containing the trigger. - ///A + /// The key identifying the trigger. + ///object, or null A TriggerStatus SelectTriggerStatus(ConnectionAndTransactionHolder conn, TriggerKey triggerKey); ///object, or null @@ -669,8 +649,7 @@ int UpdateTriggerGroupStateFromOtherStates(ConnectionAndTransactionHolder conn, /// Get the number instances of the identified job currently executing. /// /// The DB Connection - /// Name of the job. - /// The job group. + /// The key identifying the job. ////// The number instances of the identified job currently executing. /// @@ -721,8 +700,8 @@ int UpdateTriggerGroupStateFromOtherStates(ConnectionAndTransactionHolder conn, /// in ascending order of fire time, and then descending by priority. /// /// The conn. - /// highest value ofof the triggers (exclusive) - /// highest value of of the triggers (inclusive) + /// highest value of of the triggers (exclusive) + /// highest value of of the triggers (inclusive) /// A (never null, possibly empty) list of the identifiers (Key objects) of the next triggers to be fired. IListSelectTriggerToAcquire(ConnectionAndTransactionHolder conn, DateTimeOffset noLaterThan, DateTimeOffset noEarlierThan); diff --git a/src/Quartz/Impl/AdoJobStore/ITriggerPersistenceDelegate.cs b/src/Quartz/Impl/AdoJobStore/ITriggerPersistenceDelegate.cs index d9c1c9617..03b0b17e9 100644 --- a/src/Quartz/Impl/AdoJobStore/ITriggerPersistenceDelegate.cs +++ b/src/Quartz/Impl/AdoJobStore/ITriggerPersistenceDelegate.cs @@ -1,4 +1,5 @@ #region License + /* * All content copyright Terracotta, Inc., unless otherwise indicated. All rights reserved. * @@ -15,19 +16,20 @@ * under the License. * */ + #endregion using Quartz.Spi; namespace Quartz.Impl.AdoJobStore { -/** - * An interface which provides an implementation for storing a particular - * type of Trigger
's extended properties. - * - * @author jhouse - */ - + ///+ /// An interface which provides an implementation for storing a particular + /// type of + ///Trigger
's extended properties. + ///+ /// + ///jhouse public interface ITriggerPersistenceDelegate { void Initialize(string tablePrefix, string schedulerName, AdoUtil adoUtil); @@ -48,8 +50,8 @@ public interface ITriggerPersistenceDelegate public class TriggerPropertyBundle { private IScheduleBuilder sb; - private string[] statePropertyNames; - private object[] statePropertyValues; + private readonly string[] statePropertyNames; + private readonly object[] statePropertyValues; public TriggerPropertyBundle(IScheduleBuilder sb, string[] statePropertyNames, object[] statePropertyValues) { @@ -58,19 +60,19 @@ public TriggerPropertyBundle(IScheduleBuilder sb, string[] statePropertyNames, o this.statePropertyValues = statePropertyValues; } - public IScheduleBuilder getScheduleBuilder() + public IScheduleBuilder ScheduleBuilder { - return sb; + get { return sb; } } - public string[] getStatePropertyNames() + public string[] StatePropertyNames { - return statePropertyNames; + get { return statePropertyNames; } } - public object[] getStatePropertyValues() + public object[] StatePropertyValues { - return statePropertyValues; + get { return statePropertyValues; } } } } \ No newline at end of file diff --git a/src/Quartz/Impl/AdoJobStore/JobStoreCMT.cs b/src/Quartz/Impl/AdoJobStore/JobStoreCMT.cs index 4d193ed9b..6838cafb8 100644 --- a/src/Quartz/Impl/AdoJobStore/JobStoreCMT.cs +++ b/src/Quartz/Impl/AdoJobStore/JobStoreCMT.cs @@ -118,8 +118,8 @@ protected override ConnectionAndTransactionHolder GetNonManagedTXConnection() /// transaction, it does not attempt to commit or rollback the /// enclosing transaction. /// - ///- /// + /// + /// /// /// /// diff --git a/src/Quartz/Impl/AdoJobStore/JobStoreSupport.cs b/src/Quartz/Impl/AdoJobStore/JobStoreSupport.cs index cfb3d3a28..50df5d22c 100644 --- a/src/Quartz/Impl/AdoJobStore/JobStoreSupport.cs +++ b/src/Quartz/Impl/AdoJobStore/JobStoreSupport.cs @@ -76,7 +76,7 @@ public abstract class JobStoreSupport : AdoConstants, IJobStore protected int maxToRecoverAtATime = 20; private bool setTxIsolationLevelSequential; private TimeSpan dbRetryInterval = TimeSpan.FromSeconds(10); - private bool acquireTriggersWithinLock = false; + private bool acquireTriggersWithinLock; private bool makeThreadsDaemons; private bool doubleCheckLockMisfireHandler = true; private readonly ILog log; @@ -301,8 +301,8 @@ public virtual string DriverDelegateType /// public string DriverDelegateInitString { - set { this.delegateInitString = value; } - get { return this.delegateInitString; } + set { delegateInitString = value; } + get { return delegateInitString; } } /// @@ -818,7 +818,7 @@ private void DoUpdateOfMisfiredTrigger(ConnectionAndTransactionHolder conn, IOpe } /// /// The conn. - /// Name of the trigger. - /// Name of the group. + /// The key identifying the trigger. ///- /// Store the given /// Job to be stored. /// Trigger to be stored. @@ -855,9 +855,9 @@ public bool IsTriggerGroupPaused(string groupName) } ///and . + /// Store the given and . /// - /// Stores the given - /// The. + /// Stores the given . /// to be stored. + /// The to be stored. /// /// If , any existing in the /// with the same name & group should be over-written. @@ -921,16 +921,16 @@ protected virtual bool JobExists(ConnectionAndTransactionHolder conn, JobKey job /// - /// Store the given - /// The. + /// Store the given . /// to be stored. + /// The to be stored. /// - /// If , any existing in + /// If , any existing in /// the with the same name & group should /// be over-written. /// /// - /// if a public void StoreTrigger(IOperableTrigger newTrigger, bool replaceExisting) @@ -1023,7 +1023,7 @@ protected virtual bool TriggerExists(ConnectionAndTransactionHolder conn, Trigge ///with the same name/group already + /// if a with the same name/group already /// exists, and replaceExisting is set to false. /// /// Remove (delete) the /// @@ -1122,8 +1122,8 @@ public void StoreJobsAndTriggers(IDictionarywith the given - /// name, and any s that reference + /// name, and any s that reference /// it. /// > trigge /// /// Delete a job and its listeners. /// - ///- /// + /// + /// private bool DeleteJobAndChildren(ConnectionAndTransactionHolder conn, JobKey key) { return (Delegate.DeleteJobDetail(conn, key) > 0); @@ -1132,9 +1132,9 @@ private bool DeleteJobAndChildren(ConnectionAndTransactionHolder conn, JobKey ke /// /// Delete a trigger, its listeners, and its Simple/Cron/BLOB sub-table entry. /// - ///- /// - /// + /// + /// + /// private bool DeleteTriggerAndChildren(ConnectionAndTransactionHolder conn, TriggerKey key) { IDriverDelegate del = Delegate; @@ -1142,11 +1142,10 @@ private bool DeleteTriggerAndChildren(ConnectionAndTransactionHolder conn, Trigg } /// - /// Retrieve the - /// The name of thefor the given + /// Retrieve the for the given /// . /// to be retrieved. - /// The group name of the to be retrieved. + /// The key identifying the job. /// The desired public IJobDetail RetrieveJob(JobKey jobKey) { @@ -1175,27 +1174,26 @@ protected virtual JobDetailImpl RetrieveJob(ConnectionAndTransactionHolder conn, ///, or null if there is no match. - /// Remove (delete) the /// ///with the + /// Remove (delete) the with the /// given name. /// /// - /// The name of the- /// If removal of the
/// ///results in an empty group, the + /// If removal of the results in an empty group, the /// group should be removed from the 's list of /// known group names. /// - /// If removal of the
///results in an 'orphaned' + /// If removal of the results in an 'orphaned' /// that is not 'durable', then the should be deleted /// also. /// to be removed. - /// The group name of the to be removed. + /// The key identifying the trigger. /// - /// public bool RemoveTrigger(TriggerKey triggerKey) @@ -1257,7 +1255,7 @@ public Stream GetResourceAsStream(string name) } } - ///if a with the given + /// if a with the given /// name & group was found and removed from the store. /// + /// public bool ReplaceTrigger(TriggerKey triggerKey, IOperableTrigger newTrigger) { return @@ -1296,11 +1294,10 @@ protected virtual bool ReplaceTrigger(ConnectionAndTransactionHolder conn, } /// - /// Retrieve the given - /// The name of the. + /// Retrieve the given . /// to be retrieved. - /// The group name of the to be retrieved. - /// The desired + /// The key identifying the trigger. + ///, or null if there is no match. The desired public IOperableTrigger RetrieveTrigger(TriggerKey triggerKey) { return (IOperableTrigger) ExecuteWithoutLock( // no locks necessary for read... @@ -1322,7 +1319,7 @@ protected virtual IOperableTrigger RetrieveTrigger(ConnectionAndTransactionHolde ///, or null if there is no match. - /// Get the current state of the identified ///. + /// Get the current state of the identified . /// /// @@ -1339,8 +1336,7 @@ public TriggerState GetTriggerState(TriggerKey triggerKey) /// Gets the state of the trigger. /// public virtual TriggerState GetTriggerState(ConnectionAndTransactionHolder conn, TriggerKey triggerKey) { @@ -1488,7 +1484,7 @@ protected virtual bool CalendarExists(ConnectionAndTransactionHolder conn, strin /// /// /// If removal of the /// The name of thewould result in - /// s pointing to non-existent calendars, then a + /// s pointing to non-existent calendars, then a /// will be thrown. /// to be removed. @@ -1525,7 +1521,7 @@ protected virtual bool RemoveCalendar(ConnectionAndTransactionHolder conn, } /// - /// Retrieve the given /// The name of the. + /// Retrieve the given . /// to be retrieved. /// The desired @@ -1593,7 +1589,7 @@ protected virtual int GetNumberOfJobs(ConnectionAndTransactionHolder conn) } ///, or null if there is no match. - /// Get the number of public int GetNumberOfTriggers() @@ -1666,15 +1662,14 @@ protected virtual ILists that are + /// Get the number of s that are /// stored in the . /// GetJobNames(ConnectionAndTransactionHolder conn, return jobNames; } - /** - * Determine whether a {@link Job} with the given identifier already - * exists within the scheduler. - * - * @param jobKey the identifier to check for - * @return true if a Job exists with the given identifier - * @throws SchedulerException - */ - + /// + /// Determine whether a {@link Job} with the given identifier already + /// exists within the scheduler. + /// + ///+ /// + /// the identifier to check for + ///true if a Job exists with the given identifier public bool CheckExists(JobKey jobKey) { return (bool) ExecuteWithoutLock( // no locks necessary for read... @@ -1693,15 +1688,14 @@ protected bool CheckExists(ConnectionAndTransactionHolder conn, JobKey jobKey) } } - /** - * Determine whether a {@link Trigger} with the given identifier already - * exists within the scheduler. - * - * @param triggerKey the identifier to check for - * @return true if a Trigger exists with the given identifier - * @throws SchedulerException - */ - + ///+ /// Determine whether a {@link Trigger} with the given identifier already + /// exists within the scheduler. + /// + ///+ /// + /// the identifier to check for + ///true if a Trigger exists with the given identifier public bool CheckExists(TriggerKey triggerKey) { return (bool) ExecuteWithoutLock( // no locks necessary for read... @@ -1720,18 +1714,15 @@ protected bool CheckExists(ConnectionAndTransactionHolder conn, TriggerKey trigg } } - /** - * Clear (delete!) all scheduling data - all {@link Job}s, {@link Trigger}s - * {@link Calendar}s. - * - * @throws JobPersistenceException - */ - + ///+ /// Clear (delete!) all scheduling data - all {@link Job}s, {@link Trigger}s + /// {@link Calendar}s. + /// + ///+ /// public void ClearAllSchedulingData() { - ExecuteInLock( - LockTriggerAccess, - conn => ClearAllSchedulingData(conn)); + ExecuteInLock(LockTriggerAccess, conn => ClearAllSchedulingData(conn)); } protected void ClearAllSchedulingData(ConnectionAndTransactionHolder conn) @@ -1748,7 +1739,7 @@ protected void ClearAllSchedulingData(ConnectionAndTransactionHolder conn) ///- /// Get the names of all of the ///s + /// Get the names of all of the s /// that have the given group name. /// @@ -1810,7 +1801,7 @@ protected virtual IList GetJobGroupNames(ConnectionAndTransactionHolder } /// - /// Get the names of all of the /// @@ -1897,7 +1888,7 @@ protected virtual IList+ /// Get the names of all of the /// groups. /// GetTriggersForJob(ConnectionAndTransac } /// - /// Pause the public void PauseTrigger(TriggerKey triggerKey) { @@ -1905,7 +1896,7 @@ public void PauseTrigger(TriggerKey triggerKey) } ///with the given name. + /// Pause the with the given name. /// - /// Pause the public virtual void PauseTrigger(ConnectionAndTransactionHolder conn, TriggerKey triggerKey) { @@ -1932,9 +1923,9 @@ public virtual void PauseTrigger(ConnectionAndTransactionHolder conn, TriggerKey ///with the given name. + /// Pause the with the given name. /// /// Pause the - ///with the given name - by - /// pausing all of its current s. + /// pausing all of its current s. /// + /// public virtual void PauseJob(JobKey jobKey) { ExecuteInLock(LockTriggerAccess, @@ -1950,7 +1941,7 @@ public virtual void PauseJob(JobKey jobKey) /// /// Pause all of the ///s in the given - /// group - by pausing all of their s. + /// group - by pausing all of their s. /// public virtual void PauseJobGroup(string groupName) @@ -2013,12 +2004,12 @@ public virtual void ResumeTrigger(TriggerKey triggerKey) } /// - /// Resume (un-pause) the ///with the + /// Resume (un-pause) the with the /// given name. /// - /// If the public virtual void ResumeTrigger(ConnectionAndTransactionHolder conn, TriggerKey triggerKey) { @@ -2070,11 +2061,11 @@ public virtual void ResumeTrigger(ConnectionAndTransactionHolder conn, TriggerKe /// given name. /// ///missed one or more fire-times, then the - /// 's misfire instruction will be applied. + /// If the missed one or more fire-times, then the + /// 's misfire instruction will be applied. /// - /// If any of the - ///'s s missed one - /// or more fire-times, then the 's misfire + /// If any of the 's s missed one + /// or more fire-times, then the 's misfire /// instruction will be applied. /// + /// public virtual void ResumeJob(JobKey jobKey) { ExecuteInLock(LockTriggerAccess, conn => @@ -2092,8 +2083,8 @@ public virtual void ResumeJob(JobKey jobKey) /// the given group. /// /// - /// If any of the ///s had s that - /// missed one or more fire-times, then the 's + /// If any of the s had s that + /// missed one or more fire-times, then the 's /// misfire instruction will be applied. /// @@ -2115,7 +2106,7 @@ public virtual void ResumeJobGroup(string groupName) } /// - /// Pause all of the ///s in the given group. + /// Pause all of the s in the given group. /// public virtual void PauseTriggerGroup(string groupName) @@ -2124,7 +2115,7 @@ public virtual void PauseTriggerGroup(string groupName) } /// - /// Pause all of the public virtual void PauseTriggerGroup(ConnectionAndTransactionHolder conn, string groupName) { @@ -2156,7 +2147,7 @@ public Collection.ISets in the given group. + /// Pause all of the s in the given group. /// GetPausedTriggerGroups() } /// - /// Pause all of the public virtual Collection.ISets in the + /// Pause all of the s in the /// given group. /// GetPausedTriggerGroups(ConnectionAndTransactionHolder conn) @@ -2178,11 +2169,11 @@ public virtual void ResumeTriggerGroup(string groupName) } /// - /// Resume (un-pause) all of the public virtual void ResumeTriggerGroup(ConnectionAndTransactionHolder conn, @@ -2281,8 +2272,8 @@ public virtual void PauseAll(ConnectionAndTransactionHolder conn) /// on every group. /// ///s + /// Resume (un-pause) all of the s /// in the given group. /// - /// If any
///missed one or more fire-times, then the - /// 's misfire instruction will be applied. + /// If any missed one or more fire-times, then the + /// 's misfire instruction will be applied. /// - /// If any ///missed one or more fire-times, then the - /// 's misfire instruction will be applied. + /// If any missed one or more fire-times, then the + /// 's misfire instruction will be applied. /// public virtual void ResumeAll() @@ -2294,8 +2285,8 @@ public virtual void ResumeAll() /// Resume (un-pause) all triggers - equivalent of calling /// on every group. /// - /// If any
/// ///missed one or more fire-times, then the - /// 's misfire instruction will be applied. + /// If any missed one or more fire-times, then the + /// 's misfire instruction will be applied. /// @@ -2325,7 +2316,7 @@ public virtual void ResumeAll(ConnectionAndTransactionHolder conn) /// Get a handle to the next N triggers to be fired, and mark them as 'reserved' /// by the calling scheduler. /// - /// + /// public virtual IList AcquireNextTriggers(DateTimeOffset noLaterThan, int maxCount, TimeSpan timeWindow) { if (AcquireTriggersWithinLock) @@ -2409,7 +2400,7 @@ protected virtual IList AcquireNextTrigger(ConnectionAndTransa /// /// Inform the public void ReleaseAcquiredTrigger(IOperableTrigger trigger) @@ -2521,7 +2512,7 @@ protected virtual TriggerFiredBundle TriggerFired(ConnectionAndTransactionHolder throw new JobPersistenceException("Couldn't insert fired trigger: " + e.Message, e); } - DateTimeOffset? prevFireTime = trigger.PreviousFireTimeUtc; + DateTimeOffset? prevFireTime = trigger.GetPreviousFireTimeUtc(); // call triggered - to update the trigger's next-fire-time state... trigger.Triggered(cal); @@ -2561,7 +2552,7 @@ protected virtual TriggerFiredBundle TriggerFired(ConnectionAndTransactionHolder cal, trigger.Key.Group.Equals(SchedulerConstants.DefaultRecoveryGroup), SystemTime.UtcNow(), - trigger.PreviousFireTimeUtc, + trigger.GetPreviousFireTimeUtc(), prevFireTime, trigger.GetNextFireTimeUtc()); } @@ -2569,9 +2560,9 @@ protected virtual TriggerFiredBundle TriggerFired(ConnectionAndTransactionHolder ///that the scheduler no longer plans to - /// fire the given , that it had previously acquired + /// fire the given , that it had previously acquired /// (reserved). /// /// Inform the public virtual void TriggeredJobComplete(IOperableTrigger trigger, IJobDetail jobDetail, @@ -3227,7 +3218,7 @@ protected virtual void CommitConnection(ConnectionAndTransactionHolder cth, bool ///that the scheduler has completed the - /// firing of the given (and the execution its + /// firing of the given (and the execution its /// associated ), and that the - /// in the given should be updated if the + /// in the given should be updated if the /// is stateful. /// /// This method just forwards to ExecuteInLock() with a null lockName. /// - ///+ /// protected object ExecuteWithoutLock(Func txCallback) { return ExecuteInLock(null, txCallback); @@ -3245,7 +3236,7 @@ protected object ExecuteWithoutLock(Func /// "TRIGGER_ACCESS". If null, then no lock is acquired, but the /// lockCallback is still executed in a transaction. /// - /// + /// protected void ExecuteInLock(string lockName, Action txCallback) { ExecuteInLock(lockName, conn => { txCallback(conn); return null; }); @@ -3274,7 +3265,7 @@ protected void ExecuteInLock(string lockName, Action - /// + /// protected void ExecuteInNonManagedTXLock(string lockName, Action txCallback) { ExecuteInNonManagedTXLock(lockName, conn => { txCallback(conn); return null; }); @@ -3544,9 +3535,9 @@ public class RecoverMisfiredJobsResult { public static readonly RecoverMisfiredJobsResult NoOp = new RecoverMisfiredJobsResult(false, 0, DateTimeOffset.MaxValue); - private readonly bool _hasMoreMisfiredTriggers; - private readonly int _processedMisfiredTriggerCount; - private readonly DateTimeOffset _earliestNewTimeUtc; + private readonly bool hasMoreMisfiredTriggers; + private readonly int processedMisfiredTriggerCount; + private readonly DateTimeOffset earliestNewTimeUtc; /// /// Initializes a new instance of the /// The DB Connection. - /// The name of the job. - /// The group containing the job. - ///class. @@ -3556,9 +3547,9 @@ public class RecoverMisfiredJobsResult /// public RecoverMisfiredJobsResult(bool hasMoreMisfiredTriggers, int processedMisfiredTriggerCount, DateTimeOffset earliestNewTimeUtc) { - _hasMoreMisfiredTriggers = hasMoreMisfiredTriggers; - _processedMisfiredTriggerCount = processedMisfiredTriggerCount; - _earliestNewTimeUtc = earliestNewTimeUtc; + this.hasMoreMisfiredTriggers = hasMoreMisfiredTriggers; + this.processedMisfiredTriggerCount = processedMisfiredTriggerCount; + this.earliestNewTimeUtc = earliestNewTimeUtc; } /// @@ -3569,7 +3560,7 @@ public RecoverMisfiredJobsResult(bool hasMoreMisfiredTriggers, int processedMisf /// public bool HasMoreMisfiredTriggers { - get { return _hasMoreMisfiredTriggers; } + get { return hasMoreMisfiredTriggers; } } /// /// The DB Connection /// The state the triggers must be in - ///@@ -3578,12 +3569,12 @@ public bool HasMoreMisfiredTriggers /// /// /// The name of the lock to aquire, for example "TRIGGER_ACCESS". @@ -67,7 +67,7 @@ protected override ConnectionAndTransactionHolder GetNonManagedTXConnection() /// /// Callback to execute. ///The processed misfired trigger count. public int ProcessedMisfiredTriggerCount { - get { return _processedMisfiredTriggerCount; } + get { return processedMisfiredTriggerCount; } } public DateTimeOffset EarliestNewTime { - get { return _earliestNewTimeUtc; } + get { return earliestNewTimeUtc; } } } } diff --git a/src/Quartz/Impl/AdoJobStore/JobStoreTX.cs b/src/Quartz/Impl/AdoJobStore/JobStoreTX.cs index a7996a957..46a7d13e3 100644 --- a/src/Quartz/Impl/AdoJobStore/JobStoreTX.cs +++ b/src/Quartz/Impl/AdoJobStore/JobStoreTX.cs @@ -58,7 +58,7 @@ protected override ConnectionAndTransactionHolder GetNonManagedTXConnection() /// Execute the given callback having optionally aquired the given lock. /// For, because it manages its own transactions /// and only has the one datasource, this is the same behavior as - /// . + /// . /// - /// + /// /// /// /// diff --git a/src/Quartz/Impl/AdoJobStore/PostgreSQLDelegate.cs b/src/Quartz/Impl/AdoJobStore/PostgreSQLDelegate.cs index dc7745437..319181203 100644 --- a/src/Quartz/Impl/AdoJobStore/PostgreSQLDelegate.cs +++ b/src/Quartz/Impl/AdoJobStore/PostgreSQLDelegate.cs @@ -35,7 +35,7 @@ public class PostgreSQLDelegate : StdAdoDelegate /// /// Initializes a new instance of the - /// The log. + /// The logger. /// The table prefix. /// The instance id. /// The db provider. @@ -47,7 +47,7 @@ public PostgreSQLDelegate(ILog logger, string tablePrefix, string schedName, str ///class. /// /// Initializes a new instance of the - /// The log. + /// The logger. /// The table prefix. /// The instance id. /// The db provider. diff --git a/src/Quartz/Impl/AdoJobStore/SimplePropertiesTriggerPersistenceDelegateSupport.cs b/src/Quartz/Impl/AdoJobStore/SimplePropertiesTriggerPersistenceDelegateSupport.cs index 2e99fd638..c2f80596f 100644 --- a/src/Quartz/Impl/AdoJobStore/SimplePropertiesTriggerPersistenceDelegateSupport.cs +++ b/src/Quartz/Impl/AdoJobStore/SimplePropertiesTriggerPersistenceDelegateSupport.cs @@ -27,18 +27,17 @@ namespace Quartz.Impl.AdoJobStore { -/** - * A base implementation of {@link TriggerPersistenceDelegate} that persists - * trigger fields in the "QRTZ_SIMPROP_TRIGGERS" table. This allows extending - * concrete classes to simply implement a couple methods that do the work of - * getting/setting the trigger's fields, and creating the {@link ScheduleBuilder} - * for the particular type of trigger. - * - * @see CalendarIntervalTriggerPersistenceDelegate for an example extension - * - * @author jhouse - */ - + ///class. /// + /// A base implementation of {@link TriggerPersistenceDelegate} that persists + /// trigger fields in the "QRTZ_SIMPROP_TRIGGERS" table. This allows extending + /// concrete classes to simply implement a couple methods that do the work of + /// getting/setting the trigger's fields, and creating the {@link ScheduleBuilder} + /// for the particular type of trigger. + /// + ///+ /// + ///+ /// jhouse public abstract class SimplePropertiesTriggerPersistenceDelegateSupport : ITriggerPersistenceDelegate { protected const string TableSimplePropertiesTriggers = "SIMPROP_TRIGGERS"; @@ -55,18 +54,18 @@ public abstract class SimplePropertiesTriggerPersistenceDelegateSupport : ITrigg protected const string ColumnBoolProp1 = "BOOL_PROP_1"; protected const string ColumnBoolProp2 = "BOOL_PROP_2"; -protected static readonly string SELECT_SIMPLE_PROPS_TRIGGER = "SELECT *" + " FROM " - + StdAdoConstants.TablePrefixSubst + TABLE_SIMPLE_PROPERTIES_TRIGGERS + " WHERE " +protected static readonly string SelectSimplePropsTrigger = "SELECT *" + " FROM " + + StdAdoConstants.TablePrefixSubst + TableSimplePropertiesTriggers + " WHERE " + AdoConstants.ColumnSchedulerName + " = " + StdAdoConstants.SchedulerNameSubst + " AND " + AdoConstants.ColumnTriggerName + " = ? AND " + AdoConstants.ColumnTriggerGroup + " = ?"; - protected static readonly string DELETE_SIMPLE_PROPS_TRIGGER = "DELETE FROM " - + StdAdoConstants.TablePrefixSubst + TABLE_SIMPLE_PROPERTIES_TRIGGERS + " WHERE " + protected static readonly string DeleteSimplePropsTrigger = "DELETE FROM " + + StdAdoConstants.TablePrefixSubst + TableSimplePropertiesTriggers + " WHERE " + AdoConstants.ColumnSchedulerName + " = " + StdAdoConstants.SchedulerNameSubst + " AND " + AdoConstants.ColumnTriggerName + " = ? AND " + AdoConstants.ColumnTriggerGroup + " = ?"; - protected static readonly string INSERT_SIMPLE_PROPS_TRIGGER = "INSERT INTO " - + StdAdoConstants.TablePrefixSubst + TABLE_SIMPLE_PROPERTIES_TRIGGERS + " (" + protected static readonly string InsertSimplePropsTrigger = "INSERT INTO " + + StdAdoConstants.TablePrefixSubst + TableSimplePropertiesTriggers + " (" + AdoConstants.ColumnSchedulerName + ", " + AdoConstants.ColumnTriggerName + ", " + AdoConstants.ColumnTriggerGroup + ", " + ColumnStrProp1 + ", " + ColumnStrProp2 + ", " + ColumnStrProp3 + ", " @@ -76,8 +75,8 @@ public abstract class SimplePropertiesTriggerPersistenceDelegateSupport : ITrigg + ColumnBoolProp1 + ", " + ColumnBoolProp2 + ") " + " VALUES(" + StdAdoConstants.SchedulerNameSubst + ", ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"; - protected static readonly string UPDATE_SIMPLE_PROPS_TRIGGER = "UPDATE " - + StdAdoConstants.TablePrefixSubst + TABLE_SIMPLE_PROPERTIES_TRIGGERS + " SET " + protected static readonly string UpdateSimplePropsTrigger = "UPDATE " + + StdAdoConstants.TablePrefixSubst + TableSimplePropertiesTriggers + " SET " + ColumnStrProp1 + " = ?, " + ColumnStrProp2 + " = ?, " + ColumnStrProp3 + " = ?, " + ColumnIntProp1 + " = ?, " + ColumnIntProp2 + " = ?, " + ColumnLongProp1 + " = ?, " + ColumnLongProp2 + " = ?, " @@ -94,7 +93,7 @@ public abstract class SimplePropertiesTriggerPersistenceDelegateSupport : ITrigg public void Initialize(string tablePrefix, string schedName, AdoUtil adoUtil) { this.tablePrefix = tablePrefix; - this.schedNameLiteral = "'" + schedName + "'"; + schedNameLiteral = "'" + schedName + "'"; this.adoUtil = adoUtil; } @@ -107,7 +106,7 @@ public void Initialize(string tablePrefix, string schedName, AdoUtil adoUtil) public int DeleteExtendedTriggerProperties(ConnectionAndTransactionHolder conn, TriggerKey triggerKey) { - using (IDbCommand cmd = adoUtil.PrepareCommand(AdoJobStoreUtil.ReplaceTablePrefix(StdAdoConstants.SqlDeleteSimplePropsTrigger, tablePrefix, schedNameLiteral))) + using (IDbCommand cmd = adoUtil.PrepareCommand(conn, AdoJobStoreUtil.ReplaceTablePrefix(DeleteSimplePropsTrigger, tablePrefix, schedNameLiteral))) { adoUtil.AddCommandParameter(cmd, "triggerName", triggerKey.Name); adoUtil.AddCommandParameter(cmd, "triggerGroup", triggerKey.Group); @@ -120,7 +119,7 @@ public int InsertExtendedTriggerProperties(ConnectionAndTransactionHolder conn, { SimplePropertiesTriggerProperties properties = GetTriggerProperties(trigger); - using (IDbCommand cmd = adoUtil.PrepareCommand(AdoJobStoreUtil.ReplaceTablePrefix(StdAdoConstants.SqlInsertSimplePropsTrigger, tablePrefix, schedNameLiteral))) + using (IDbCommand cmd = adoUtil.PrepareCommand(conn, AdoJobStoreUtil.ReplaceTablePrefix(InsertSimplePropsTrigger, tablePrefix, schedNameLiteral))) { adoUtil.AddCommandParameter(cmd, "triggerName", trigger.Key.Name); adoUtil.AddCommandParameter(cmd, "triggerGroup", trigger.Key.Group); @@ -143,7 +142,7 @@ public int InsertExtendedTriggerProperties(ConnectionAndTransactionHolder conn, public TriggerPropertyBundle LoadExtendedTriggerProperties(ConnectionAndTransactionHolder conn, TriggerKey triggerKey) { - using (IDbCommand cmd = adoUtil.PrepareCommand(AdoJobStoreUtil.ReplaceTablePrefix(StdAdoConstants.SqlSelectSimplePropsTrigger, tablePrefix, schedNameLiteral))) + using (IDbCommand cmd = adoUtil.PrepareCommand(conn, AdoJobStoreUtil.ReplaceTablePrefix(SelectSimplePropsTrigger, tablePrefix, schedNameLiteral))) { adoUtil.AddCommandParameter(cmd, "@", triggerKey.Name); adoUtil.AddCommandParameter(cmd, "@", triggerKey.Group); @@ -176,7 +175,7 @@ public int UpdateExtendedTriggerProperties(ConnectionAndTransactionHolder conn, { SimplePropertiesTriggerProperties properties = GetTriggerProperties(trigger); - using (IDbCommand cmd = adoUtil.PrepareCommand(AdoJobStoreUtil.ReplaceTablePrefix(StdAdoConstants.SqUpdateSimplePropsTrigger, tablePrefix, schedNameLiteral))) + using (IDbCommand cmd = adoUtil.PrepareCommand(conn, AdoJobStoreUtil.ReplaceTablePrefix(UpdateSimplePropsTrigger, tablePrefix, schedNameLiteral))) { adoUtil.AddCommandParameter(cmd, "string1", properties.String1); adoUtil.AddCommandParameter(cmd, "string1", properties.String2); diff --git a/src/Quartz/Impl/AdoJobStore/SimpleTriggerPersistenceDelegate.cs b/src/Quartz/Impl/AdoJobStore/SimpleTriggerPersistenceDelegate.cs index 6650d612c..54184ac13 100644 --- a/src/Quartz/Impl/AdoJobStore/SimpleTriggerPersistenceDelegate.cs +++ b/src/Quartz/Impl/AdoJobStore/SimpleTriggerPersistenceDelegate.cs @@ -91,7 +91,7 @@ public TriggerPropertyBundle LoadExtendedTriggerProperties(ConnectionAndTransact long repeatInterval = rs.GetInt64(AdoConstants.ColumnRepeatInterval); int timesTriggered = rs.GetInt32(AdoConstants.ColumnTimesTriggered); - SimpleScheduleBuilder sb = SimpleScheduleBuilder.SimpleSchedule() + SimpleScheduleBuilder sb = SimpleScheduleBuilder.Create() .WithRepeatCount(repeatCount) .WithInterval(TimeSpan.FromMilliseconds(repeatInterval)); diff --git a/src/Quartz/Impl/AdoJobStore/StdAdoDelegate.cs b/src/Quartz/Impl/AdoJobStore/StdAdoDelegate.cs index d5571ec18..d6b9ad3a8 100644 --- a/src/Quartz/Impl/AdoJobStore/StdAdoDelegate.cs +++ b/src/Quartz/Impl/AdoJobStore/StdAdoDelegate.cs @@ -98,13 +98,10 @@ public StdAdoDelegate(ILog logger, string tablePrefix, string schedName, string } - /** - * initStrings are of the format: - * - * settingName=settingValue|otherSettingName=otherSettingValue|... - * @throws NoSuchDelegateException - */ - + ///+ /// initStrings are of the format: + /// settingName=settingValue|otherSettingName=otherSettingValue|... + /// public void Initialize(string initString) { if (initString == null) @@ -249,7 +246,7 @@ public virtual IListSelectMisfiredTriggers(ConnectionAndTransaction /// an array of trigger + ///s an array of trigger public virtual ILists SelectTriggersInState(ConnectionAndTransactionHolder conn, string state) { using (IDbCommand cmd = PrepareCommand(conn, ReplaceTablePrefix(SqlSelectTriggersInState))) @@ -374,7 +371,7 @@ public int CountMisfiredTriggersInState(ConnectionAndTransactionHolder conn, str /// Name of the group. /// The state. /// The timestamp. - /// an array of + ///objects an array of public virtual IListobjects SelectMisfiredTriggersInGroupInState(ConnectionAndTransactionHolder conn, string groupName, string state, long ts) { using (IDbCommand cmd = PrepareCommand(conn, ReplaceTablePrefix(SqlSelectMisfiredTriggersInGroupInState)) @@ -406,12 +403,12 @@ public virtual IList SelectMisfiredTriggersInGroupInState(Connection /// /// In order to preserve the ordering of the triggers, the fire time will be /// set from the ColumnFiredTime column in the TableFiredTriggers - /// table. The caller is responsible for calling /// The DB Connection - ///+ /// table. The caller is responsible for calling /// on each returned trigger. It is also up to the caller to insert the /// returned triggers to ensure that they are fired. /// an array of + ///objects an array of public virtual IListobjects SelectTriggersForRecoveringJobs(ConnectionAndTransactionHolder conn) { List list = new List (); @@ -488,15 +485,14 @@ public virtual int DeleteFiredTriggers(ConnectionAndTransactionHolder conn, stri } } - - - /** - * Clear (delete!) all scheduling data - all {@link Job}s, {@link Trigger}s - * {@link Calendar}s. - * - * @throws JobPersistenceException - */ + + /// + /// Clear (delete!) all scheduling data - all {@link Job}s, {@link Trigger}s + /// {@link Calendar}s. + /// + ///+ /// public void ClearData(ConnectionAndTransactionHolder conn) { IDbCommand ps = null; @@ -608,9 +604,8 @@ public virtual int UpdateJobDetail(ConnectionAndTransactionHolder conn, IJobDeta /// Get the names of all of the triggers associated with the given job. ///An array of + /// The key identifying the job. + ///objects An array of public virtual IListobjects SelectTriggerNamesForJob(ConnectionAndTransactionHolder conn, JobKey jobKey) { using (IDbCommand cmd = PrepareCommand(conn, ReplaceTablePrefix(SqlSelectTriggersForJob))) @@ -635,8 +630,7 @@ public virtual IList SelectTriggerNamesForJob(ConnectionAndTransacti /// Delete the job detail record for the given job. /// /// the DB Connection - /// the name of the job - /// the group containing the job + /// The key identifying the job. /// the number of rows deleted public virtual int DeleteJobDetail(ConnectionAndTransactionHolder conn, JobKey jobKey) { @@ -656,8 +650,7 @@ public virtual int DeleteJobDetail(ConnectionAndTransactionHolder conn, JobKey j /// Check whether or not the given job is stateful. /// /// the DB Connection - /// the name of the job - /// the group containing the job + /// The key identifying the job. ////// true if the job exists and is stateful, false otherwise /// @@ -682,8 +675,7 @@ public virtual bool IsJobStateful(ConnectionAndTransactionHolder conn, JobKey jo /// Check whether or not the given job exists. /// /// the DB Connection - /// the name of the job - /// the group containing the job + /// The key identifying the job. ///true if the job exists, false otherwise public virtual bool JobExists(ConnectionAndTransactionHolder conn, JobKey jobKey) { @@ -727,12 +719,10 @@ public virtual int UpdateJobData(ConnectionAndTransactionHolder conn, IJobDetail /// Select the JobDetail object for a given job name / group name. /// /// The DB Connection. - /// The job name whose listeners are wanted. - /// The group containing the job. + /// The key identifying the job. /// The load helper. ///The populated JobDetail object. - public virtual JobDetailImpl SelectJobDetail(ConnectionAndTransactionHolder conn, JobKey jobKey, - ITypeLoadHelper loadHelper) + public virtual JobDetailImpl SelectJobDetail(ConnectionAndTransactionHolder conn, JobKey jobKey, ITypeLoadHelper loadHelper) { using (IDbCommand cmd = PrepareCommand(conn, ReplaceTablePrefix(SqlSelectJobDetail))) { @@ -885,9 +875,9 @@ public virtual int InsertTrigger(ConnectionAndTransactionHolder conn, IOperableT AddCommandParameter(cmd, "triggerNextFireTime", null); } long prevFireTime = -1; - if (trigger.PreviousFireTimeUtc.HasValue) + if (trigger.GetPreviousFireTimeUtc().HasValue) { - prevFireTime = trigger.PreviousFireTimeUtc.Value.Ticks; + prevFireTime = trigger.GetPreviousFireTimeUtc().Value.Ticks; } AddCommandParameter(cmd, "triggerPreviousFireTime", Convert.ToDecimal(prevFireTime)); AddCommandParameter(cmd, "triggerState", state); @@ -991,7 +981,6 @@ public virtual int UpdateTrigger(ConnectionAndTransactionHolder conn, IOperableT AddCommandParameter(cmd, "triggerJobName", trigger.JobKey.Name); AddCommandParameter(cmd, "triggerJobGroup", trigger.JobKey.Group); - AddCommandParameter(cmd, "triggerVolatile", GetDbBooleanValue(trigger.ConcurrentExectionDisallowed)); AddCommandParameter(cmd, "triggerDescription", trigger.Description); long nextFireTime = -1; @@ -1002,9 +991,9 @@ public virtual int UpdateTrigger(ConnectionAndTransactionHolder conn, IOperableT AddCommandParameter(cmd, "triggerNextFireTime", Convert.ToDecimal(nextFireTime)); long prevFireTime = -1; - if (trigger.PreviousFireTimeUtc.HasValue) + if (trigger.GetPreviousFireTimeUtc().HasValue) { - prevFireTime = trigger.PreviousFireTimeUtc.Value.Ticks; + prevFireTime = trigger.GetPreviousFireTimeUtc().Value.Ticks; } AddCommandParameter(cmd, "triggerPreviousFireTime", Convert.ToDecimal(prevFireTime)); AddCommandParameter(cmd, "triggerState", state); @@ -1089,8 +1078,7 @@ public virtual int UpdateBlobTrigger(ConnectionAndTransactionHolder conn, IOpera /// Check whether or not a trigger exists. /// /// The DB Connection. - /// The name of the trigger. - /// The group containing the trigger. + /// the key of the trigger ///true if the trigger exists, false otherwise public virtual bool TriggerExists(ConnectionAndTransactionHolder conn, TriggerKey triggerKey) { @@ -1117,8 +1105,7 @@ public virtual bool TriggerExists(ConnectionAndTransactionHolder conn, TriggerKe /// Update the state for a given trigger. /// /// The DB Connection. - /// The name of the trigger. - /// The group containing the trigger. + /// the key of the trigger /// The new state for the trigger. ///The number of rows updated. public virtual int UpdateTriggerState(ConnectionAndTransactionHolder conn, TriggerKey triggerKey, string state) @@ -1138,8 +1125,7 @@ public virtual int UpdateTriggerState(ConnectionAndTransactionHolder conn, Trigg /// given old states. /// /// The DB connection. - /// The name of the trigger. - /// The group containing the trigger. + /// the key of the trigger /// The new state for the trigger. /// One of the old state the trigger must be in. /// One of the old state the trigger must be in. @@ -1194,8 +1180,7 @@ public virtual int UpdateTriggerGroupStateFromOtherStates(ConnectionAndTransacti /// old state. /// /// the DB connection - /// the name of the trigger - /// the group containing the trigger + /// the key of the trigger /// the new state for the trigger /// the old state the trigger must be in ///int the number of rows updated @@ -1240,8 +1225,7 @@ public virtual int UpdateTriggerGroupStateFromOtherState(ConnectionAndTransactio /// Update the states of all triggers associated with the given job. /// /// the DB Connection - /// the name of the job - /// the group containing the job + /// the key of the job /// the new state for the triggers ///the number of rows updated public virtual int UpdateTriggerStatesForJob(ConnectionAndTransactionHolder conn, JobKey jobKey, string state) @@ -1261,16 +1245,14 @@ public virtual int UpdateTriggerStatesForJob(ConnectionAndTransactionHolder conn /// Updates the state of the trigger states for job from other. /// /// The conn. - /// Name of the job. - /// Name of the group. + /// Key of the job. /// The state. /// The old state. ///public virtual int UpdateTriggerStatesForJobFromOtherState(ConnectionAndTransactionHolder conn, JobKey jobKey, string state, string oldState) { - using (IDbCommand cmd = PrepareCommand(conn, ReplaceTablePrefix(SqlUpdateJobTriggerStatesFromOtherState)) - ) + using (IDbCommand cmd = PrepareCommand(conn, ReplaceTablePrefix(SqlUpdateJobTriggerStatesFromOtherState))) { AddCommandParameter(cmd, "state", state); AddCommandParameter(cmd, "jobName", jobKey.Name); @@ -1285,8 +1267,7 @@ public virtual int UpdateTriggerStatesForJobFromOtherState(ConnectionAndTransact /// Delete the cron trigger data for a trigger. /// /// the DB Connection - /// the name of the trigger - /// the group containing the trigger + /// the key of the trigger /// the number of rows deleted public virtual int DeleteBlobTrigger(ConnectionAndTransactionHolder conn, TriggerKey triggerKey) { @@ -1303,8 +1284,7 @@ public virtual int DeleteBlobTrigger(ConnectionAndTransactionHolder conn, Trigge /// Delete the base trigger data for a trigger. /// /// the DB Connection - /// the name of the trigger - /// the group containing the trigger + /// the key of the trigger ///the number of rows deleted public virtual int DeleteTrigger(ConnectionAndTransactionHolder conn, TriggerKey triggerKey) { @@ -1332,8 +1312,7 @@ protected void deleteTriggerExtension(ConnectionAndTransactionHolder conn, Trigg /// Select the number of triggers associated with a given job. /// /// the DB Connection - /// the name of the job - /// the group containing the job + /// the key of the job ///the number of triggers for the given job public virtual int SelectNumTriggersForJob(ConnectionAndTransactionHolder conn, JobKey jobKey) { @@ -1360,10 +1339,9 @@ public virtual int SelectNumTriggersForJob(ConnectionAndTransactionHolder conn, /// Select the job to which the trigger is associated. /// /// the DB Connection - /// the name of the trigger - /// the group containing the trigger + /// the key of the trigger /// The load helper. - ///The + ///object associated with the given trigger The public virtual JobDetailImpl SelectJobForTrigger(ConnectionAndTransactionHolder conn, TriggerKey triggerKey, ITypeLoadHelper loadHelper) { @@ -1400,10 +1378,9 @@ public virtual JobDetailImpl SelectJobForTrigger(ConnectionAndTransactionHolder /// Select the triggers for a job /// /// the DB Connection - /// the name of the trigger - /// the group containing the trigger + /// the key of the job ///object associated with the given trigger - /// an array of public virtual IListobjects + /// an array of objects /// associated with a given job. /// SelectTriggersForJob(ConnectionAndTransactionHolder conn, JobKey jobKey) @@ -1438,7 +1415,7 @@ public virtual IList SelectTriggersForJob(ConnectionAndTransac /// The DB Connection. /// Name of the calendar. /// - /// An array of public virtual IListobjects associated with a given job. + /// An array of objects associated with a given job. /// SelectTriggersForCalendar(ConnectionAndTransactionHolder conn, string calName) { @@ -1459,12 +1436,12 @@ public virtual IList SelectTriggersForCalendar(ConnectionAndTr return trigList; } + /// /// Select a trigger. /// /// the DB Connection - /// the name of the trigger - /// the group containing the trigger - ///The + /// the key of the trigger + ///object The public virtual IOperableTrigger SelectTrigger(ConnectionAndTransactionHolder conn, TriggerKey triggerKey) { IOperableTrigger trigger = null; @@ -1556,14 +1533,14 @@ public virtual IOperableTrigger SelectTrigger(ConnectionAndTransactionHolder con TriggerPropertyBundle triggerProps = tDel.LoadExtendedTriggerProperties(conn, triggerKey); - TriggerBuilder tb = TriggerBuilder.NewTrigger() + TriggerBuilderobject tb = TriggerBuilder .Create() .WithDescription(description) .WithPriority(priority) .StartAt(startTimeD) .EndAt(endTimeD) .WithIdentity(triggerKey) .ModifiedByCalendar(calendarName) - .WithSchedule(triggerProps.getScheduleBuilder()) + .WithSchedule(triggerProps.ScheduleBuilder) .ForJob(new JobKey(jobName, jobGroup)); if (null != map) @@ -1574,8 +1551,8 @@ public virtual IOperableTrigger SelectTrigger(ConnectionAndTransactionHolder con trigger = (IOperableTrigger) tb.Build(); trigger.MisfireInstruction = misFireInstr; - trigger.NextFireTimeUtc = nft; - trigger.PreviousFireTimeUtc = pft; + trigger.SetNextFireTimeUtc(nft); + trigger.SetPreviousFireTimeUtc(pft); setTriggerStateProperties(trigger, triggerProps); } @@ -1590,20 +1567,19 @@ public virtual IOperableTrigger SelectTrigger(ConnectionAndTransactionHolder con private void setTriggerStateProperties(IOperableTrigger trigger, TriggerPropertyBundle props) { - if (props.getStatePropertyNames() == null) + if (props.StatePropertyNames == null) { return; } - Util.setBeanProps(trigger, props.getStatePropertyNames(), props.getStatePropertyValues()); + ObjectUtils.SetObjectProperties(trigger, props.StatePropertyNames, props.StatePropertyValues); } /// /// Select a trigger's JobDataMap. /// /// the DB Connection - /// the name of the trigger - /// the group containing the trigger + /// the key of the trigger ///The public virtual JobDataMap SelectTriggerJobDataMap(ConnectionAndTransactionHolder conn, TriggerKey triggerKey) { @@ -1642,9 +1618,8 @@ public virtual JobDataMap SelectTriggerJobDataMap(ConnectionAndTransactionHolder /// Select a trigger's state value. /// /// the DB Connection - /// the name of the trigger - /// the group containing the trigger - ///of the Trigger, never null, but possibly empty. The + /// the key of the trigger + ///object The public virtual string SelectTriggerState(ConnectionAndTransactionHolder conn, TriggerKey triggerKey) { using (IDbCommand cmd = PrepareCommand(conn, ReplaceTablePrefix(SqlSelectTriggerState))) @@ -1672,8 +1647,7 @@ public virtual string SelectTriggerState(ConnectionAndTransactionHolder conn, Tr /// Select a trigger status (state and next fire time). /// /// the DB Connection - /// the name of the trigger - /// the group containing the trigger + /// the key of the trigger ///object /// a @@ -2075,7 +2049,7 @@ public virtual IListobject, or null /// SelectCalendars(ConnectionAndTransactionHolder conn /// the DB Connection /// the time that the trigger will be fired /// - /// a @@ -2103,8 +2077,8 @@ public virtual TriggerKey SelectTriggerForFireTime(ConnectionAndTransactionHolde /// in ascending order of fire time, and then descending by priority. /// /// The conn. - /// highest value ofrepresenting the + /// a representing the /// trigger that will be fired at the given fire time, or null if no /// trigger will be fired at that time /// of the triggers (exclusive) - /// highest value of of the triggers (inclusive) + /// highest value of of the triggers (exclusive) + /// highest value of of the triggers (inclusive) /// public virtual IList SelectTriggerToAcquire(ConnectionAndTransactionHolder conn, DateTimeOffset noLaterThan, DateTimeOffset noEarlierThan) { @@ -2187,20 +2161,20 @@ public virtual int InsertFiredTrigger(ConnectionAndTransactionHolder conn, IOper } } - /** - * - * Update a fired trigger. - *
- * - * @param conn - * the DB Connection - * @param trigger - * the trigger - * @param state - * the state that the trigger should be stored in - * @return the number of rows inserted - */ - + ///+ /// + ///+ /// Update a fired trigger. + ///
+ ///+ /// + /// + /// the DB Connection + /// + /// the trigger + /// + /// the state that the trigger should be stored in + ///the number of rows inserted public int UpdateFiredTrigger(ConnectionAndTransactionHolder conn, IOperableTrigger trigger, string state, IJobDetail job) { IDbCommand ps = PrepareCommand(conn, ReplaceTablePrefix(SqlUpdateFiredTrigger)); @@ -2418,8 +2392,7 @@ public virtual int DeleteFiredTrigger(ConnectionAndTransactionHolder conn, strin /// Selects the job execution count. /// /// The DB connection. - /// Name of the job. - /// The job group. + /// The key of the job. ///public virtual int SelectJobExecutionCount(ConnectionAndTransactionHolder conn, JobKey jobKey) { diff --git a/src/Quartz/Impl/AdoJobStore/StdRowLockSemaphore.cs b/src/Quartz/Impl/AdoJobStore/StdRowLockSemaphore.cs index 25f36b4eb..70c9b5d1d 100644 --- a/src/Quartz/Impl/AdoJobStore/StdRowLockSemaphore.cs +++ b/src/Quartz/Impl/AdoJobStore/StdRowLockSemaphore.cs @@ -55,10 +55,9 @@ public StdRowLockSemaphore(string tablePrefix, string schedName, string selectWi { } - /** - * Execute the SQL select for update that will lock the proper database row. - */ - + /// + /// Execute the SQL select for update that will lock the proper database row. + /// protected override void ExecuteSQL(ConnectionAndTransactionHolder conn, string lockName, string expandedSQL, string expandedInsertSQL) { try diff --git a/src/Quartz/Impl/Calendar/CronCalendar.cs b/src/Quartz/Impl/Calendar/CronCalendar.cs index 238334d31..3482d0979 100644 --- a/src/Quartz/Impl/Calendar/CronCalendar.cs +++ b/src/Quartz/Impl/Calendar/CronCalendar.cs @@ -33,7 +33,7 @@ namespace Quartz.Impl.Calendar /// It is important to remember that the cron expression here describes a set of /// times to be excluded from firing. Whereas the cron expression in /// CronTrigger describes a set of times that can - /// be included for firing. Thus, if ahas a + /// be included for firing. Thus, if a has a /// given cron expression and is associated with a with /// the same expression, the calendar will exclude all the times the /// trigger includes, and they will cancel each other out. diff --git a/src/Quartz/Impl/JobDetailImpl.cs b/src/Quartz/Impl/JobDetailImpl.cs index 47a65e994..dd56e234a 100644 --- a/src/Quartz/Impl/JobDetailImpl.cs +++ b/src/Quartz/Impl/JobDetailImpl.cs @@ -29,21 +29,21 @@ namespace Quartz.Impl /// /// /// Quartz does not store an actual instance of a ///type, but - /// instead allows you to define an instance of one, through the use of a . + /// instead allows you to define an instance of one, through the use of a . /// ///
///s have a name and group associated with them, which /// should uniquely identify them within a single . /// - ///
///s are the 'mechanism' by which s - /// are scheduled. Many s can point to the same , - /// but a single can only point to one . + /// s are the 'mechanism' by which s + /// are scheduled. Many s can point to the same , + /// but a single can only point to one . /// /// /// - /// + /// /// James House ///Marko Lahma (.NET) [Serializable] @@ -60,7 +60,7 @@ public class JobDetailImpl : IJobDetail [NonSerialized] private JobKey key; ///- /// Create a - ///with no specified name or group, and + /// Create a with no specified name or group, and /// the default settings of all the other properties. /// /// Note that the
///, and @@ -74,7 +74,7 @@ public JobDetailImpl() } /// - /// Create a @@ -86,7 +86,7 @@ public JobDetailImpl(string name, Type jobType) : this(name, null, jobType) } ///with the given name, default group, and + /// Create a with the given name, default group, and /// the default settings of all the other properties. /// If , Scheduler.DefaultGroup will be used. /// - /// Create a @@ -101,7 +101,7 @@ public JobDetailImpl(string name, string group, Type jobType) } ///with the given name, and group, and + /// Create a with the given name, and group, and /// the default settings of all the other properties. /// If , Scheduler.DefaultGroup will be used. /// - /// Create a /// The name. @@ -171,7 +171,7 @@ public virtual string Group } ///with the given name, and group, and + /// Create a with the given name, and group, and /// the given settings of all the other properties. /// - /// Returns the 'full name' of the public virtual string FullName @@ -266,7 +266,7 @@ public virtual JobDataMap JobDataMap /// If not explicitly set, the default value isin the format + /// Returns the 'full name' of the in the format /// "group.name". /// . /// + /// public virtual bool RequestsRecovery { set { shouldRecover = value; } @@ -275,7 +275,7 @@ public virtual bool RequestsRecovery /// /// Whether or not the should remain stored after it is - /// orphaned (no s point to it). + /// orphaned (no s point to it). /// /// If not explicitly set, the default value is
@@ -299,7 +299,7 @@ public bool PersistJobDataAfterExecution } ///. /// - /// Whether the associated Job class carries the public bool ConcurrentExectionDisallowed { @@ -307,7 +307,7 @@ public bool ConcurrentExectionDisallowed } ///attribute. + /// Whether the associated Job class carries the attribute. /// - /// Validates whether the properties of the public virtual void Validate() diff --git a/src/Quartz/Impl/JobExecutionContextImpl.cs b/src/Quartz/Impl/JobExecutionContextImpl.cs index 7c20df19a..92269cbd6 100644 --- a/src/Quartz/Impl/JobExecutionContextImpl.cs +++ b/src/Quartz/Impl/JobExecutionContextImpl.cs @@ -28,7 +28,7 @@ namespace Quartz ///are + /// Validates whether the properties of the are /// valid for submission into a . /// /// A context bundle containing handles to various environment information, that /// is given to a ///instance as it is - /// executed, and to a instance after the + /// executed, and to a instance after the /// execution completes. /// @@ -36,7 +36,7 @@ namespace Quartz /// The ///found on this object (via the /// method) serves as a convenience - /// it is a merge of the found on the - /// and the one found on the , with + /// and the one found on the , with /// the value in the latter overriding any same-named values in the former. /// It is thus considered a 'best practice' that the Execute code of a Job /// retrieve data from the JobDataMap found on this object NOTE: Do not @@ -59,7 +59,7 @@ namespace Quartz /// /// /// - /// + /// /// /// James House ///Marko Lahma (.NET) @@ -117,7 +117,7 @@ public virtual IScheduler Scheduler } ///- /// Get a handle to the public virtual ITrigger Trigger @@ -126,7 +126,7 @@ public virtual ITrigger Trigger } ///instance that fired the + /// Get a handle to the instance that fired the /// . /// - /// Get a handle to the public virtual ICalendar Calendar @@ -159,7 +159,7 @@ public virtual int RefireCount ///referenced by the + /// Get a handle to the referenced by the /// instance that fired the . /// /// The
found on this object serves as a convenience - /// it is a merge of the found on the - /// and the one found on the , with + /// and the one found on the , with /// the value in the latter overriding any same-named values in the former. /// It is thus considered a 'best practice' that the Execute code of a Job /// retrieve data from the JobDataMap found on this object. diff --git a/src/Quartz/Impl/Matchers/EverythingMatcher.cs b/src/Quartz/Impl/Matchers/EverythingMatcher.cs index 549f3ef69..c8033c297 100644 --- a/src/Quartz/Impl/Matchers/EverythingMatcher.cs +++ b/src/Quartz/Impl/Matchers/EverythingMatcher.cs @@ -23,12 +23,12 @@ namespace Quartz.Impl.Matchers { -/** - * Matches on the complete key being equal (both name and group). - * - * @author jhouse - */ - + /// + /// Matches on the complete key being equal (both name and group). + /// + ///+ /// + ///jhouse public class EverythingMatcher: IMatcher where T : Key { protected EverythingMatcher() diff --git a/src/Quartz/Impl/Matchers/GroupMatcher.cs b/src/Quartz/Impl/Matchers/GroupMatcher.cs index 3e378560e..e221b5e75 100644 --- a/src/Quartz/Impl/Matchers/GroupMatcher.cs +++ b/src/Quartz/Impl/Matchers/GroupMatcher.cs @@ -39,22 +39,22 @@ protected GroupMatcher(string compareTo, StringOperatorName compareWith) : base( public static GroupMatcher matchGroupEquals(string compareTo) { - return new GroupMatcher (compareTo, StringOperatorName.EQUALS); + return new GroupMatcher (compareTo, StringOperatorName.Equality); } public static GroupMatcher matchGroupStartsWith(string compareTo) { - return new GroupMatcher (compareTo, StringOperatorName.STARTS_WITH); + return new GroupMatcher (compareTo, StringOperatorName.StartsWith); } public static GroupMatcher matchGroupEndsWith(string compareTo) { - return new GroupMatcher (compareTo, StringOperatorName.ENDS_WITH); + return new GroupMatcher (compareTo, StringOperatorName.EndsWith); } public static GroupMatcher matchGroupContains(string compareTo) { - return new GroupMatcher (compareTo, StringOperatorName.CONTAINS); + return new GroupMatcher (compareTo, StringOperatorName.Contains); } protected override string getValue(T key) diff --git a/src/Quartz/Impl/Matchers/NameMatcher.cs b/src/Quartz/Impl/Matchers/NameMatcher.cs index dc3033a5f..eb2df8046 100644 --- a/src/Quartz/Impl/Matchers/NameMatcher.cs +++ b/src/Quartz/Impl/Matchers/NameMatcher.cs @@ -39,22 +39,22 @@ protected NameMatcher(string compareTo, StringOperatorName compareWith) : base(c public static NameMatcher matchNameEquals(string compareTo) { - return new NameMatcher (compareTo, StringOperatorName.EQUALS); + return new NameMatcher (compareTo, StringOperatorName.Equality); } public static NameMatcher matchNameStartsWith(string compareTo) { - return new NameMatcher (compareTo, StringOperatorName.STARTS_WITH); + return new NameMatcher (compareTo, StringOperatorName.StartsWith); } public static NameMatcher matchNameEndsWith(string compareTo) { - return new NameMatcher (compareTo, StringOperatorName.ENDS_WITH); + return new NameMatcher (compareTo, StringOperatorName.EndsWith); } public static NameMatcher matchNameContains(string compareTo) { - return new NameMatcher (compareTo, StringOperatorName.CONTAINS); + return new NameMatcher (compareTo, StringOperatorName.Contains); } protected override string getValue(T key) diff --git a/src/Quartz/Impl/Matchers/StringMatcher.cs b/src/Quartz/Impl/Matchers/StringMatcher.cs index 393d81b8e..8a87f9977 100644 --- a/src/Quartz/Impl/Matchers/StringMatcher.cs +++ b/src/Quartz/Impl/Matchers/StringMatcher.cs @@ -42,10 +42,6 @@ protected StringMatcher(string compareTo, StringOperatorName compareWith) { throw new ArgumentNullException("compareTo", "CompareTo value cannot be null!"); } - if (compareWith == null) - { - throw new ArgumentNullException("compareWith", "CompareWith operator cannot be null!"); - } this.compareTo = compareTo; this.compareWith = compareWith; @@ -57,13 +53,13 @@ public bool IsMatch(T key) { switch (compareWith) { - case StringOperatorName.EQUALS: + case StringOperatorName.Equality: return getValue(key).Equals(compareTo); - case StringOperatorName.STARTS_WITH: + case StringOperatorName.StartsWith: return getValue(key).StartsWith(compareTo); - case StringOperatorName.ENDS_WITH: + case StringOperatorName.EndsWith: return getValue(key).EndsWith(compareTo); - case StringOperatorName.CONTAINS: + case StringOperatorName.Contains: return getValue(key).Contains(compareTo); } @@ -75,10 +71,8 @@ public override int GetHashCode() { int prime = 31; int result = 1; - result = prime*result - + ((compareTo == null) ? 0 : compareTo.GetHashCode()); - result = prime*result - + ((compareWith == null) ? 0 : compareWith.GetHashCode()); + result = prime*result + ((compareTo == null) ? 0 : compareTo.GetHashCode()); + result = prime*result + compareWith.GetHashCode(); return result; } @@ -108,14 +102,7 @@ public override bool Equals(object obj) { return false; } - if (compareWith == null) - { - if (other.compareWith != null) - { - return false; - } - } - else if (!compareWith.Equals(other.compareWith)) + if (!compareWith.Equals(other.compareWith)) { return false; } diff --git a/src/Quartz/Impl/Matchers/StringOperatorName.cs b/src/Quartz/Impl/Matchers/StringOperatorName.cs index d534ce219..dd950880a 100644 --- a/src/Quartz/Impl/Matchers/StringOperatorName.cs +++ b/src/Quartz/Impl/Matchers/StringOperatorName.cs @@ -23,9 +23,9 @@ namespace Quartz.Impl.Matchers { public enum StringOperatorName { - EQUALS, - STARTS_WITH, - ENDS_WITH, - CONTAINS + Equality, + StartsWith, + EndsWith, + Contains } } \ No newline at end of file diff --git a/src/Quartz/Impl/RemoteScheduler.cs b/src/Quartz/Impl/RemoteScheduler.cs index 0e624367a..2d39c25ca 100644 --- a/src/Quartz/Impl/RemoteScheduler.cs +++ b/src/Quartz/Impl/RemoteScheduler.cs @@ -261,7 +261,7 @@ public virtual IList CalendarNames } /// - /// Get the names of all ///groups that are paused. + /// Get the names of all groups that are paused. /// public virtual Collection.ISet GetPausedTriggerGroups() diff --git a/src/Quartz/Impl/Triggers/AbstractTrigger.cs b/src/Quartz/Impl/Triggers/AbstractTrigger.cs index 1372ea3bb..bb668a37f 100644 --- a/src/Quartz/Impl/Triggers/AbstractTrigger.cs +++ b/src/Quartz/Impl/Triggers/AbstractTrigger.cs @@ -47,7 +47,6 @@ namespace Quartz.Impl.Triggers /// /// /// - /// /// /// /// James House @@ -227,7 +226,7 @@ public virtual string FullJobName get { return jobGroup + "." + jobName; } } - public abstract IScheduleBuilder GetScheduleBuilder() where T : ITrigger; + public abstract IScheduleBuilder GetScheduleBuilder(); /// /// Get or set the description given to the ///instance by @@ -292,8 +291,8 @@ public virtual JobDataMap JobDataMap /// /// - /// - /// + /// + /// public virtual int MisfireInstruction { get { return misfireInstruction; } @@ -308,27 +307,28 @@ public virtual int MisfireInstruction } } - /// - /// This method should not be used by the Quartz client. - /// - public virtual string FireInstanceId + ///- /// Usable by
- ///- /// implementations, in order to facilitate 'recognizing' instances of fired - /// s as their jobs complete execution. - /// + /// This method should not be used by the Quartz client. + /// + ///+ /// Usable by + public virtual string FireInstanceId { get { return fireInstanceId; } set { fireInstanceId = value; } } - public abstract DateTimeOffset? NextFireTimeUtc { set; } + public abstract void SetNextFireTimeUtc(DateTimeOffset? value); + public abstract void SetPreviousFireTimeUtc(DateTimeOffset? value); ///+ /// implementations, in order to facilitate 'recognizing' instances of fired + /// s as their jobs complete execution. + /// /// Returns the previous time at which the - public abstract DateTimeOffset? PreviousFireTimeUtc { set; get; } + public abstract DateTimeOffset? GetPreviousFireTimeUtc(); ///fired. /// If the trigger has not yet fired, will be returned. /// /// Gets and sets the date/time on which the trigger must stop firing. This @@ -467,7 +467,7 @@ protected AbstractTrigger(string name, string group, string jobName, string jobG /// If not explicitly set, the default value is 5. /// - /// + /// public virtual int Priority { get { return priority; } @@ -476,16 +476,14 @@ public virtual int Priority /// /// This method should not be used by the Quartz client. - /// + ///+ ///
/// Called when the has decided to 'fire' /// the trigger (Execute the associated ), in order to /// give the a chance to update itself for its next /// triggering (if any). - /// - /// + /// + ///public abstract void Triggered(ICalendar cal); @@ -583,7 +581,6 @@ public virtual SchedulerInstruction ExecutionComplete(IJobExecutionContext conte /// The value returned is not guaranteed to be valid until after the /// has been added to the scheduler. /// - /// /// public abstract DateTimeOffset? GetNextFireTimeUtc(); @@ -788,9 +785,9 @@ public virtual object Clone() } - public ITriggerBuilder GetTriggerBuilder () where T : ITrigger + protected TriggerBuilder GetTriggerBuilder () where T : ITrigger { - TriggerBuilder b = TriggerBuilder .NewTrigger() + TriggerBuilder b = TriggerBuilder .Create() .ForJob(JobKey) .ModifiedByCalendar(CalendarName) .UsingJobData(JobDataMap) @@ -799,8 +796,8 @@ public ITriggerBuilder GetTriggerBuilder () where T : ITrigger .WithIdentity(Key) .WithPriority(Priority) .StartAt(StartTimeUtc) - .WithSchedule(GetScheduleBuilder ()); - return (ITriggerBuilder ) b; + .WithSchedule(GetScheduleBuilder()); + return b; } } } diff --git a/src/Quartz/Impl/Triggers/CalendarIntervalTriggerImpl.cs b/src/Quartz/Impl/Triggers/CalendarIntervalTriggerImpl.cs index 9d2f9ded5..72017f2b5 100644 --- a/src/Quartz/Impl/Triggers/CalendarIntervalTriggerImpl.cs +++ b/src/Quartz/Impl/Triggers/CalendarIntervalTriggerImpl.cs @@ -19,6 +19,8 @@ using System; +using Quartz.Spi; + namespace Quartz.Impl.Triggers { /// @@ -46,8 +48,7 @@ namespace Quartz.Impl.Triggers /// - /// The name of the/// /// - /// - /// 1.2 + ///2.0 ///James House ///Marko Lahma (.NET) public class CalendarIntervalTriggerImpl : AbstractTrigger, ICalendarIntervalTrigger @@ -56,8 +57,8 @@ public class CalendarIntervalTriggerImpl : AbstractTrigger, ICalendarIntervalTri private DateTimeOffset startTime; private DateTimeOffset? endTime; - private DateTimeOffset? nextFireTime; - private DateTimeOffset? previousFireTime; + private DateTimeOffset? nextFireTimeUtc; + private DateTimeOffset? previousFireTimeUtc; private int repeatInterval; private IntervalUnit repeatIntervalUnit = IntervalUnit.Day; private int timesTriggered; @@ -83,7 +84,7 @@ public CalendarIntervalTriggerImpl(string name, IntervalUnit intervalUnit, int r } ///- /// Create a /// Name for the trigger instance. @@ -97,7 +98,7 @@ public CalendarIntervalTriggerImpl(string name, string group, IntervalUnit inter } ///that will occur immediately, and + /// Create a that will occur immediately, and /// repeat at the the given interval /// - /// Create a /// Name for the trigger instance. @@ -112,7 +113,7 @@ public CalendarIntervalTriggerImpl(string name, DateTimeOffset startTimeUtc, } ///that will occur at the given time, + /// Create a that will occur at the given time, /// and repeat at the the given interval until the given end time. /// - /// Create a /// Name for the trigger instance. @@ -132,7 +133,7 @@ public CalendarIntervalTriggerImpl(string name, string group, DateTimeOffset sta } ///that will occur at the given time, + /// Create a that will occur at the given time, /// and repeat at the the given interval until the given end time. /// - /// Create a /// Name for the trigger instance. @@ -194,7 +195,7 @@ public override bool HasMillisecondPrecision } ///that will occur at the given time, + /// Create a that will occur at the given time, /// and repeat at the the given interval until the given end time. /// - /// Get the time at which the public override DateTimeOffset? EndTimeUtc @@ -223,7 +224,7 @@ public IntervalUnit RepeatIntervalUnit ///should quit + /// Get the time at which the should quit /// repeating. /// - /// Get the the time interval that will be added to the @@ -250,6 +251,11 @@ public int TimesTriggered set { this.timesTriggered = value; } } + public TriggerBuilder's + /// Get the the time interval that will be added to the 's /// fire time (in the set repeat interval unit) in order to calculate the time of the /// next trigger repeat. /// GetTriggerBuilder() + { + throw new NotImplementedException(); + } + /// /// Validates the misfire instruction. @@ -272,7 +278,7 @@ protected override bool ValidateMisfireInstruction(int misfireInstruction) } /// @@ -330,21 +336,21 @@ public override void UpdateAfterMisfire(ICalendar cal) public override void Triggered(ICalendar calendar) { timesTriggered++; - previousFireTime = nextFireTime; - nextFireTime = GetFireTimeAfter(nextFireTime); + previousFireTimeUtc = nextFireTimeUtc; + nextFireTimeUtc = GetFireTimeAfter(nextFireTimeUtc); - while (nextFireTime != null && calendar != null - && !calendar.IsTimeIncluded(nextFireTime.Value)) + while (nextFireTimeUtc != null && calendar != null + && !calendar.IsTimeIncluded(nextFireTimeUtc.Value)) { - nextFireTime = GetFireTimeAfter(nextFireTime); + nextFireTimeUtc = GetFireTimeAfter(nextFireTimeUtc); - if (nextFireTime == null) + if (nextFireTimeUtc == null) break; //avoid infinite loop - if (nextFireTime.Value.Year > YearToGiveupSchedulingAt) + if (nextFireTimeUtc.Value.Year > YearToGiveupSchedulingAt) { - nextFireTime = null; + nextFireTimeUtc = null; } } } @@ -352,7 +358,7 @@ public override void Triggered(ICalendar calendar) ///- /// Updates the @@ -304,12 +310,12 @@ public override void UpdateAfterMisfire(ICalendar cal) { newFireTime = GetFireTimeAfter(newFireTime); } - NextFireTimeUtc = newFireTime; + SetNextFireTimeUtc(newFireTime); } else if (instr == Quartz.MisfireInstruction.CalendarIntervalTrigger.FireOnceNow) { // fire once now... - NextFireTimeUtc = SystemTime.UtcNow(); + SetNextFireTimeUtc(SystemTime.UtcNow()); // the new fire time afterward will magically preserve the original // time of day for firing for day/week/month interval triggers, // because of the way getFireTimeAfter() works - in its always restarting @@ -322,7 +328,7 @@ public override void UpdateAfterMisfire(ICalendar cal) ///'s state based on the + /// Updates the 's state based on the /// MISFIRE_INSTRUCTION_XXX that was selected when the DateIntervalTrigger
/// was created. ////// Called when the
///has decided to 'fire' /// the trigger (Execute the associated ), in order to - /// give the a chance to update itself for its next + /// give the a chance to update itself for its next /// triggering (if any). /// /// This method should not be used by the Quartz client. /// ///- /// The implementation should update the
's state + /// The implementation should update the 's state /// based on the given new version of the associated /// (the state should be updated so that it's next fire time is appropriate /// given the Calendar's new settings). @@ -362,33 +368,33 @@ public override void Triggered(ICalendar calendar) /// public override void UpdateWithNewCalendar(ICalendar calendar, TimeSpan misfireThreshold) { - nextFireTime = GetFireTimeAfter(previousFireTime); + nextFireTimeUtc = GetFireTimeAfter(previousFireTimeUtc); - if (nextFireTime == null || calendar == null) + if (nextFireTimeUtc == null || calendar == null) { return; } DateTimeOffset now = SystemTime.UtcNow(); - while (nextFireTime != null && !calendar.IsTimeIncluded(nextFireTime.Value)) + while (nextFireTimeUtc != null && !calendar.IsTimeIncluded(nextFireTimeUtc.Value)) { - nextFireTime = GetFireTimeAfter(nextFireTime); + nextFireTimeUtc = GetFireTimeAfter(nextFireTimeUtc); - if (nextFireTime == null) + if (nextFireTimeUtc == null) break; //avoid infinite loop - if (nextFireTime.Value.Year > YearToGiveupSchedulingAt) + if (nextFireTimeUtc.Value.Year > YearToGiveupSchedulingAt) { - nextFireTime = null; + nextFireTimeUtc = null; } - if (nextFireTime != null && nextFireTime < now) + if (nextFireTimeUtc != null && nextFireTimeUtc < now) { - TimeSpan diff = now - nextFireTime.Value; + TimeSpan diff = now - nextFireTimeUtc.Value; if (diff >= misfireThreshold) { - nextFireTime = GetFireTimeAfter(nextFireTime); + nextFireTimeUtc = GetFireTimeAfter(nextFireTimeUtc); } } } @@ -399,41 +405,41 @@ public override void UpdateWithNewCalendar(ICalendar calendar, TimeSpan misfireT /// /// ///- /// Called by the scheduler at the time a
/// ///is first - /// added to the scheduler, in order to have the + /// Called by the scheduler at the time a is first + /// added to the scheduler, in order to have the /// compute its first fire time, based on any associated calendar. /// - /// After this method has been called,
///+ /// After this method has been called, /// should return a valid answer. /// - /// The first time at which the public override DateTimeOffset? ComputeFirstFireTimeUtc(ICalendar calendar) { - nextFireTime = StartTimeUtc; + nextFireTimeUtc = StartTimeUtc; - while (nextFireTime != null && calendar != null - && !calendar.IsTimeIncluded(nextFireTime.Value)) + while (nextFireTimeUtc != null && calendar != null + && !calendar.IsTimeIncluded(nextFireTimeUtc.Value)) { - nextFireTime = GetFireTimeAfter(nextFireTime); + nextFireTimeUtc = GetFireTimeAfter(nextFireTimeUtc); - if (nextFireTime == null) + if (nextFireTimeUtc == null) break; //avoid infinite loop - if (nextFireTime.Value.Year > YearToGiveupSchedulingAt) + if (nextFireTimeUtc.Value.Year > YearToGiveupSchedulingAt) { return null; } } - return nextFireTime; + return nextFireTimeUtc; } ///will be fired - /// by the scheduler, which is also the same value - /// will return (until after the first firing of the ). + /// The first time at which the will be fired + /// by the scheduler, which is also the same value + /// will return (until after the first firing of the ). /// @@ -441,7 +447,7 @@ public override void UpdateWithNewCalendar(ICalendar calendar, TimeSpan misfireT /// ////// Called after the /// @@ -457,7 +463,7 @@ public override void UpdateWithNewCalendar(ICalendar calendar, TimeSpan misfireT ///has executed the - /// associated with the + /// associated with the /// in order to get the final instruction code from the trigger. /// /// /// - /// + /// public override SchedulerInstruction ExecutionComplete(IJobExecutionContext context, JobExecutionException result) { @@ -485,7 +491,7 @@ public override SchedulerInstruction ExecutionComplete(IJobExecutionContext cont } /// - /// Returns the next time at which the ///is scheduled to fire. If + /// Returns the next time at which the is scheduled to fire. If /// the trigger will not fire again, will be returned. Note that /// the time returned can possibly be in the past, if the time that was computed /// for the trigger to next fire has already arrived, but the scheduler has not yet @@ -493,43 +499,36 @@ public override SchedulerInstruction ExecutionComplete(IJobExecutionContext cont /// e.g. threads). /// - /// The value returned is not guaranteed to be valid until after the - ///+ /// The value returned is not guaranteed to be valid until after the /// has been added to the scheduler. /// /// public override DateTimeOffset? GetNextFireTimeUtc() { - return nextFireTime; + return nextFireTimeUtc; } /// - /// Returns the previous time at which the - public override DateTimeOffset? PreviousFireTimeUtc + public override DateTimeOffset? GetPreviousFireTimeUtc() + { + return previousFireTimeUtc; + } + + public override void SetNextFireTimeUtc(DateTimeOffset? value) { - get { return previousFireTime; } - set { previousFireTime = value; } + nextFireTimeUtc = value; } - /** - *fired. + /// Returns the previous time at which the fired. /// If the trigger has not yet fired, will be returned. /// - * Set the next time at which the
- * - *DateIntervalTrigger
should fire. - *- * This method should not be invoked by client code. - *
- */ - - public override DateTimeOffset? NextFireTimeUtc + public override void SetPreviousFireTimeUtc(DateTimeOffset? previousFireTimeUtc) { - set { this.nextFireTime = value; } + this.previousFireTimeUtc = previousFireTimeUtc; } ///- /// Returns the next time at which the @@ -796,25 +795,26 @@ public override void Validate() } } - /** - * Get a {@link ScheduleBuilder} that is configured to produce a - * schedule identical to this trigger's schedule. - * - * @see #getTriggerBuilder() - */ + ///will fire, + /// Returns the next time at which the will fire, /// after the given time. If the trigger will not fire after the given time, /// will be returned. /// + /// Get a {@link ScheduleBuilder} that is configured to produce a + /// schedule identical to this trigger's schedule. + /// + ///+ /// + ///public override IScheduleBuilder GetScheduleBuilder() { - CalendarIntervalScheduleBuilder cb = CalendarIntervalScheduleBuilder.CalendarIntervalSchedule() - .withInterval(RepeatInterval, RepeatIntervalUnit); + CalendarIntervalScheduleBuilder cb = CalendarIntervalScheduleBuilder.Create() + .WithInterval(RepeatInterval, RepeatIntervalUnit); switch (MisfireInstruction) { case Quartz.MisfireInstruction.CalendarIntervalTrigger.DoNothing: - cb.withMisfireHandlingInstructionDoNothing(); + cb.WithMisfireHandlingInstructionDoNothing(); break; case Quartz.MisfireInstruction.CalendarIntervalTrigger.FireOnceNow: - cb.withMisfireHandlingInstructionFireAndProceed(); + cb.WithMisfireHandlingInstructionFireAndProceed(); break; } diff --git a/src/Quartz/Impl/Triggers/CronTriggerImpl.cs b/src/Quartz/Impl/Triggers/CronTriggerImpl.cs index 33f7ba4c8..1656ca099 100644 --- a/src/Quartz/Impl/Triggers/CronTriggerImpl.cs +++ b/src/Quartz/Impl/Triggers/CronTriggerImpl.cs @@ -167,7 +167,6 @@ namespace Quartz.Impl.Triggers /// /// /// - /// /// Sharada Jambula ///James House ///Contributions from Mads Henderson @@ -203,7 +202,7 @@ public CronTriggerImpl() /// The start-time will also be set to the current time, and the time zone /// will be set the the system's default time zone. /// - /// The name of the+ /// The name of the public CronTriggerImpl(string name) : this(name, null) { } @@ -215,8 +214,8 @@ public CronTriggerImpl(string name) : this(name, null) /// The start-time will also be set to the current time, and the time zone /// will be set the the system's default time zone. /// - /// The name of the - /// The group of the + /// The name of the + /// The group of the public CronTriggerImpl(string name, string group) : base(name, group) { StartTimeUtc = SystemTime.UtcNow(); @@ -232,9 +231,9 @@ public CronTriggerImpl(string name, string group) : base(name, group) /// The start-time will also be set to the current time, and the time zone /// will be set the the system's default time zone. /// - /// The name of the - /// The group of the - /// A cron expression dictating the firing sequence of the + /// The name of the + /// The group of the + /// A cron expression dictating the firing sequence of the public CronTriggerImpl(string name, string group, string cronExpression) : base(name, group) { CronExpressionString = cronExpression; @@ -245,16 +244,16 @@ public CronTriggerImpl(string name, string group, string cronExpression) : base( /// /// Create a ///with the given name and group, and - /// associated with the identified . + /// associated with the identified . /// /// The start-time will also be set to the current time, and the time zone /// will be set the the system's default time zone. /// - /// The name of the. - /// The group of the - /// name of the executed on firetime - /// Group of the executed on firetime + /// The name of the . + /// The group of the + /// name of the executed on firetime + /// Group of the executed on firetime public CronTriggerImpl(string name, string group, string jobName, string jobGroup) : base(name, group, jobName, jobGroup) { @@ -263,19 +262,19 @@ public CronTriggerImpl(string name, string group, string jobName, } /// - /// Create a ///with the given name and group, - /// associated with the identified , + /// Create a with the given name and group, + /// associated with the identified , /// and with the given "cron" expression. /// /// The start-time will also be set to the current time, and the time zone /// will be set the the system's default time zone. /// - /// The name of the- /// The group of the - /// name of the executed on firetime - /// Group of the executed on firetime - /// A cron expression dictating the firing sequence of the + /// The name of the + /// The group of the + /// name of the executed on firetime + /// Group of the executed on firetime + /// A cron expression dictating the firing sequence of the public CronTriggerImpl(string name, string group, string jobName, string jobGroup, string cronExpression) : this(name, group, jobName, jobGroup, SystemTime.UtcNow(), null, cronExpression, TimeZoneInfo.Local) @@ -283,15 +282,15 @@ public CronTriggerImpl(string name, string group, string jobName, } /// - /// Create a - /// The name of thewith the given name and group, - /// associated with the identified , + /// Create a with the given name and group, + /// associated with the identified , /// and with the given "cron" expression resolved with respect to the . /// - /// The group of the - /// name of the executed on firetime - /// Group of the executed on firetime - /// A cron expression dictating the firing sequence of the + /// The name of the + /// The group of the + /// name of the executed on firetime + /// Group of the executed on firetime + /// A cron expression dictating the firing sequence of the /// /// Specifies for which time zone the cronExpression
should be interpreted, /// i.e. the expression 0 0 10 * * ?, is resolved to 10:00 am in this time zone. @@ -305,20 +304,20 @@ public CronTriggerImpl(string name, string group, string jobName, ///- /// Create a - /// The name of thethat will occur at the given time, + /// Create a that will occur at the given time, /// until the given end time. /// /// If null, the start-time will also be set to the current time, the time /// zone will be set the the system's default. ///
///- /// The group of the - /// name of the executed on firetime - /// Group of the executed on firetime - /// A set to the earliest time for the to start firing. - /// A set to the time for the to quit repeat firing. - /// A cron expression dictating the firing sequence of the + /// The name of the + /// The group of the + /// name of the executed on firetime + /// Group of the executed on firetime + /// A set to the earliest time for the to start firing. + /// A set to the time for the to quit repeat firing. + /// A cron expression dictating the firing sequence of the public CronTriggerImpl(string name, string group, string jobName, string jobGroup, DateTimeOffset startTimeUtc, DateTimeOffset? endTime, @@ -346,12 +345,12 @@ public CronTriggerImpl(string name, string group, string jobName, /// occurring from the until /// the given . /// - /// The group of the - /// name of the executed on firetime - /// Group of the executed on firetime - /// A set to the earliest time for the to start firing. - /// A set to the time for the to quit repeat firing. + /// The name of the + /// The group of the + /// name of the executed on firetime + /// Group of the executed on firetime + /// A set to the earliest time for the to start firing. + /// A set to the time for the to quit repeat firing. public CronTriggerImpl(string name, string group, string jobName, string jobGroup, DateTimeOffset startTimeUtc, DateTimeOffset? endTime, @@ -467,7 +466,7 @@ public override DateTimeOffset? EndTimeUtc } /// - /// Returns the next time at which the ///is scheduled to fire. If + /// Returns the next time at which the is scheduled to fire. If /// the trigger will not fire again, will be returned. Note that /// the time returned can possibly be in the past, if the time that was computed /// for the trigger to next fire has already arrived, but the scheduler has not yet @@ -475,10 +474,9 @@ public override DateTimeOffset? EndTimeUtc /// e.g. threads). /// - /// The value returned is not guaranteed to be valid until after the - ///+ /// The value returned is not guaranteed to be valid until after the /// has been added to the scheduler. /// /// public override DateTimeOffset? GetNextFireTimeUtc() { @@ -486,13 +484,13 @@ public override DateTimeOffset? EndTimeUtc } /// - /// Returns the previous time at which the - ///fired. + /// Returns the previous time at which the fired. /// If the trigger has not yet fired, will be returned. /// - public override DateTimeOffset? PreviousFireTimeUtc + /// + public override DateTimeOffset? GetPreviousFireTimeUtc() { - get { return previousFireTimeUtc; } + return previousFireTimeUtc; } @@ -503,7 +501,7 @@ public override DateTimeOffset? PreviousFireTimeUtc /// /// /// The fire time. - public void SetNextFireTime(DateTimeOffset? fireTime) + public override void SetNextFireTimeUtc(DateTimeOffset? fireTime) { nextFireTimeUtc = fireTime; } @@ -516,18 +514,18 @@ public void SetNextFireTime(DateTimeOffset? fireTime) /// /// /// The fire time. - public void SetPreviousFireTime(DateTimeOffset? fireTime) + public override void SetPreviousFireTimeUtc(DateTimeOffset? fireTime) { previousFireTimeUtc = fireTime; } /// - /// Sets the time zone for which the ///of this - /// will be resolved. + /// Sets the time zone for which the of this + /// will be resolved. /// - /// If is set after this + /// If is set after this /// property, the TimeZone setting on the CronExpression will "win". However /// if is set after this property, the /// time zone applied by this method will remain in effect, since the @@ -560,7 +558,7 @@ public TimeZoneInfo TimeZone } /// - /// Returns the next time at which the @@ -592,8 +590,31 @@ public TimeZoneInfo TimeZone return pot; } - ///will fire, + /// Returns the next time at which the will fire, /// after the given time. If the trigger will not fire after the given time, /// will be returned. /// - /// Returns the last UTC time at which the ///will fire, if + public override IScheduleBuilder GetScheduleBuilder() + { + CronScheduleBuilder cb = null; + try + { + cb = CronScheduleBuilder.CronSchedule(CronExpressionString).InTimeZone(TimeZone); + } + catch (FormatException) + { + // can't happen (because the expression was validated to get here in the first place) + } + + switch (MisfireInstruction) + { + case Quartz.MisfireInstruction.CronTrigger.DoNothing: cb.WithMisfireHandlingInstructionDoNothing(); + break; + case Quartz.MisfireInstruction.CronTrigger.FireOnceNow: cb.WithMisfireHandlingInstructionFireAndProceed(); + break; + } + + return cb; + } + + /// + /// Returns the last UTC time at which the @@ -690,11 +711,11 @@ public override void UpdateAfterMisfire(ICalendar cal) { newFireTime = GetFireTimeAfter(newFireTime); } - SetNextFireTime(newFireTime); + SetNextFireTimeUtc(newFireTime); } else if (instr == Quartz.MisfireInstruction.CronTrigger.FireOnceNow) { - SetNextFireTime(SystemTime.UtcNow()); + SetNextFireTimeUtc(SystemTime.UtcNow()); } } @@ -764,7 +785,7 @@ public bool WillFireOn(DateTimeOffset test, bool dayOnly) ///will fire, if /// the Trigger will repeat indefinitely, null will be returned. /// /// Note that the return time *may* be in the past. @@ -634,10 +655,10 @@ public override bool HasMillisecondPrecision ///
////// Used by the ///to determine whether or not - /// it is possible for this to fire again. + /// it is possible for this to fire again. /// /// If the returned value is
///then the - /// may remove the from the . + /// may remove the from the . /// @@ -666,8 +687,8 @@ protected override bool ValidateMisfireInstruction(int misfireInstruction) /// To be implemented by the concrete classes that extend this class. /// - /// The implementation should update the
///'s state - /// based on the MISFIRE_INSTRUCTION_XXX that was selected when the + /// The implementation should update the 's state + /// based on the MISFIRE_INSTRUCTION_XXX that was selected when the /// was created. /// /// Called when the /// @@ -826,8 +847,8 @@ public override void UpdateWithNewCalendar(ICalendar calendar, TimeSpan misfireT ///has decided to 'fire' /// the trigger (Execute the associated ), in order to - /// give the a chance to update itself for its next + /// give the a chance to update itself for its next /// triggering (if any). /// - /// Called by the scheduler at the time a /// ///is first - /// added to the scheduler, in order to have the + /// Called by the scheduler at the time a is first + /// added to the scheduler, in order to have the /// compute its first fire time, based on any associated calendar. /// /// After this method has been called,
@@ -836,9 +857,9 @@ public override void UpdateWithNewCalendar(ICalendar calendar, TimeSpan misfireT /// - /// the first time at which the public override DateTimeOffset? ComputeFirstFireTimeUtc(ICalendar cal) { @@ -861,7 +882,12 @@ public string GetExpressionSummary() return cronEx == null ? null : cronEx.GetExpressionSummary(); } - //////////////////////////////////////////////////////////////////////////// + public TriggerBuilderwill be fired + /// the first time at which the will be fired /// by the scheduler, which is also the same value - /// will return (until after the first firing of the ). + /// will return (until after the first firing of the ). /// GetTriggerBuilder() + { + throw new NotImplementedException(); + } + + //////////////////////////////////////////////////////////////////////////// // // Computation Functions // @@ -884,7 +910,7 @@ public string GetExpressionSummary() /// /// NOT YET IMPLEMENTED: Returns the time before the given time - /// that this /// The date. ///will fire. + /// that this will fire. /// diff --git a/src/Quartz/Impl/Triggers/SimpleTriggerImpl.cs b/src/Quartz/Impl/Triggers/SimpleTriggerImpl.cs index 1536330b9..2bf1a1d19 100644 --- a/src/Quartz/Impl/Triggers/SimpleTriggerImpl.cs +++ b/src/Quartz/Impl/Triggers/SimpleTriggerImpl.cs @@ -27,8 +27,6 @@ namespace Quartz.Impl.Triggers /// /// - /// - /// /// James House ///Contributions by Lieven Govaerts of Ebitec Nv, Belgium. ///Marko Lahma (.NET) @@ -67,7 +65,7 @@ public SimpleTriggerImpl(string name) : this(name, null) } ///- /// Create a public SimpleTriggerImpl(string name, string group) @@ -117,10 +115,10 @@ public SimpleTriggerImpl(string name, string group, DateTimeOffset startTimeUtc) /// the given end time. /// /// The name. - /// A UTCthat will occur immediately, and + /// Create a that will occur immediately, and /// not repeat. /// set to the time for the to fire. - /// A UTC set to the time for the + /// A UTC set to the time for the to fire. + /// A UTC set to the time for the /// to quit repeat firing. - /// The number of times for the to repeat + /// The number of times for the to repeat /// firing, use for unlimited times. /// The time span to pause between the repeat firing. public SimpleTriggerImpl(string name, DateTimeOffset startTimeUtc, @@ -136,10 +134,10 @@ public SimpleTriggerImpl(string name, DateTimeOffset startTimeUtc, /// /// The name. /// The group. - /// A UTC set to the time for the to fire. - /// A UTC set to the time for the + /// A UTC set to the time for the to fire. + /// A UTC set to the time for the /// to quit repeat firing. - /// The number of times for the to repeat + /// The number of times for the to repeat /// firing, use for unlimited times. /// The time span to pause between the repeat firing. public SimpleTriggerImpl(string name, string group, DateTimeOffset startTimeUtc, @@ -161,11 +159,11 @@ public SimpleTriggerImpl(string name, string group, DateTimeOffset startTimeUtc, /// The group. /// Name of the job. /// The job group. - /// A set to the time for the + /// A set to the time for the /// to fire. - /// A set to the time for the + /// A set to the time for the /// to quit repeat firing. - /// The number of times for the to repeat + /// The number of times for the to repeat /// firing, use RepeatIndefinitely for unlimited times. /// The time span to pause between the repeat firing. public SimpleTriggerImpl(string name, string group, string jobName, string jobGroup, DateTimeOffset startTimeUtc, @@ -227,7 +225,35 @@ public virtual int TimesTriggered set { timesTriggered = value; } } - /// + public TriggerBuilder + public override DateTimeOffset? GetPreviousFireTimeUtc() + { + return previousFireTimeUtc; + } ///GetTriggerBuilder() + { + return GetTriggerBuilder (); + } + + public override IScheduleBuilder GetScheduleBuilder() + { + SimpleScheduleBuilder sb = SimpleScheduleBuilder.Create() + .WithInterval(RepeatInterval) + .WithRepeatCount(RepeatCount); + + switch (MisfireInstruction) + { + case Quartz.MisfireInstruction.SimpleTrigger.FireNow: sb.WithMisfireHandlingInstructionFireNow(); + break; + case Quartz.MisfireInstruction.SimpleTrigger.RescheduleNextWithExistingCount: sb.WithMisfireHandlingInstructionNextWithExistingCount(); + break; + case Quartz.MisfireInstruction.SimpleTrigger.RescheduleNextWithRemainingCount : sb.WithMisfireHandlingInstructionNextWithRemainingCount(); + break; + case Quartz.MisfireInstruction.SimpleTrigger.RescheduleNowWithExistingRepeatCount : sb.WithMisfireHandlingInstructionNowWithExistingCount(); + break; + case Quartz.MisfireInstruction.SimpleTrigger.RescheduleNowWithRemainingRepeatCount: sb.WithMisfireHandlingInstructionNowWithRemainingCount(); + break; + } + + return sb; + } + + /// /// Returns the final UTC time at which the public override DateTimeOffset? GetNextFireTimeUtc() { return nextFireTimeUtc; } - ///will /// fire, if repeatCount is RepeatIndefinitely, null will be returned. /// @@ -345,7 +371,7 @@ public override void UpdateAfterMisfire(ICalendar cal) if (instr == Quartz.MisfireInstruction.SimpleTrigger.FireNow) { - NextFireTime = SystemTime.UtcNow(); + nextFireTimeUtc = SystemTime.UtcNow(); } else if (instr == Quartz.MisfireInstruction.SimpleTrigger.RescheduleNextWithExistingCount) { @@ -366,7 +392,7 @@ public override void UpdateAfterMisfire(ICalendar cal) newFireTime = null; } } - NextFireTime = newFireTime; + nextFireTimeUtc = newFireTime; } else if (instr == Quartz.MisfireInstruction.SimpleTrigger.RescheduleNextWithRemainingCount) { @@ -394,7 +420,7 @@ public override void UpdateAfterMisfire(ICalendar cal) TimesTriggered = TimesTriggered + timesMissed; } - NextFireTime = newFireTime; + nextFireTimeUtc = newFireTime; } else if (instr == Quartz.MisfireInstruction.SimpleTrigger.RescheduleNowWithExistingRepeatCount) { @@ -407,12 +433,12 @@ public override void UpdateAfterMisfire(ICalendar cal) if (EndTimeUtc.HasValue && EndTimeUtc.Value < newFireTime) { - NextFireTime = null; // We are past the end time + nextFireTimeUtc = null; // We are past the end time } else { StartTimeUtc = newFireTime; - NextFireTime = newFireTime; + nextFireTimeUtc = newFireTime; } } else if (instr == Quartz.MisfireInstruction.SimpleTrigger.RescheduleNowWithRemainingRepeatCount) @@ -434,12 +460,12 @@ public override void UpdateAfterMisfire(ICalendar cal) if (EndTimeUtc.HasValue && EndTimeUtc.Value < newFireTime) { - NextFireTime = null; // We are past the end time + nextFireTimeUtc = null; // We are past the end time } else { StartTimeUtc = newFireTime; - NextFireTime = newFireTime; + nextFireTimeUtc = newFireTime; } } } @@ -447,7 +473,7 @@ public override void UpdateAfterMisfire(ICalendar cal) ///
/// Called when the ///has decided to 'fire' /// the trigger (Execute the associated ), in order to - /// give the a chance to update itself for its next + /// give the a chance to update itself for its next /// triggering (if any). /// @@ -517,8 +543,8 @@ public override void UpdateWithNewCalendar(ICalendar calendar, TimeSpan misfireT } /// - /// Called by the scheduler at the time a ///is first - /// added to the scheduler, in order to have the + /// Called by the scheduler at the time a is first + /// added to the scheduler, in order to have the /// compute its first fire time, based on any associated calendar. /// /// After this method has been called,
///@@ -526,9 +552,9 @@ public override void UpdateWithNewCalendar(ICalendar calendar, TimeSpan misfireT /// - /// The first time at which the public override DateTimeOffset? ComputeFirstFireTimeUtc(ICalendar cal) { @@ -558,41 +584,32 @@ public override void UpdateWithNewCalendar(ICalendar calendar, TimeSpan misfireT /// Returns the next time at which thewill be fired + /// The first time at which the will be fired /// by the scheduler, which is also the same value - /// will return (until after the first firing of the ). + /// will return (until after the first firing of the ). /// will /// fire. If the trigger will not fire again, will be /// returned. The value returned is not guaranteed to be valid until after - /// the has been added to the scheduler. + /// the has been added to the scheduler. /// - /// Returns the previous time at which the - public override DateTimeOffset? PreviousFireTimeUtc + public override void SetNextFireTimeUtc(DateTimeOffset? value) { - get { return previousFireTimeUtc; } - set { previousFireTimeUtc = value; } + throw new NotImplementedException(); } - ///fired. - /// If the trigger has not yet fired, will be - /// returned. - /// - /// Set the next UTC time at which the - public override DateTimeOffset? NextFireTimeUtc + public override void SetPreviousFireTimeUtc(DateTimeOffset? value) { - set { nextFireTimeUtc = value; } + throw new NotImplementedException(); } ///should fire. - /// This method should not be invoked by client code. - /// - /// Set the previous UTC time at which the - public virtual void SetPreviousFireTime(DateTimeOffset? fireTimeUtc) - { - previousFireTimeUtc = fireTimeUtc; - } + /// Returns the previous time at which thefired. - /// This method should not be invoked by client code. - /// fired. + /// If the trigger has not yet fired, will be + /// returned. + /// /// Returns the next UTC time at which the will @@ -693,7 +710,7 @@ public override bool GetMayFireAgain() } /// - /// Validates whether the properties of the public override void Validate() diff --git a/src/Quartz/Job/FileScanJob.cs b/src/Quartz/Job/FileScanJob.cs index b1d324e31..8e8ee86fa 100644 --- a/src/Quartz/Job/FileScanJob.cs +++ b/src/Quartz/Job/FileScanJob.cs @@ -61,7 +61,7 @@ public FileScanJob() } ///are + /// Validates whether the properties of the are /// valid for submission into a . /// - /// Called by the when a + /// Called by the when a /// fires that is associated with the . /// /// The implementation may wish to set a result object on the diff --git a/src/Quartz/Job/NativeJob.cs b/src/Quartz/Job/NativeJob.cs index cbb4d8fb6..3b317c346 100644 --- a/src/Quartz/Job/NativeJob.cs +++ b/src/Quartz/Job/NativeJob.cs @@ -107,7 +107,7 @@ public NativeJob() } ///
- /// Called by the when a + /// Called by the when a /// fires that is associated with the . /// /// The implementation may wish to set a result object on the diff --git a/src/Quartz/JobBuilder.cs b/src/Quartz/JobBuilder.cs index d26df4632..bad4cbd5a 100644 --- a/src/Quartz/JobBuilder.cs +++ b/src/Quartz/JobBuilder.cs @@ -55,7 +55,7 @@ namespace Quartz /// scheduler.scheduleJob(job, trigger); ///
+ /// /// /// public class JobBuilder @@ -131,8 +131,8 @@ public IJobDetail Build() /// /// the name element for the Job's JobKey /// the updated JobBuilder - ///+ /// public JobBuilder WithIdentity(string name) { key = new JobKey(name, null); @@ -151,7 +151,7 @@ public JobBuilder WithIdentity(string name) /// the group element for the Job's JobKey /// the updated JobBuilder ///- /// + /// public JobBuilder WithIdentity(string name, string group) { key = new JobKey(name, group); @@ -168,7 +168,7 @@ public JobBuilder WithIdentity(string name, string group) /// the Job's JobKey /// the updated JobBuilder ///- /// + /// public JobBuilder WithIdentity(JobKey key) { this.key = key; @@ -180,7 +180,7 @@ public JobBuilder WithIdentity(JobKey key) /// /// the description for the Job /// the updated JobBuilder - ///+ /// public JobBuilder WithDescription(string description) { this.description = description; @@ -192,7 +192,7 @@ public JobBuilder WithDescription(string description) /// Trigger fires that is associated with this JobDetail. /// /// the updated JobBuilder - ///+ /// public JobBuilder OfType () { return OfType(typeof(T)); @@ -203,7 +203,7 @@ public JobBuilder OfType () /// Trigger fires that is associated with this JobDetail. /// /// the updated JobBuilder - ///+ /// public JobBuilder OfType(Type type) { jobType = type; @@ -250,7 +250,7 @@ public JobBuilder RequestRecovery(bool shouldRecover) /// If not explicitly set, the default value is false
. /// ///the updated JobBuilder - ///+ /// public JobBuilder StoreDurably() { this.durability = true; @@ -264,9 +264,9 @@ public JobBuilder StoreDurably() /// /// If not explicitly set, the default value is - /// the value to set for the durability property. + /// the value to set for the durability property. ///false
. ///the updated JobBuilder - ///+ /// public JobBuilder StoreDurably(bool durability) { this.durability = durability; diff --git a/src/Quartz/JobDataMap.cs b/src/Quartz/JobDataMap.cs index 5bb645bc5..8600ed6c6 100644 --- a/src/Quartz/JobDataMap.cs +++ b/src/Quartz/JobDataMap.cs @@ -35,13 +35,13 @@ namespace Quartz /// instances. /// ///
///instances can also be stored with a - /// . This can be useful in the case where you have a Job + /// . This can be useful in the case where you have a Job /// that is stored in the scheduler for regular/repeated use by multiple /// Triggers, yet with each independent triggering, you want to supply the /// Job with different data inputs. /// - /// The
/// ///passed to a Job at execution time + /// The passed to a Job at execution time /// also contains a convenience that is the result /// of merging the contents of the trigger's JobDataMap (if any) over the /// Job's JobDataMap (if any). @@ -49,8 +49,8 @@ namespace Quartz /// /// /// - /// - /// + /// + /// /// James House ///Marko Lahma (.NET) [Serializable] diff --git a/src/Quartz/JobExecutionException.cs b/src/Quartz/JobExecutionException.cs index d7c225f09..2e7990a01 100644 --- a/src/Quartz/JobExecutionException.cs +++ b/src/Quartz/JobExecutionException.cs @@ -27,7 +27,7 @@ namespace Quartz /// An exception that can be thrown by a/// to indicate to the Quartz that an error /// occurred while executing, and whether or not the requests - /// to be re-fired immediately (using the same , + /// to be re-fired immediately (using the same , /// or whether it wants to be unscheduled. /// /// @@ -35,7 +35,7 @@ namespace Quartz /// unscheduling the Job are ignored. /// ///- /// + /// /// /// James House ///Marko Lahma (.NET) diff --git a/src/Quartz/JobKey.cs b/src/Quartz/JobKey.cs index 2ecaafc43..b893d2c1c 100644 --- a/src/Quartz/JobKey.cs +++ b/src/Quartz/JobKey.cs @@ -24,7 +24,7 @@ namespace Quartz { ///- /// Uniquely identifies a ///. + /// Uniquely identifies a . /// /// Keys are composed of both a name and group, and the name must be unique @@ -34,9 +34,9 @@ namespace Quartz ///
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 - ///
+ /// and the various, , + /// , , /// , , - /// and the various implementations. implementations. Client code can then use the DSL to write code such as this:
///diff --git a/src/Quartz/Listener/BroadcastJobListener.cs b/src/Quartz/Listener/BroadcastJobListener.cs index c5a568e5a..ba66326e1 100644 --- a/src/Quartz/Listener/BroadcastJobListener.cs +++ b/src/Quartz/Listener/BroadcastJobListener.cs @@ -24,36 +24,32 @@ namespace Quartz.Listener { -/** - * Holds a List of references to JobListener instances and broadcasts all - * events to them (in order). - * - *The broadcasting behavior of this listener to delegate listeners may be - * more convenient than registering all of the listeners directly with the - * Scheduler, and provides the flexibility of easily changing which listeners - * get notified.
- * - * - * @see #addListener(org.quartz.JobListener) - * @see #removeListener(org.quartz.JobListener) - * @see #removeListener(String) - * - * @author James House (jhouse AT revolition DOT net) - */ - + ///+ /// Holds a List of references to JobListener instances and broadcasts all + /// events to them (in order). + /// + ///+ /// + ///The broadcasting behavior of this listener to delegate listeners may be + /// more convenient than registering all of the listeners directly with the + /// Scheduler, and provides the flexibility of easily changing which listeners + /// get notified.
+ ///+ /// + /// + /// James House (jhouse AT revolition DOT net) public class BroadcastJobListener : IJobListener { private readonly string name; private readonly Listlisteners; - /** - * Construct an instance with the given name. - * - * (Remember to add some delegate listeners!) - * - * @param name the name of this instance - */ - + /// + /// Construct an instance with the given name. + /// + ///+ /// (Remember to add some delegate listeners!) + /// + /// the name of this instance public BroadcastJobListener(string name) { if (name == null) @@ -64,13 +60,13 @@ public BroadcastJobListener(string name) listeners = new List(); } - /** - * Construct an instance with the given name, and List of listeners. - * - * @param name the name of this instance - * @param listeners the initial List of JobListeners to broadcast to. - */ - + /// + /// Construct an instance with the given name, and List of listeners. + /// + ///+ /// + /// the name of this instance + /// the initial List of JobListeners to broadcast to. public BroadcastJobListener(string name, Listlisteners) : this(name) { this.listeners.AddRange(listeners); diff --git a/src/Quartz/Listener/BroadcastTriggerListener.cs b/src/Quartz/Listener/BroadcastTriggerListener.cs index 166649ff0..bd5fcaf47 100644 --- a/src/Quartz/Listener/BroadcastTriggerListener.cs +++ b/src/Quartz/Listener/BroadcastTriggerListener.cs @@ -24,35 +24,32 @@ namespace Quartz.Listener { -/** - * Holds a List of references to TriggerListener instances and broadcasts all - * events to them (in order). - * - * The broadcasting behavior of this listener to delegate listeners may be - * more convenient than registering all of the listeners directly with the - * Scheduler, and provides the flexibility of easily changing which listeners - * get notified.
- * - * @see #addListener(org.quartz.TriggerListener) - * @see #removeListener(org.quartz.TriggerListener) - * @see #removeListener(String) - * - * @author James House (jhouse AT revolition DOT net) - */ - + ///+ /// Holds a List of references to TriggerListener instances and broadcasts all + /// events to them (in order). + /// + ///+ /// + ///The broadcasting behavior of this listener to delegate listeners may be + /// more convenient than registering all of the listeners directly with the + /// Scheduler, and provides the flexibility of easily changing which listeners + /// get notified.
+ ///+ /// + /// + /// James House (jhouse AT revolition DOT net) public class BroadcastTriggerListener : ITriggerListener { private readonly string name; private readonly Listlisteners; - /** - * Construct an instance with the given name. - * - * (Remember to add some delegate listeners!) - * - * @param name the name of this instance - */ - + /// + /// Construct an instance with the given name. + /// + ///+ /// (Remember to add some delegate listeners!) + /// + /// the name of this instance public BroadcastTriggerListener(string name) { if (name == null) @@ -63,13 +60,13 @@ public BroadcastTriggerListener(string name) listeners = new List(); } - /** - * Construct an instance with the given name, and List of listeners. - * - * @param name the name of this instance - * @param listeners the initial List of TriggerListeners to broadcast to. - */ - + /// + /// Construct an instance with the given name, and List of listeners. + /// + ///+ /// + /// the name of this instance + /// the initial List of TriggerListeners to broadcast to. public BroadcastTriggerListener(string name, IListlisteners) : this(name) { this.listeners.AddRange(listeners); diff --git a/src/Quartz/Listener/JobListenerSupport.cs b/src/Quartz/Listener/JobListenerSupport.cs index 809a4957b..81c4e6857 100644 --- a/src/Quartz/Listener/JobListenerSupport.cs +++ b/src/Quartz/Listener/JobListenerSupport.cs @@ -19,6 +19,8 @@ using Common.Logging; +using Quartz.Spi; + namespace Quartz.Listener { /// @@ -66,7 +68,7 @@ protected ILog Log /// /// The name of the/// Called by the public const int SmartPolicy = 0; - /** - * Instructs thewhen a - /// is about to be executed (an associated + /// is about to be executed (an associated /// has occured). /// /// This method will not be invoked if the execution of the Job was vetoed @@ -81,7 +83,7 @@ public virtual void JobToBeExecuted(IJobExecutionContext context) ///
/// Called by the @@ -93,8 +95,8 @@ public virtual void JobExecutionVetoed(IJobExecutionContext context) ///when a - /// was about to be executed (an associated + /// was about to be executed (an associated /// has occured), but a vetoed it's /// execution. /// /// Called by the /// /// diff --git a/src/Quartz/MisfireInstruction.cs b/src/Quartz/MisfireInstruction.cs index c2488be71..3c90e02be 100644 --- a/src/Quartz/MisfireInstruction.cs +++ b/src/Quartz/MisfireInstruction.cs @@ -1,4 +1,5 @@ #region License + /* * All content copyright Terracotta, Inc., unless otherwise indicated. All rights reserved. * @@ -15,6 +16,7 @@ * under the License. * */ + #endregion namespace Quartz @@ -35,16 +37,17 @@ public struct MisfireInstruction ///after a - /// has been executed, and be for the associated 's - /// method has been called. + /// has been executed, and be for the associated 's + /// method has been called. /// {@link Scheduler}
that the - *Trigger
will never be evaluated for a misfire situation, - * and that the scheduler will simply try to fire it as soon as it can, - * and then update the Trigger as if it had fired at the proper time. - * - *NOTE: if a trigger uses this instruction, and it has missed - * several of its scheduled firings, then - */ - public const int IgnoreMisfirePolicy = -1; + ///
/// - /// The TriggerFiredBundle from which the+ /// Instructs the + ///{@link Scheduler}
that the + ///Trigger
will never be evaluated for a misfire situation, + /// and that the scheduler will simply try to fire it as soon as it can, + /// and then update the Trigger as if it had fired at the proper time. + ///+ /// NOTE: if a trigger uses this instruction, and it has missed + /// several of its scheduled firings, then + /// + public const int IgnoreMisfirePolicy = -1; ////// Misfire policy settings for SimpleTrigger. @@ -53,7 +56,7 @@ public struct SimpleTrigger { /// /// Instructs the that upon a mis-fire - /// situation, the wants to be fired + /// situation, the wants to be fired /// now by . /// /// NOTE: This instruction should typically only be used for @@ -66,11 +69,11 @@ public struct SimpleTrigger ///
- */ + ////// Instructs the ///that upon a mis-fire - /// situation, the wants to be + /// situation, the wants to be /// re-scheduled to 'now' (even if the associated /// excludes 'now') with the repeat count left as-is. This does obey the - /// end-time however, so if 'now' is after the - /// end-time the will not fire again. + /// end-time however, so if 'now' is after the + /// end-time the will not fire again. /// /// /// - /// The TriggerFiredBundle from which the@@ -84,11 +87,11 @@ public struct SimpleTrigger ///
/// Instructs the that upon a mis-fire - /// situation, the wants to be + /// situation, the wants to be /// re-scheduled to 'now' (even if the associated /// excludes 'now') with the repeat count set to what it would be, if it had - /// not missed any firings. This does obey the end-time - /// however, so if 'now' is after the end-time the will + /// not missed any firings. This does obey the end-time + /// however, so if 'now' is after the end-time the will /// not fire again. /// /// @@ -101,7 +104,7 @@ public struct SimpleTrigger ///
/// ///- /// NOTE: This instruction could cause the
@@ -110,33 +113,32 @@ public struct SimpleTrigger ///+ /// NOTE: This instruction could cause the /// to go to the 'COMPLETE' state after firing 'now', if all the /// repeat-fire-times where missed. /// /// Instructs the ///that upon a mis-fire - /// situation, the wants to be + /// situation, the wants to be /// re-scheduled to the next scheduled time after 'now' - taking into /// account any associated , and with the /// repeat count set to what it would be, if it had not missed any firings. /// - /// NOTE/WARNING: This instruction could cause the public const int RescheduleNextWithRemainingCount = 4; ///+ /// NOTE/WARNING: This instruction could cause the /// to go directly to the 'COMPLETE' state if all fire-times where missed. /// /// Instructs the ///that upon a mis-fire - /// situation, the wants to be + /// situation, the wants to be /// re-scheduled to the next scheduled time after 'now' - taking into /// account any associated , and with the /// repeat count left unchanged. /// /// public const int RescheduleNextWithExistingCount = 5; - } ///- /// NOTE/WARNING: This instruction could cause the
///+ /// NOTE/WARNING: This instruction could cause the /// to go directly to the 'COMPLETE' state if all the end-time of the trigger /// has arrived. /// @@ -146,20 +148,19 @@ public struct CronTrigger { /// - ////// Instructs the public const int FireOnceNow = 1; ///that upon a mis-fire - /// situation, the wants to be fired now + /// situation, the wants to be fired now /// by . /// /// Instructs the public const int DoNothing = 2; - } ///that upon a mis-fire - /// situation, the wants to have it's + /// situation, the wants to have it's /// next-fire-time updated to the next time in the schedule after the /// current time (taking into account any associated , /// but it does not want to be fired now. /// @@ -181,7 +182,6 @@ public struct NthIncludedDayTrigger /// the current time, but it does not want to be fired now. /// public const int DoNothing = 2; - } ///@@ -191,21 +191,19 @@ public struct CalendarIntervalTrigger { /// ////// Instructs the public const int FireOnceNow = 1; ///that upon a mis-fire - /// situation, the wants to be + /// situation, the wants to be /// fired now by . /// /// Instructs the public const int DoNothing = 2; - } } - -} +} \ No newline at end of file diff --git a/src/Quartz/NthIncludedDayTrigger.cs b/src/Quartz/NthIncludedDayTrigger.cs index b25f647d7..58726bd66 100644 --- a/src/Quartz/NthIncludedDayTrigger.cs +++ b/src/Quartz/NthIncludedDayTrigger.cs @@ -125,8 +125,7 @@ public class NthIncludedDayTrigger : AbstractTrigger /// fireAtTime="12:00"). ///that upon a mis-fire - /// situation, the wants to have it's + /// situation, the wants to have it's /// next-fire-time updated to the next time in the schedule after the /// current time (taking into account any associated , /// but it does not want to be fired now. /// - /// Note that @@ -143,7 +142,7 @@ public NthIncludedDayTrigger() /// intervalType=, , - /// , and , must be + /// Note that and , must be /// called before the can be placed into /// a . /// , /// fireAtTime=12:00"). /// - /// Note that
@@ -162,7 +161,7 @@ public NthIncludedDayTrigger(string name) : this(name, null) /// intervalType=and must + /// Note that must /// be called before the can be placed /// into a . /// , /// fireAtTime=12:00"). /// - /// Note that
@@ -434,11 +433,10 @@ public override bool HasMillisecondPrecision ///and must + /// Note that must /// be called before the can be placed /// into a . /// fired. If the trigger has not yet /// fired, will be returned. /// the previous fire time for the trigger - public override DateTimeOffset? PreviousFireTimeUtc + ///the previous fire time for the trigger + public override DateTimeOffset? GetPreviousFireTimeUtc() { - get { return previousFireTimeUtc; } - set { previousFireTimeUtc = value; } + return previousFireTimeUtc; } @@ -533,7 +531,7 @@ public virtual TimeZoneInfo TimeZone ////// Called when the public override void Triggered(ICalendar cal) @@ -544,8 +542,8 @@ public override void Triggered(ICalendar cal) } ///has decided to 'fire' the trigger /// (Execute the associated ), in order to give the - /// a chance to update itself for its next triggering + /// a chance to update itself for its next triggering /// (if any). /// - /// Called by the scheduler at the time a - ///is first - /// added to the scheduler, in order to have the + /// Called by the scheduler at the time a is first + /// added to the scheduler, in order to have the /// compute its first fire time, based on any associated calendar. /// /// After this method has been called,
/// ///@@ -553,10 +551,10 @@ public override void Triggered(ICalendar cal) /// the first time at which the will be fired + /// the first time at which the public override DateTimeOffset? ComputeFirstFireTimeUtc(ICalendar cal) { @@ -569,11 +567,11 @@ public override void Triggered(ICalendar cal) ///will be fired /// by the scheduler, which is also the same value /// will return (until after the first - /// firing of the ). + /// firing of the ). /// /// Called after the /// - /// Thehas executed the - /// associated with the in order + /// associated with the in order /// to get the final instruction code from the trigger. /// that was used by the + /// The that was used by the /// 's method. /// /// @@ -609,12 +607,12 @@ public override SchedulerInstruction ExecutionComplete(IJobExecutionContext jobC /// /// Used by the ' ///to determine whether or not it is - /// possible for this to fire again. + /// possible for this to fire again. /// /// @@ -629,7 +627,7 @@ public override bool GetMayFireAgain() ////// If the returned value is
///then the - /// may remove the from the + /// may remove the from the /// /// /// Indicates whether is a valid misfire - /// instruction for this ///. + /// instruction for this . /// Whether protected override bool ValidateMisfireInstruction(int misfireInstruction) @@ -999,21 +997,25 @@ public DayOfWeek TriggerCalendarFirstDayOfWeek } - /** - * Get a {@link ScheduleBuilder} that is configured to produce a - * schedule identical to this trigger's schedule. - * - * @see #getTriggerBuilder() - */ - - public override IScheduleBuilder GetScheduleBuilderis valid. () + /// + /// Get a {@link ScheduleBuilder} that is configured to produce a + /// schedule identical to this trigger's schedule. + /// + ///+ /// + public override IScheduleBuilder GetScheduleBuilder() { throw new NotImplementedException(); // TODO } - public override DateTimeOffset? NextFireTimeUtc - { - set { throw new NotImplementedException(); } - } + public override void SetNextFireTimeUtc(DateTimeOffset? nextFireTime) + { + throw new NotImplementedException(); + } + + public override void SetPreviousFireTimeUtc(DateTimeOffset? previousFireTime) + { + throw new NotImplementedException(); + } } } diff --git a/src/Quartz/ObjectAlreadyExistsException.cs b/src/Quartz/ObjectAlreadyExistsException.cs index ed5752b26..b1b7f0328 100644 --- a/src/Quartz/ObjectAlreadyExistsException.cs +++ b/src/Quartz/ObjectAlreadyExistsException.cs @@ -25,7 +25,7 @@ namespace Quartz { ////// An exception that is thrown to indicate that an attempt to store a new - /// object (i.e. @@ -73,7 +73,7 @@ public ObjectAlreadyExistsException(IJobDetail offendingJob) ///, + /// object (i.e. , /// or ) in a /// failed, because one with the same name and group already exists. /// /// Create a
/// ///and auto-generate a - /// message using the name/group from the given . + /// message using the name/group from the given . /// diff --git a/src/Quartz/Plugin/History/LoggingJobHistoryPlugin.cs b/src/Quartz/Plugin/History/LoggingJobHistoryPlugin.cs index 49e556f0f..1385be170 100644 --- a/src/Quartz/Plugin/History/LoggingJobHistoryPlugin.cs +++ b/src/Quartz/Plugin/History/LoggingJobHistoryPlugin.cs @@ -377,7 +377,7 @@ public virtual void JobToBeExecuted(IJobExecutionContext context) new object[] { context.JobDetail.Key.Name, context.JobDetail.Key.Group, SystemTime.UtcNow(), trigger.Key.Name, trigger.Key.Group, - trigger.PreviousFireTimeUtc, trigger.GetNextFireTimeUtc(), context.RefireCount + trigger.GetPreviousFireTimeUtc(), trigger.GetNextFireTimeUtc(), context.RefireCount }; Log.Info(String.Format(CultureInfo.InvariantCulture, JobToBeFiredMessage, args)); @@ -409,7 +409,7 @@ public virtual void JobWasExecuted(IJobExecutionContext context, JobExecutionExc new object[] { context.JobDetail.Key.Name, context.JobDetail.Key.Group, SystemTime.UtcNow(), trigger.Key.Name, trigger.Key.Group, - trigger.PreviousFireTimeUtc, trigger.GetNextFireTimeUtc(), context.RefireCount, errMsg + trigger.GetPreviousFireTimeUtc(), trigger.GetNextFireTimeUtc(), context.RefireCount, errMsg }; Log.Warn(String.Format(CultureInfo.InvariantCulture, JobFailedMessage, args), jobException); @@ -426,7 +426,7 @@ public virtual void JobWasExecuted(IJobExecutionContext context, JobExecutionExc new object[] { context.JobDetail.Key.Name, context.JobDetail.Key.Group, SystemTime.UtcNow(), trigger.Key.Name, trigger.Key.Group, - trigger.PreviousFireTimeUtc, trigger.GetNextFireTimeUtc(), context.RefireCount, result + trigger.GetPreviousFireTimeUtc(), trigger.GetNextFireTimeUtc(), context.RefireCount, result }; Log.Info(String.Format(CultureInfo.InvariantCulture, JobSuccessMessage, args)); @@ -454,7 +454,7 @@ public virtual void JobExecutionVetoed(IJobExecutionContext context) new object[] { context.JobDetail.Key.Name, context.JobDetail.Key.Group, SystemTime.UtcNow(), trigger.Key.Name, trigger.Key.Group, - trigger.PreviousFireTimeUtc, trigger.GetNextFireTimeUtc(), context.RefireCount + trigger.GetPreviousFireTimeUtc(), trigger.GetNextFireTimeUtc(), context.RefireCount }; Log.Info(String.Format(CultureInfo.InvariantCulture, JobWasVetoedMessage, args)); diff --git a/src/Quartz/Plugin/History/LoggingTriggerHistoryPlugin.cs b/src/Quartz/Plugin/History/LoggingTriggerHistoryPlugin.cs index 42df997e8..75b5bde79 100644 --- a/src/Quartz/Plugin/History/LoggingTriggerHistoryPlugin.cs +++ b/src/Quartz/Plugin/History/LoggingTriggerHistoryPlugin.cs @@ -312,7 +312,7 @@ public virtual void TriggerFired(ITrigger trigger, IJobExecutionContext context) object[] args = new object[] { - trigger.Key.Name, trigger.Key.Group, trigger.PreviousFireTimeUtc, trigger.GetNextFireTimeUtc(), SystemTime.UtcNow(), + trigger.Key.Name, trigger.Key.Group, trigger.GetPreviousFireTimeUtc(), trigger.GetNextFireTimeUtc(), SystemTime.UtcNow(), context.JobDetail.Key.Name, context.JobDetail.Key.Group, context.RefireCount }; @@ -340,7 +340,7 @@ public virtual void TriggerMisfired(ITrigger trigger) object[] args = new object[] { - trigger.Key.Name, trigger.Key.Group, trigger.PreviousFireTimeUtc, trigger.GetNextFireTimeUtc(), SystemTime.UtcNow(), + trigger.Key.Name, trigger.Key.Group, trigger.GetPreviousFireTimeUtc(), trigger.GetNextFireTimeUtc(), SystemTime.UtcNow(), trigger.JobKey.Name, trigger.JobKey.Group }; @@ -389,7 +389,7 @@ public virtual void TriggerComplete(ITrigger trigger, IJobExecutionContext conte object[] args = new object[] { - trigger.Key.Name, trigger.Key.Group, trigger.PreviousFireTimeUtc, trigger.GetNextFireTimeUtc(), SystemTime.UtcNow(), + trigger.Key.Name, trigger.Key.Group, trigger.GetPreviousFireTimeUtc(), trigger.GetNextFireTimeUtc(), SystemTime.UtcNow(), context.JobDetail.Key.Name, context.JobDetail.Key.Group, context.RefireCount, triggerInstructionCode, instrCode }; diff --git a/src/Quartz/Plugin/Xml/XMLSchedulingDataProcessorPlugin.cs b/src/Quartz/Plugin/Xml/XMLSchedulingDataProcessorPlugin.cs index f5652d1c9..7baeb97c3 100644 --- a/src/Quartz/Plugin/Xml/XMLSchedulingDataProcessorPlugin.cs +++ b/src/Quartz/Plugin/Xml/XMLSchedulingDataProcessorPlugin.cs @@ -71,11 +71,11 @@ public class XMLSchedulingDataProcessorPlugin : ISchedulerPlugin, IFileScanListe private string name; ///
- /// Initializes a new instance of the public XMLSchedulingDataProcessorPlugin() { - log = LogManager.GetLogger(typeof (JobInitializationPlugin)); + log = LogManager.GetLogger(typeof(XMLSchedulingDataProcessorPlugin)); } ///class. + /// Initializes a new instance of the class. /// @@ -303,7 +303,7 @@ private void ProcessFile(JobFile jobFile) try { - XMLSchedulingDataProcessor processor = new XMLSchedulingDataProcessor(this.TypeLoadHelper); + XMLSchedulingDataProcessor processor = new XMLSchedulingDataProcessor(TypeLoadHelper); processor.AddJobGroupToNeverDelete(JobInitializationPluginName); processor.AddTriggerGroupToNeverDelete(JobInitializationPluginName); diff --git a/src/Quartz/Quartz.2010.csproj b/src/Quartz/Quartz.2010.csproj index b209f2ec0..de9b846e4 100644 --- a/src/Quartz/Quartz.2010.csproj +++ b/src/Quartz/Quartz.2010.csproj @@ -364,9 +364,6 @@ - - Code -diff --git a/src/Quartz/SPI/IJobFactory.cs b/src/Quartz/SPI/IJobFactory.cs index ec9df5cd5..5a16b525c 100644 --- a/src/Quartz/SPI/IJobFactory.cs +++ b/src/Quartz/SPI/IJobFactory.cs @@ -50,7 +50,7 @@ public interface IJobFactory /// configuration problem led to the issue wih instantiating the Job. /// Code + /// The TriggerFiredBundle from which the /// and other info relating to the trigger firing can be obtained. /// /// SchedulerException if there is a problem instantiating the Job. diff --git a/src/Quartz/SPI/IJobStore.cs b/src/Quartz/SPI/IJobStore.cs index 3f0640f8d..5c07645fb 100644 --- a/src/Quartz/SPI/IJobStore.cs +++ b/src/Quartz/SPI/IJobStore.cs @@ -26,15 +26,15 @@ namespace Quartz.Spi { ////// The interface to be implemented by classes that want to provide a ///- /// and storage mechanism for the + /// and storage mechanism for the /// 's use. /// - /// Storage of ///s and s should be keyed + /// Storage of s and s should be keyed /// on the combination of their name and group for uniqueness. /// - /// + /// /// /// /// @@ -81,10 +81,10 @@ public interface IJobStore bool Clustered { get; } /// - /// Store the given /// Theand . + /// Store the given and . /// to be stored. - /// The to be stored. + /// The to be stored. /// ObjectAlreadyExistsException void StoreJobAndTrigger(IJobDetail newJob, IOperableTrigger newTrigger); @@ -118,7 +118,7 @@ public interface IJobStore ////// Remove (delete) the ///with the given - /// key, and any s that reference + /// key, and any s that reference /// it. /// @@ -144,32 +144,32 @@ public interface IJobStore IJobDetail RetrieveJob(JobKey jobKey); /// - /// Store the given - /// The. + /// Store the given . /// to be stored. - /// If , any existing in + /// The to be stored. + /// If , any existing in /// the with the same name and group should /// be over-written. /// ObjectAlreadyExistsException void StoreTrigger(IOperableTrigger newTrigger, bool replaceExisting); ///- /// Remove (delete) the ///with the given key. + /// Remove (delete) the with the given key. /// /// ///- /// If removal of the
///results in an empty group, the + /// If removal of the results in an empty group, the /// group should be removed from the 's list of /// known group names. /// - /// If removal of the
///results in an 'orphaned' + /// If removal of the results in an 'orphaned' /// that is not 'durable', then the should be deleted /// also. /// - /// bool RemoveTrigger(TriggerKey triggerKey); @@ -177,53 +177,53 @@ public interface IJobStore bool RemoveTriggers(IListif a with the given + /// if a with the given /// name and group was found and removed from the store. /// triggerKeys); /// - /// Remove (delete) the - /// The newwith the + /// Remove (delete) the with the /// given name, and store the new given one - which must be associated /// with the same job. /// to be stored. + /// The new to be stored. /// - /// bool ReplaceTrigger(TriggerKey triggerKey, IOperableTrigger newTrigger); ///if a with the given + /// if a with the given /// name and group was found and removed from the store. /// - /// Retrieve the given ///. + /// Retrieve the given . /// - /// The desired IOperableTrigger RetrieveTrigger(TriggerKey triggerKey); - /** - * Determine whether a {@link Job} with the given identifier already - * exists within the scheduler. - * - * @param jobKey the identifier to check for - * @return true if a Job exists with the given identifier - * @throws SchedulerException - */ - bool CheckExists(JobKey jobKey); - - /** - * Determine whether a {@link Trigger} with the given identifier already - * exists within the scheduler. - * - * @param triggerKey the identifier to check for - * @return true if a Trigger exists with the given identifier - * @throws SchedulerException - */ - bool CheckExists(TriggerKey triggerKey); - - /** - * Clear (delete!) all scheduling data - all {@link Job}s, {@link Trigger}s - * {@link Calendar}s. - * - * @throws JobPersistenceException - */ + ///, or null if there is no + /// The desired , or null if there is no /// match. /// + /// Determine whether a + ///with the given identifier already + /// exists within the scheduler. + /// + /// + /// the identifier to check for + ///true if a job exists with the given identifier + bool CheckExists(JobKey jobKey); + + ///+ /// Determine whether a + ///with the given identifier already + /// exists within the scheduler. + /// + /// + /// the identifier to check for + ///true if a trigger exists with the given identifier + bool CheckExists(TriggerKey triggerKey); + + ///+ /// Clear (delete!) all scheduling data - all {@link Job}s, {@link Trigger}s + /// {@link Calendar}s. + /// + ///+ /// void ClearAllSchedulingData(); ///@@ -234,7 +234,7 @@ public interface IJobStore /// If ///, any existing /// in the with the same name and group /// should be over-written. - /// If , any s existing + /// If , any s existing /// in the that reference an existing /// Calendar with the same name with have their next fire time /// re-computed with the new . @@ -247,7 +247,7 @@ public interface IJobStore /// /// If removal of the /// The name of thewould result in - /// s pointing to non-existent calendars, then a + /// s pointing to non-existent calendars, then a /// will be thrown. /// to be removed. @@ -258,7 +258,7 @@ public interface IJobStore bool RemoveCalendar(string calName); /// - /// Retrieve the given /// The name of the. + /// Retrieve the given . /// to be retrieved. /// @@ -276,7 +276,7 @@ public interface IJobStore int GetNumberOfJobs(); /// - /// Get the number of ///s that are + /// Get the number of s that are /// stored in the . /// @@ -302,7 +302,7 @@ public interface IJobStore IList GetJobKeys(string groupName); /// - /// Get the names of all of the @@ -479,20 +479,20 @@ public interface IJobStore /// that will fire no later than the time represented in this value as /// milliseconds. ///s + /// Get the names of all of the s /// that have the given group name. /// /// If there are no triggers in the given group name, the result should be a @@ -322,7 +322,7 @@ public interface IJobStore IList
GetJobGroupNames(); /// - /// Get the names of all of the @@ -463,8 +463,8 @@ public interface IJobStore /// Resume (un-pause) all triggers - equivalent of calling+ /// Get the names of all of the /// groups. /// /// If there are no known group names, the result should be a zero-length @@ -351,7 +351,7 @@ public interface IJobStore IList
GetTriggersForJob(JobKey jobKey); /// - /// Get the current state of the identified ///. + /// Get the current state of the identified . /// TriggerState GetTriggerState(TriggerKey triggerKey); @@ -363,12 +363,12 @@ public interface IJobStore ///////////////////////////////////////////////////////////////////////////// /// - /// Pause the void PauseTrigger(TriggerKey triggerKey); ///with the given key. + /// Pause the with the given key. /// - /// Pause all of the ///s in the + /// Pause all of the s in the /// given group. /// @@ -380,13 +380,13 @@ public interface IJobStore /// /// Pause the void PauseJob(JobKey jobKey); ///with the given key - by - /// pausing all of its current s. + /// pausing all of its current s. /// /// Pause all of the @@ -441,8 +441,8 @@ public interface IJobStore /// Resume (un-pause) all of thes in the given - /// group - by pausing all of their s. + /// group - by pausing all of their s. /// /// The JobStore should "remember" that the group is paused, and impose the /// pause on any new jobs that are added to the group while the group is @@ -398,12 +398,12 @@ public interface IJobStore void PauseJobGroup(string groupName); ///
- /// Resume (un-pause) the ///with the + /// Resume (un-pause) the with the /// given key. /// /// - /// If the
///missed one or more fire-times, then the - /// 's misfire instruction will be applied. + /// If the missed one or more fire-times, then the + /// 's misfire instruction will be applied. /// @@ -411,11 +411,11 @@ public interface IJobStore void ResumeTrigger(TriggerKey triggerKey); /// - /// Resume (un-pause) all of the void ResumeTriggerGroup(string groupName); @@ -430,8 +430,8 @@ public interface IJobStore /// Resume (un-pause) thes + /// Resume (un-pause) all of the s /// in the given group. /// - /// If any
///missed one or more fire-times, then the - /// 's misfire instruction will be applied. + /// If any missed one or more fire-times, then the + /// 's misfire instruction will be applied. /// with the /// given key. /// - /// If any of the
///'s s missed one - /// or more fire-times, then the 's misfire + /// If any of the 's s missed one + /// or more fire-times, then the 's misfire /// instruction will be applied. /// s in /// the given group. /// - /// If any of the
///s had s that - /// missed one or more fire-times, then the 's + /// If any of the s had s that + /// missed one or more fire-times, then the 's /// misfire instruction will be applied. /// /// on every group. /// - /// If any
/// ///missed one or more fire-times, then the - /// 's misfire instruction will be applied. + /// If any missed one or more fire-times, then the + /// 's misfire instruction will be applied. /// - /// + /// /// IListAcquireNextTriggers(DateTimeOffset noLaterThan, int maxCount, TimeSpan timeWindow); /// /// Inform the void ReleaseAcquiredTrigger(IOperableTrigger trigger); ///that the scheduler no longer plans to - /// fire the given , that it had previously acquired + /// fire the given , that it had previously acquired /// (reserved). /// /// Inform the ///that the scheduler is now firing the - /// given (executing its associated ), + /// given (executing its associated ), /// that it had previously acquired (reserved). /// null if the trigger or it's job or calendar no longer exist, or @@ -503,7 +503,7 @@ public interface IJobStore /// /// Inform the that the scheduler has completed the - /// firing of the given (and the execution its + /// firing of the given (and the execution its /// associated ), and that the /// in the given should be updated if the /// is stateful. diff --git a/src/Quartz/SPI/IMutableTrigger.cs b/src/Quartz/SPI/IMutableTrigger.cs index 12dbcd7f8..d692968fb 100644 --- a/src/Quartz/SPI/IMutableTrigger.cs +++ b/src/Quartz/SPI/IMutableTrigger.cs @@ -8,92 +8,87 @@ public interface IMutableTrigger : ITrigger new JobKey JobKey { set; get; } - /** - * - * Set a description for the
- */ + ///Trigger
instance - may be - * useful for remembering/displaying the purpose of the trigger, though the - * description has no meaning to Quartz. - *+ /// Set a description for the new string Description { get; set; } - /** - *Trigger
instance - may be + /// useful for remembering/displaying the purpose of the trigger, though the + /// description has no meaning to Quartz. + ///- * Associate the
- * - * @param calendarName - * use{@link Calendar}
with the given name with - * this Trigger. - *null
to dis-associate a Calendar. - */ + ///+ /// + ///+ /// Associate the
+ ///{@link Calendar}
with the given name with + /// this Trigger. + ///+ /// new string CalendarName { set; get; } - /** - *- * Set the
- */ - new JobDataMap JobDataMap { get; set; } + ///JobDataMap
to be associated with the - *Trigger
. - *+ /// Set the + new JobDataMap JobDataMap { get; set; } - /** - * The priority of aJobDataMap
to be associated with the + ///Trigger
. + ///Trigger
acts as a tie breaker such that if - * twoTrigger
s have the same scheduled fire time, then Quartz - * will do its best to give the one with the higher priority first access - * to a worker thread. - * - *- * If not explicitly set, the default value is
- * - * @see #DEFAULT_PRIORITY - */ - new int Priority { get; set; } + ///5
. - *+ /// The priority of a + ///Trigger
acts as a tie breaker such that if + /// twoTrigger
s have the same scheduled fire time, then Quartz + /// will do its best to give the one with the higher priority first access + /// to a worker thread. + ///+ /// + ///+ /// If not explicitly set, the default value is
+ ///5
. + ///+ new int Priority { get; set; } - /** - * - * The time at which the trigger's scheduling should start. May or may not - * be the first actual fire time of the trigger, depending upon the type of - * trigger and the settings of the other properties of the trigger. However - * the first actual first time will not be before this date. - *
- *- * Setting a value in the past may cause a new trigger to compute a first - * fire time that is in the past, which may cause an immediate misfire - * of the trigger. - *
- */ - new DateTimeOffset StartTimeUtc { get; set; } + ///+ /// + new DateTimeOffset StartTimeUtc { get; set; } - /** - *+ /// The time at which the trigger's scheduling should start. May or may not + /// be the first actual fire time of the trigger, depending upon the type of + /// trigger and the settings of the other properties of the trigger. However + /// the first actual first time will not be before this date. + ///
+ ///+ /// Setting a value in the past may cause a new trigger to compute a first + /// fire time that is in the past, which may cause an immediate misfire + /// of the trigger. + ///
+ /// ew DateTimeOffset StartTimeUtc { get; set; } + ///- * Set the time at which the
- * - * @see TriggerUtils#computeEndTimeToAllowParticularNumberOfFirings(Trigger, Calendar, int) - */ - new DateTimeOffset? EndTimeUtc { get; set; } + ///Trigger
should quit repeating - - * regardless of any remaining repeats (based on the trigger's particular - * repeat settings). - *+ /// + ///+ /// Set the time at which the
+ ///Trigger
should quit repeating - + /// regardless of any remaining repeats (based on the trigger's particular + /// repeat settings). + ///+ /// + new DateTimeOffset? EndTimeUtc { get; set; } - /** - *- * Set the instruction the
- * - *Scheduler
should be given for - * handling misfire situations for thisTrigger
- the - * concreteTrigger
type that you are using will have - * defined a set of additionalMISFIRE_INSTRUCTION_XXX
- * constants that may be passed to this method. - *- * If not explicitly set, the default value is
- * - * @see #MISFIRE_INSTRUCTION_SMART_POLICY - * @see #updateAfterMisfire(Calendar) - * @see SimpleTrigger - * @see CronTrigger - */ - new int MisfireInstruction { get; set; } + ///MISFIRE_INSTRUCTION_SMART_POLICY
. - *+ /// + ///+ /// Set the instruction the
+ ///Scheduler
should be given for + /// handling misfire situations for thisTrigger
- the + /// concreteTrigger
type that you are using will have + /// defined a set of additionalMISFIRE_INSTRUCTION_XXX
+ /// constants that may be passed to this method. + ///+ /// + ///+ /// If not explicitly set, the default value is
+ ///MISFIRE_INSTRUCTION_SMART_POLICY
. + ///+ /// + /// + new int MisfireInstruction { get; set; } } } \ No newline at end of file diff --git a/src/Quartz/SPI/IOperableTrigger.cs b/src/Quartz/SPI/IOperableTrigger.cs index 70c02fd9c..74cb57812 100644 --- a/src/Quartz/SPI/IOperableTrigger.cs +++ b/src/Quartz/SPI/IOperableTrigger.cs @@ -4,138 +4,110 @@ namespace Quartz.Spi { public interface IOperableTrigger : IMutableTrigger { - /** - * - * This method should not be used by the Quartz client. - *
- * - *- * Called when the
- * - * @see #executionComplete(JobExecutionContext, JobExecutionException) - */ + ///{@link Scheduler}
has decided to 'fire' - * the trigger (execute the associatedJob
), in order to - * give theTrigger
a chance to update itself for its next - * triggering (if any). - *+ /// This method should not be used by the Quartz client. + /// + ///+ /// Called when the + ///has decided to 'fire' + /// the trigger (Execute the associated ), in order to + /// give the a chance to update itself for its next + /// triggering (if any). + /// void Triggered(ICalendar calendar); - /** - * - * This method should not be used by the Quartz client. - *
- * - *- * Called by the scheduler at the time a
- * - *Trigger
is first - * added to the scheduler, in order to have theTrigger
- * compute its first fire time, based on any associated calendar. - *- * After this method has been called,
- * - * @return the first time at which thegetNextFireTime()
- * should return a valid answer. - *Trigger
will be fired - * by the scheduler, which is also the same valuegetNextFireTime()
- * will return (until after the first firing of theTrigger
). - *+ /// This method should not be used by the Quartz client. + /// + ///+ /// + ///+ /// Called by the scheduler at the time a
+ /// + ///is first + /// added to the scheduler, in order to have the + /// compute its first fire time, based on any associated calendar. + /// + /// After this method has been called,
+ ///+ /// should return a valid answer. + /// + /// The first time at which the DateTimeOffset? ComputeFirstFireTimeUtc(ICalendar calendar); - /** - *will be fired + /// by the scheduler, which is also the same value + /// will return (until after the first firing of the ). + /// - * This method should not be used by the Quartz client. - *
- * - *- * Called after the
- * - * @param context - * is the{@link Scheduler}
has executed the - *{@link org.quartz.JobDetail}
associated with theTrigger
- * in order to get the final instruction code from the trigger. - *JobExecutionContext
that was used by the - *Job
'sexecute(xx)
method. - * @param result - * is theJobExecutionException
thrown by the - *Job
, if any (may be null). - * @return one of the Trigger.INSTRUCTION_XXX constants. - * - * @see #INSTRUCTION_NOOP - * @see #INSTRUCTION_RE_EXECUTE_JOB - * @see #INSTRUCTION_DELETE_TRIGGER - * @see #INSTRUCTION_SET_TRIGGER_COMPLETE - * @see #triggered(Calendar) - */ - + ///+ /// This method should not be used by the Quartz client. + /// + ///+ /// Called after the + /// + /// is thehas executed the + /// associated with the + /// in order to get the final instruction code from the trigger. + /// that was used by the + /// 's method. + /// is the thrown by the + /// , if any (may be null). + /// + /// + /// One of the + ///members. + /// + /// + /// + /// + /// SchedulerInstruction ExecutionComplete(IJobExecutionContext context, JobExecutionException result); - /** - * - * This method should not be used by the Quartz client. - *
- * - *- * To be implemented by the concrete classes that extend this class. - *
- * - *- * The implementation should update the
- */ + ///Trigger
's state - * based on the MISFIRE_INSTRUCTION_XXX that was selected when theTrigger
- * was created. - *+ /// This method should not be used by the Quartz client. + /// void UpdateAfterMisfire(ICalendar cal); - /** - *+ /// To be implemented by the concrete classes that extend this class. + ///
+ ///+ /// The implementation should update the
+ ///'s state + /// based on the MISFIRE_INSTRUCTION_XXX that was selected when the + /// was created. + /// - * This method should not be used by the Quartz client. - *
- * - *- * To be implemented by the concrete class. - *
- * - *- * The implementation should update the
- * - * @param cal - */ + ///Trigger
's state - * based on the given new version of the associatedCalendar
- * (the state should be updated so that it's next fire time is appropriate - * given the Calendar's new settings). - *+ /// This method should not be used by the Quartz client. + /// + /// + /// void UpdateWithNewCalendar(ICalendar cal, TimeSpan misfireThreshold); - /** - *+ /// The implementation should update the
+ ///'s state + /// based on the given new version of the associated + /// (the state should be updated so that it's next fire time is appropriate + /// given the Calendar's new settings). + /// - * Validates whether the properties of the
JobDetail
are - * valid for submission into aScheduler
. - * - * @throws IllegalStateException - * if a required property (such as Name, Group, Class) is not - * set. - */ + ///+ /// Validates whether the properties of the void Validate(); - /** - *are + /// valid for submission into a . + /// - * This method should not be used by the Quartz client. - *
- * - *- * Usable by
- * - * - */ + ///{@link org.quartz.spi.JobStore}
- * implementations, in order to facilitate 'recognizing' instances of fired - *Trigger
s as their jobs complete execution. - *+ /// This method should not be used by the Quartz client. + /// + ///+ /// Usable by string FireInstanceId { get; set; } - DateTimeOffset? NextFireTimeUtc { set; } + void SetNextFireTimeUtc(DateTimeOffset? value); + + void SetPreviousFireTimeUtc(DateTimeOffset? value); } } \ No newline at end of file diff --git a/src/Quartz/SchedulerConstants.cs b/src/Quartz/SchedulerConstants.cs index 89f5aae85..aaf81ee1d 100644 --- a/src/Quartz/SchedulerConstants.cs +++ b/src/Quartz/SchedulerConstants.cs @@ -29,50 +29,50 @@ public struct SchedulerConstants { ///+ /// implementations, in order to facilitate 'recognizing' instances of fired + /// s as their jobs complete execution. + /// /// A (possibly) useful constant that can be used for specifying the group - /// that public const string DefaultGroup = Keyand instances belong to. + /// that and instances belong to. /// .DefaultGroup; /// - /// A constant public const string DefaultRecoveryGroup = "RECOVERING_JOBS"; ///group name used internally by the + /// A constant group name used internally by the /// scheduler - clients should not use the value of this constant - /// ("RECOVERING_JOBS") for thename of a 's group. + /// ("RECOVERING_JOBS") for thename of a 's group. /// - /// A constant public const string DefaultFailOverGroup = "FAILED_OVER_JOBS"; ///group name used internally by the + /// A constant group name used internally by the /// scheduler - clients should not use the value of this constant - /// ("FAILED_OVER_JOBS") for thename of a 's group. + /// ("FAILED_OVER_JOBS") for thename of a 's group. /// /// A constant - ///key that can be used to retrieve the - /// name of the original from a recovery trigger's + /// name of the original from a recovery trigger's /// data map in the case of a job recovering after a failed scheduler /// instance. /// + /// public const string FailedJobOriginalTriggerName = "QRTZ_FAILED_JOB_ORIG_TRIGGER_NAME"; /// /// A constant - ///key that can be used to retrieve the - /// group of the original from a recovery trigger's + /// group of the original from a recovery trigger's /// data map in the case of a job recovering after a failed scheduler /// instance. /// + /// public const string FailedJobOriginalTriggerGroup = "QRTZ_FAILED_JOB_ORIG_TRIGGER_GROUP"; /// /// A constant - ///key that can be used to retrieve the - /// scheduled fire time of the original from a recovery + /// scheduled fire time of the original from a recovery /// trigger's data map in the case of a job recovering after a failed scheduler /// instance. /// + /// public const string FailedJobOriginalTriggerFiretimeInMillisecoonds = "QRTZ_FAILED_JOB_ORIG_TRIGGER_FIRETIME_IN_MILLISECONDS_AS_STRING"; } diff --git a/src/Quartz/SchedulerInstruction.cs b/src/Quartz/SchedulerInstruction.cs index e963f8ae1..499c478a4 100644 --- a/src/Quartz/SchedulerInstruction.cs +++ b/src/Quartz/SchedulerInstruction.cs @@ -26,14 +26,14 @@ namespace Quartz public enum SchedulerInstruction { /// - /// Instructs the NoInstruction, ///that the + /// Instructs the that the /// has no further instructions. /// - /// Instructs the that the - /// wants the to re-Execute + /// Instructs the that the + /// wants the to re-Execute /// immediately. If not in a 'RECOVERING' or 'FAILED_OVER' situation, the /// execution context will be re-used (giving the the /// ability to 'see' anything placed in the context by its last execution). @@ -41,33 +41,33 @@ public enum SchedulerInstruction ReExecuteJob, /// - /// Instructs the SetTriggerComplete, ///that the + /// Instructs the that the /// should be put in the state. /// - /// Instructs the DeleteTrigger, ///that the + /// Instructs the that the /// wants itself deleted. /// - /// Instructs the SetAllJobTriggersComplete, ///that all - /// s referencing the same as + /// Instructs the that all + /// s referencing the same as /// this one should be put in the state. /// - /// Instructs the SetAllJobTriggersError, ///that all - /// s referencing the same as + /// Instructs the that all + /// s referencing the same as /// this one should be put in the state. /// - /// Instructs the SetTriggerError diff --git a/src/Quartz/Simpl/PropertySettingJobFactory.cs b/src/Quartz/Simpl/PropertySettingJobFactory.cs index 7ec4d4e35..ed8a5932a 100644 --- a/src/Quartz/Simpl/PropertySettingJobFactory.cs +++ b/src/Quartz/Simpl/PropertySettingJobFactory.cs @@ -31,12 +31,12 @@ namespace Quartz.Simpl ///that the + /// Instructs the that the /// should be put in the state. /// /// A JobFactory that instantiates the Job instance (using the default no-arg /// constructor, or more specifically: ///), and - /// then attempts to set all values in the 's + /// then attempts to set all values in the 's /// onto bean properties of the . /// /// - /// + /// /// /// /// James Houser @@ -85,7 +85,7 @@ public virtual bool WarnIfPropertyNotFound /// configuration problem led to the issue wih instantiating the Job. ///+ /// The TriggerFiredBundle from which the /// and other info relating to the trigger firing can be obtained. /// the newly instantiated Job ///SchedulerException if there is a problem instantiating the Job. diff --git a/src/Quartz/Simpl/RAMJobStore.cs b/src/Quartz/Simpl/RAMJobStore.cs index e46776e32..066b6ff69 100644 --- a/src/Quartz/Simpl/RAMJobStore.cs +++ b/src/Quartz/Simpl/RAMJobStore.cs @@ -142,7 +142,7 @@ public virtual bool SupportsPersistence ///- /// Clears (deletes!) all scheduling data - all public void ClearAllSchedulingData() @@ -185,10 +185,10 @@ protected ILog Log } ///s, s + /// Clears (deletes!) all scheduling data - all s, s /// s. /// - /// Store the given /// Theand . + /// Store the given and . /// to be stored. - /// The to be stored. + /// The to be stored. public virtual void StoreJobAndTrigger(IJobDetail newJob, IOperableTrigger newTrigger) { StoreJob(newJob, false); @@ -262,7 +262,7 @@ public virtual void StoreJob(IJobDetail newJob, bool replaceExisting) /// /// Remove (delete) the ///with the given - /// name, and any s that reference + /// name, and any s that reference /// it. /// @@ -371,11 +371,11 @@ public void StoreJobsAndTriggers(IDictionary > trigge } /// - /// Remove (delete) the ///with the + /// Remove (delete) the with the /// given name. /// - /// public virtual bool RemoveTrigger(TriggerKey triggerKey) @@ -384,10 +384,10 @@ public virtual bool RemoveTrigger(TriggerKey triggerKey) } ///if a with the given + /// if a with the given /// name and group was found and removed from the store. /// - /// Store the given - /// The. + /// Store the given . /// to be stored. - /// If , any existing in + /// The to be stored. + /// If , any existing in /// the with the same name and group should /// be over-written. public virtual void StoreTrigger(IOperableTrigger newTrigger, bool replaceExisting) @@ -451,11 +451,11 @@ public virtual void StoreTrigger(IOperableTrigger newTrigger, bool replaceExisti } /// - /// Remove (delete) the ///with the + /// Remove (delete) the with the /// given name. /// - /// /// Whether to delete orpahaned job details from scheduler if job becomes orphaned from removing the trigger. @@ -595,10 +595,10 @@ public virtual IJobDetail RetrieveJob(JobKey jobKey) } ///if a with the given + /// if a with the given /// name and group was found and removed from the store. /// - /// Retrieve the given ///. + /// Retrieve the given . /// - /// The desired public virtual IOperableTrigger RetrieveTrigger(TriggerKey triggerKey) { @@ -643,7 +643,7 @@ public bool CheckExists(TriggerKey triggerKey) } ///, or null if there is no match. + /// The desired , or null if there is no match. /// - /// Get the current state of the identified ///. + /// Get the current state of the identified . /// /// @@ -694,7 +694,7 @@ public virtual TriggerState GetTriggerState(TriggerKey triggerKey) /// If , any existing /// in the with the same name and group /// should be over-written. - /// If , any s existing + /// If , any s existing /// in the that reference an existing /// Calendar with the same name with have their next fire time /// re-computed with the new . @@ -744,7 +744,7 @@ public virtual void StoreCalendar(string name, ICalendar calendar, bool replaceE /// given name. /// /// If removal of the
///would result in - /// s pointing to non-existent calendars, then a + /// s pointing to non-existent calendars, then a /// will be thrown. to be removed. @@ -777,7 +777,7 @@ public virtual bool RemoveCalendar(string calName) } /// - /// Retrieve the given /// The name of the. + /// Retrieve the given . /// to be retrieved. /// @@ -810,7 +810,7 @@ public virtual int GetNumberOfJobs() } /// - /// Get the number of public virtual int GetNumberOfTriggers() @@ -881,7 +881,7 @@ public virtual ILists that are + /// Get the number of s that are /// stored in the . /// GetCalendarNames() } /// - /// Get the names of all of the public virtual ILists + /// Get the names of all of the s /// that have the given group name. /// GetTriggerKeys(string groupName) @@ -925,7 +925,7 @@ public virtual IList GetJobGroupNames() } /// - /// Get the names of all of the public virtual IListgroups. + /// Get the names of all of the groups. /// GetTriggerGroupNames() { @@ -1009,7 +1009,7 @@ protected virtual List GetTriggerWrappersForCalendar(string calN } /// - /// Pause the public virtual void PauseTrigger(TriggerKey triggerKey) { @@ -1041,7 +1041,7 @@ public virtual void PauseTrigger(TriggerKey triggerKey) } ///with the given name. + /// Pause the with the given name. /// - /// Pause all of the @@ -1266,8 +1266,8 @@ public virtual void PauseAll() /// Resume (un-pause) all triggers - equivalent of callings in the given group. + /// Pause all of the s in the given group. /// /// The JobStore should "remember" that the group is paused, and impose the /// pause on any new triggers that are added to the group while the group is @@ -1068,7 +1068,7 @@ public virtual void PauseTriggerGroup(string groupName) ///
/// Pause the public virtual void PauseJob(JobKey jobKey) { @@ -1084,7 +1084,7 @@ public virtual void PauseJob(JobKey jobKey) ///with the given - /// name - by pausing all of its current s. + /// name - by pausing all of its current s. /// /// Pause all of the @@ -1214,8 +1214,8 @@ public virtual void ResumeJob(JobKey jobKey) /// Resume (un-pause) all of thes in the - /// given group - by pausing all of their s. + /// given group - by pausing all of their s. /// /// The JobStore should "remember" that the group is paused, and impose the /// pause on any new jobs that are added to the group while the group is @@ -1113,11 +1113,11 @@ public virtual void PauseJobGroup(string groupName) } ///
- /// Resume (un-pause) the ///with the given key. + /// Resume (un-pause) the with the given key. /// - /// If the public virtual void ResumeTrigger(TriggerKey triggerKey) { @@ -1160,11 +1160,11 @@ public virtual void ResumeTrigger(TriggerKey triggerKey) } ///missed one or more fire-times, then the - /// 's misfire instruction will be applied. + /// If the missed one or more fire-times, then the + /// 's misfire instruction will be applied. /// - /// Resume (un-pause) all of the public virtual void ResumeTriggerGroup(string groupName) @@ -1193,8 +1193,8 @@ public virtual void ResumeTriggerGroup(string groupName) /// Resume (un-pause) thes in the + /// Resume (un-pause) all of the s in the /// given group. /// - /// If any
///missed one or more fire-times, then the - /// 's misfire instruction will be applied. + /// If any missed one or more fire-times, then the + /// 's misfire instruction will be applied. /// with /// the given name. /// - /// If any of the
///'s s missed one - /// or more fire-times, then the 's misfire + /// If any of the 's s missed one + /// or more fire-times, then the 's misfire /// instruction will be applied. /// s /// in the given group. /// - /// If any of the
///s had s that - /// missed one or more fire-times, then the 's + /// If any of the s had s that + /// missed one or more fire-times, then the 's /// misfire instruction will be applied. /// /// on every trigger group and setting all job groups unpaused />. /// - /// If any
/// ///missed one or more fire-times, then the - /// 's misfire instruction will be applied. + /// If any missed one or more fire-times, then the + /// 's misfire instruction will be applied. /// @@ -1336,7 +1336,7 @@ protected internal virtual bool ApplyMisfire(TriggerWrapper tw) /// Get a handle to the next trigger to be fired, and mark it as 'reserved' /// by the calling scheduler. /// - /// + /// public virtual IList AcquireNextTriggers(DateTimeOffset noLaterThan, int maxCount, TimeSpan timeWindow) { lock (lockObject) @@ -1390,7 +1390,7 @@ public virtual IList AcquireNextTriggers(DateTimeOffset noLate /// /// Inform the public virtual void ReleaseAcquiredTrigger(IOperableTrigger trigger) @@ -1408,7 +1408,7 @@ public virtual void ReleaseAcquiredTrigger(IOperableTrigger trigger) ///that the scheduler no longer plans to - /// fire the given , that it had previously acquired + /// fire the given , that it had previously acquired /// (reserved). /// /// Inform the public virtual IListthat the scheduler is now firing the - /// given (executing its associated ), + /// given (executing its associated ), /// that it had previously acquired (reserved). /// TriggersFired(IList triggers) @@ -1440,7 +1440,7 @@ public virtual IList TriggersFired(IList t return null; } } - DateTimeOffset? prevFireTime = trigger.PreviousFireTimeUtc; + DateTimeOffset? prevFireTime = trigger.GetPreviousFireTimeUtc(); // in case trigger was replaced between acquiring and firing timeTriggers.Remove(tw); // call triggered on our copy, and the scheduler's copy @@ -1453,7 +1453,7 @@ public virtual IList TriggersFired(IList t trigger, cal, false, SystemTime.UtcNow(), - trigger.PreviousFireTimeUtc, prevFireTime, + trigger.GetPreviousFireTimeUtc(), prevFireTime, trigger.GetNextFireTimeUtc()); IJobDetail job = bndle.JobDetail; @@ -1491,7 +1491,7 @@ public virtual IList TriggersFired(IList t /// /// Inform the that the scheduler has completed the - /// firing of the given (and the execution its + /// firing of the given (and the execution its /// associated ), and that the /// in the given should be updated if the /// is stateful. diff --git a/src/Quartz/Simpl/SimpleJobFactory.cs b/src/Quartz/Simpl/SimpleJobFactory.cs index ff488dfb9..61524f85c 100644 --- a/src/Quartz/Simpl/SimpleJobFactory.cs +++ b/src/Quartz/Simpl/SimpleJobFactory.cs @@ -52,7 +52,7 @@ public class SimpleJobFactory : IJobFactory /// intervention (e.g. an application restart after fixing whatever /// configuration problem led to the issue wih instantiating the Job. /// - /// The TriggerFiredBundle from which the + /// The TriggerFiredBundle from which the /// and other info relating to the trigger firing can be obtained. /// the newly instantiated Job ///SchedulerException if there is a problem instantiating the Job. diff --git a/src/Quartz/SimpleScheduleBuilder.cs b/src/Quartz/SimpleScheduleBuilder.cs index dd3db0d52..3465027c2 100644 --- a/src/Quartz/SimpleScheduleBuilder.cs +++ b/src/Quartz/SimpleScheduleBuilder.cs @@ -26,42 +26,38 @@ namespace Quartz { -/** - *SimpleScheduleBuilder
is a {@link ScheduleBuilder} - * that defines strict/literal interval-based schedules for - *Trigger
s. - * - *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 variousScheduleBuilder
implementations.Client code can then use the DSL to write code such as this:
- *- * JobDetail job = newJob(MyJob.class) - * .withIdentity("myJob") - * .build(); - * - * Trigger trigger = newTrigger() - * .withIdentity(triggerKey("myTrigger", "myTriggerGroup")) - * .withSchedule(simpleSchedule() - * .withIntervalInHours(1) - * .repeatForever()) - * .startAt(futureDate(10, MINUTES)) - * .build(); - * - * scheduler.scheduleJob(job, trigger); - *- * - * @see SimpleTrigger - * @see CalenderIntervalScheduleBuilder - * @see CronScheduleBuilder - * @see ScheduleBuilder - * @see TriggerBuilder - */ - + ///+ /// + ///SimpleScheduleBuilder
is a {@link ScheduleBuilder} + /// that defines strict/literal interval-based schedules for + ///Trigger
s. + ///+ /// + ///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 variousScheduleBuilder
implementations.Client code can then use the DSL to write code such as this:
+ ///+ /// JobDetail job = newJob(MyJob.class) + /// .withIdentity("myJob") + /// .build(); + /// Trigger trigger = newTrigger() + /// .withIdentity(triggerKey("myTrigger", "myTriggerGroup")) + /// .withSchedule(simpleSchedule() + /// .withIntervalInHours(1) + /// .repeatForever()) + /// .startAt(futureDate(10, MINUTES)) + /// .build(); + /// scheduler.scheduleJob(job, trigger); + ///+ ///+ /// + /// + /// + /// public class SimpleScheduleBuilder : ScheduleBuilder { private TimeSpan interval = TimeSpan.Zero; @@ -73,119 +69,118 @@ private SimpleScheduleBuilder() } - /** - * Create a SimpleScheduleBuilder. - * - * @return the new SimpleScheduleBuilder - */ - - public static SimpleScheduleBuilder SimpleSchedule() + /// + /// Create a SimpleScheduleBuilder. + /// + ///+ /// + ///the new SimpleScheduleBuilder + public static SimpleScheduleBuilder Create() { return new SimpleScheduleBuilder(); } - /** - * Create a SimpleScheduleBuilder set to repeat forever with a 1 minute interval. - * - * @return the new SimpleScheduleBuilder - */ - + ///+ /// Create a SimpleScheduleBuilder set to repeat forever with a 1 minute interval. + /// + ///+ /// + ///the new SimpleScheduleBuilder public static SimpleScheduleBuilder RepeatMinutelyForever() { - SimpleScheduleBuilder sb = SimpleSchedule() + SimpleScheduleBuilder sb = Create() .WithInterval(TimeSpan.FromMinutes(1)) .RepeatForever(); return sb; } - /** - * Create a SimpleScheduleBuilder set to repeat forever with an interval - * of the given number of minutes. - * - * @return the new SimpleScheduleBuilder - */ - + ///+ /// Create a SimpleScheduleBuilder set to repeat forever with an interval + /// of the given number of minutes. + /// + ///+ /// + ///the new SimpleScheduleBuilder public static SimpleScheduleBuilder RepeatMinutelyForever(int minutes) { - SimpleScheduleBuilder sb = SimpleSchedule() + SimpleScheduleBuilder sb = Create() .WithInterval(TimeSpan.FromMinutes(minutes)) .RepeatForever(); return sb; } - /** - * Create a SimpleScheduleBuilder set to repeat forever with a 1 second interval. - * - * @return the new SimpleScheduleBuilder - */ - + ///+ /// Create a SimpleScheduleBuilder set to repeat forever with a 1 second interval. + /// + ///+ /// + ///the new SimpleScheduleBuilder public static SimpleScheduleBuilder RepeatSecondlyForever() { - SimpleScheduleBuilder sb = SimpleSchedule() + SimpleScheduleBuilder sb = Create() .WithInterval(TimeSpan.FromSeconds(1)) .RepeatForever(); return sb; } - /** - * Create a SimpleScheduleBuilder set to repeat forever with an interval - * of the given number of seconds. - * - * @return the new SimpleScheduleBuilder - */ - + ///+ /// Create a SimpleScheduleBuilder set to repeat forever with an interval + /// of the given number of seconds. + /// + ///+ /// + ///the new SimpleScheduleBuilder public static SimpleScheduleBuilder RepeatSecondlyForever(int seconds) { - SimpleScheduleBuilder sb = SimpleSchedule() + SimpleScheduleBuilder sb = Create() .WithInterval(TimeSpan.FromSeconds(seconds)) .RepeatForever(); return sb; } - /** - * Create a SimpleScheduleBuilder set to repeat forever with a 1 hour interval. - * - * @return the new SimpleScheduleBuilder - */ - + ///+ /// Create a SimpleScheduleBuilder set to repeat forever with a 1 hour interval. + /// + ///+ /// + ///the new SimpleScheduleBuilder public static SimpleScheduleBuilder RepeatHourlyForever() { - SimpleScheduleBuilder sb = SimpleSchedule() + SimpleScheduleBuilder sb = Create() .WithInterval(TimeSpan.FromHours(1)) .RepeatForever(); return sb; } - /** - * Create a SimpleScheduleBuilder set to repeat forever with an interval - * of the given number of hours. - * - * @return the new SimpleScheduleBuilder - */ - + ///+ /// Create a SimpleScheduleBuilder set to repeat forever with an interval + /// of the given number of hours. + /// + ///+ /// + ///the new SimpleScheduleBuilder public static SimpleScheduleBuilder RepeatHourlyForever(int hours) { - SimpleScheduleBuilder sb = SimpleSchedule() + SimpleScheduleBuilder sb = Create() .WithInterval(TimeSpan.FromHours(hours)) .RepeatForever(); return sb; } - /** - * Create a SimpleScheduleBuilder set to repeat the given number - * of times - 1 with a 1 minute interval. - * - *Note: Total count = 1 (at start time) + repeat count
- * - * @return the new SimpleScheduleBuilder - */ - + ///+ /// Create a SimpleScheduleBuilder set to repeat the given number + /// of times - 1 with a 1 minute interval. + /// + ///+ /// + ///Note: Total count = 1 (at start time) + repeat count
+ ///the new SimpleScheduleBuilder public static SimpleScheduleBuilder RepeatMinutelyForTotalCount(int count) { if (count < 1) @@ -193,22 +188,21 @@ public static SimpleScheduleBuilder RepeatMinutelyForTotalCount(int count) throw new ArgumentException("Total count of firings must be at least one! Given count: " + count); } - SimpleScheduleBuilder sb = SimpleSchedule() + SimpleScheduleBuilder sb = Create() .WithInterval(TimeSpan.FromMinutes(1)) .WithRepeatCount(count - 1); return sb; } - /** - * Create a SimpleScheduleBuilder set to repeat the given number - * of times - 1 with an interval of the given number of minutes. - * - *Note: Total count = 1 (at start time) + repeat count
- * - * @return the new SimpleScheduleBuilder - */ - + ///+ /// Create a SimpleScheduleBuilder set to repeat the given number + /// of times - 1 with an interval of the given number of minutes. + /// + ///+ /// + ///Note: Total count = 1 (at start time) + repeat count
+ ///the new SimpleScheduleBuilder public static SimpleScheduleBuilder RepeatMinutelyForTotalCount(int count, int minutes) { if (count < 1) @@ -216,22 +210,21 @@ public static SimpleScheduleBuilder RepeatMinutelyForTotalCount(int count, int m throw new ArgumentException("Total count of firings must be at least one! Given count: " + count); } - SimpleScheduleBuilder sb = SimpleSchedule() + SimpleScheduleBuilder sb = Create() .WithInterval(TimeSpan.FromMinutes(minutes)) .WithRepeatCount(count - 1); return sb; } - /** - * Create a SimpleScheduleBuilder set to repeat the given number - * of times - 1 with a 1 second interval. - * - *Note: Total count = 1 (at start time) + repeat count
- * - * @return the new SimpleScheduleBuilder - */ - + ///+ /// Create a SimpleScheduleBuilder set to repeat the given number + /// of times - 1 with a 1 second interval. + /// + ///+ /// + ///Note: Total count = 1 (at start time) + repeat count
+ ///the new SimpleScheduleBuilder public static SimpleScheduleBuilder RepeatSecondlyForTotalCount(int count) { if (count < 1) @@ -239,22 +232,21 @@ public static SimpleScheduleBuilder RepeatSecondlyForTotalCount(int count) throw new ArgumentException("Total count of firings must be at least one! Given count: " + count); } - SimpleScheduleBuilder sb = SimpleSchedule() + SimpleScheduleBuilder sb = Create() .WithInterval(TimeSpan.FromSeconds(1)) .WithRepeatCount(count - 1); return sb; } - /** - * Create a SimpleScheduleBuilder set to repeat the given number - * of times - 1 with an interval of the given number of seconds. - * - *Note: Total count = 1 (at start time) + repeat count
- * - * @return the new SimpleScheduleBuilder - */ - + ///+ /// Create a SimpleScheduleBuilder set to repeat the given number + /// of times - 1 with an interval of the given number of seconds. + /// + ///+ /// + ///Note: Total count = 1 (at start time) + repeat count
+ ///the new SimpleScheduleBuilder public static SimpleScheduleBuilder RepeatSecondlyForTotalCount(int count, int seconds) { if (count < 1) @@ -262,22 +254,21 @@ public static SimpleScheduleBuilder RepeatSecondlyForTotalCount(int count, int s throw new ArgumentException("Total count of firings must be at least one! Given count: " + count); } - SimpleScheduleBuilder sb = SimpleSchedule() + SimpleScheduleBuilder sb = Create() .WithInterval(TimeSpan.FromSeconds(seconds)) .WithRepeatCount(count - 1); return sb; } - /** - * Create a SimpleScheduleBuilder set to repeat the given number - * of times - 1 with a 1 hour interval. - * - *Note: Total count = 1 (at start time) + repeat count
- * - * @return the new SimpleScheduleBuilder - */ - + ///+ /// Create a SimpleScheduleBuilder set to repeat the given number + /// of times - 1 with a 1 hour interval. + /// + ///+ /// + ///Note: Total count = 1 (at start time) + repeat count
+ ///the new SimpleScheduleBuilder public static SimpleScheduleBuilder RepeatHourlyForTotalCount(int count) { if (count < 1) @@ -285,22 +276,21 @@ public static SimpleScheduleBuilder RepeatHourlyForTotalCount(int count) throw new ArgumentException("Total count of firings must be at least one! Given count: " + count); } - SimpleScheduleBuilder sb = SimpleSchedule() + SimpleScheduleBuilder sb = Create() .WithInterval(TimeSpan.FromHours(1)) .WithRepeatCount(count - 1); return sb; } - /** - * Create a SimpleScheduleBuilder set to repeat the given number - * of times - 1 with an interval of the given number of hours. - * - *Note: Total count = 1 (at start time) + repeat count
- * - * @return the new SimpleScheduleBuilder - */ - + ///+ /// Create a SimpleScheduleBuilder set to repeat the given number + /// of times - 1 with an interval of the given number of hours. + /// + ///+ /// + ///Note: Total count = 1 (at start time) + repeat count
+ ///the new SimpleScheduleBuilder public static SimpleScheduleBuilder RepeatHourlyForTotalCount(int count, int hours) { if (count < 1) @@ -308,21 +298,21 @@ public static SimpleScheduleBuilder RepeatHourlyForTotalCount(int count, int hou throw new ArgumentException("Total count of firings must be at least one! Given count: " + count); } - SimpleScheduleBuilder sb = SimpleSchedule() + SimpleScheduleBuilder sb = Create() .WithInterval(TimeSpan.FromHours(hours)) .WithRepeatCount(count - 1); return sb; } - /** - * Build the actual Trigger -- NOT intended to be invoked by end users, - * but will rather be invoked by a TriggerBuilder which this - * ScheduleBuilder is given to. - * - * @see TriggerBuilder#withSchedule(ScheduleBuilder) - */ - + ///+ /// Build the actual Trigger -- NOT intended to be invoked by end users, + /// but will rather be invoked by a TriggerBuilder which this + /// ScheduleBuilder is given to. + /// + ///+ /// + ///public override IMutableTrigger Build() { SimpleTriggerImpl st = new SimpleTriggerImpl(); @@ -332,134 +322,131 @@ public override IMutableTrigger Build() return st; } - /** - * Specify a repeat interval in milliseconds. - * - * @param intervalInMillis the number of seconds at which the trigger should repeat. - * @return the updated SimpleScheduleBuilder - * @see SimpleTrigger#getRepeatInterval() - * @see #withRepeatCount(int) - */ - + /// + /// Specify a repeat interval in milliseconds. + /// + ///+ /// + /// the time span at which the trigger should repeat. + ///the updated SimpleScheduleBuilder + ///+ /// public SimpleScheduleBuilder WithInterval(TimeSpan timeSpan) { this.interval = timeSpan; return this; } - /** - * Specify a the number of time the trigger will repeat - total number of - * firings will be this number + 1. - * - * @param repeatCount the number of seconds at which the trigger should repeat. - * @return the updated SimpleScheduleBuilder - * @see SimpleTrigger#getRepeatCount() - * @see #repeatForever(int) - */ - + /// + /// Specify a the number of time the trigger will repeat - total number of + /// firings will be this number + 1. + /// + ///+ /// + /// the number of seconds at which the trigger should repeat. + ///the updated SimpleScheduleBuilder + ///+ /// public SimpleScheduleBuilder WithRepeatCount(int repeatCount) { this.repeatCount = repeatCount; return this; } - /** - * Specify that the trigger will repeat indefinitely. - * - * @return the updated SimpleScheduleBuilder - * @see SimpleTrigger#getRepeatCount() - * @see SimpleTrigger#REPEAT_INDEFINITELY - * @see #withIntervalInMilliseconds(long) - * @see #withIntervalInSeconds(int) - * @see #withIntervalInMinutes(int) - * @see #withIntervalInHours(int) - */ - + /// + /// Specify that the trigger will repeat indefinitely. + /// + ///+ /// + ///the updated SimpleScheduleBuilder + ///+ /// + /// public SimpleScheduleBuilder RepeatForever() { - this.repeatCount = SimpleTriggerImpl.RepeatIndefinitely; + repeatCount = SimpleTriggerImpl.RepeatIndefinitely; return this; } - /** - * If the Trigger misfires, use the - * {@link Trigger#MISFIRE_INSTRUCTION_IGNORE_MISFIRE_POLICY} instruction. - * - * @return the updated CronScheduleBuilder - * @see Trigger#MISFIRE_INSTRUCTION_IGNORE_MISFIRE_POLICY - */ - + /// + /// If the Trigger misfires, use the + /// {@link Trigger#MISFIRE_INSTRUCTION_IGNORE_MISFIRE_POLICY} instruction. + /// + ///+ /// + ///the updated CronScheduleBuilder + ///public SimpleScheduleBuilder WithMisfireHandlingInstructionIgnoreMisfires() { misfireInstruction = MisfireInstruction.IgnoreMisfirePolicy; return this; } - /** - * If the Trigger misfires, use the - * {@link SimpleTrigger#MISFIRE_INSTRUCTION_FIRE_NOW} instruction. - * - * @return the updated SimpleScheduleBuilder - * @see SimpleTrigger#MISFIRE_INSTRUCTION_FIRE_NOW - */ - + /// + /// If the Trigger misfires, use the + /// + ///instruction. + /// + /// + ///the updated SimpleScheduleBuilder + ///public SimpleScheduleBuilder WithMisfireHandlingInstructionFireNow() { misfireInstruction = MisfireInstruction.SimpleTrigger.FireNow; return this; } - /** - * If the Trigger misfires, use the - * {@link SimpleTrigger#MISFIRE_INSTRUCTION_RESCHEDULE_NEXT_WITH_EXISTING_COUNT} instruction. - * - * @return the updated SimpleScheduleBuilder - * @see SimpleTrigger#MISFIRE_INSTRUCTION_RESCHEDULE_NEXT_WITH_EXISTING_COUNT - */ - + /// + /// If the Trigger misfires, use the + /// + ///instruction. + /// + /// + ///the updated SimpleScheduleBuilder + ///public SimpleScheduleBuilder WithMisfireHandlingInstructionNextWithExistingCount() { misfireInstruction = MisfireInstruction.SimpleTrigger.RescheduleNextWithExistingCount; return this; } - /** - * If the Trigger misfires, use the - * {@link SimpleTrigger#MISFIRE_INSTRUCTION_RESCHEDULE_NEXT_WITH_REMAINING_COUNT} instruction. - * - * @return the updated SimpleScheduleBuilder - * @see SimpleTrigger#MISFIRE_INSTRUCTION_RESCHEDULE_NEXT_WITH_REMAINING_COUNT - */ - + /// + /// If the Trigger misfires, use the + /// {@link SimpleTrigger#MISFIRE_INSTRUCTION_RESCHEDULE_NEXT_WITH_REMAINING_COUNT} instruction. + /// + ///+ /// + ///the updated SimpleScheduleBuilder + ///public SimpleScheduleBuilder WithMisfireHandlingInstructionNextWithRemainingCount() { misfireInstruction = MisfireInstruction.SimpleTrigger.RescheduleNextWithRemainingCount; return this; } - /** - * If the Trigger misfires, use the - * {@link SimpleTrigger#MISFIRE_INSTRUCTION_RESCHEDULE_NOW_WITH_EXISTING_REPEAT_COUNT} instruction. - * - * @return the updated SimpleScheduleBuilder - * @see SimpleTrigger#MISFIRE_INSTRUCTION_RESCHEDULE_NOW_WITH_EXISTING_REPEAT_COUNT - */ - + /// + /// If the Trigger misfires, use the + /// {@link SimpleTrigger#MISFIRE_INSTRUCTION_RESCHEDULE_NOW_WITH_EXISTING_REPEAT_COUNT} instruction. + /// + ///+ /// + ///the updated SimpleScheduleBuilder + ///public SimpleScheduleBuilder WithMisfireHandlingInstructionNowWithExistingCount() { misfireInstruction = MisfireInstruction.SimpleTrigger.RescheduleNowWithExistingRepeatCount; return this; } - /** - * If the Trigger misfires, use the - * {@link SimpleTrigger#MISFIRE_INSTRUCTION_RESCHEDULE_NOW_WITH_REMAINING_REPEAT_COUNT} instruction. - * - * @return the updated SimpleScheduleBuilder - * @see SimpleTrigger#MISFIRE_INSTRUCTION_RESCHEDULE_NOW_WITH_REMAINING_REPEAT_COUNT - */ - + /// + /// If the Trigger misfires, use the + /// {@link SimpleTrigger#MISFIRE_INSTRUCTION_RESCHEDULE_NOW_WITH_REMAINING_REPEAT_COUNT} instruction. + /// + ///+ /// + ///the updated SimpleScheduleBuilder + ///public SimpleScheduleBuilder WithMisfireHandlingInstructionNowWithRemainingCount() { misfireInstruction = MisfireInstruction.SimpleTrigger.RescheduleNowWithRemainingRepeatCount; diff --git a/src/Quartz/TriggerBuilder.cs b/src/Quartz/TriggerBuilder.cs index 72942d6a3..257d8b8ee 100644 --- a/src/Quartz/TriggerBuilder.cs +++ b/src/Quartz/TriggerBuilder.cs @@ -24,66 +24,36 @@ namespace Quartz { - /** - * TriggerBuilder
is used to instantiate {@link Trigger}s. - * - *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 variousScheduleBuilder
implementations.Client code can then use the DSL to write code such as this:
- *- * JobDetail job = newJob(MyJob.class) - * .withIdentity("myJob") - * .build(); - * - * Trigger trigger = newTrigger() - * .withIdentity(triggerKey("myTrigger", "myTriggerGroup")) - * .withSchedule(simpleSchedule() - * .withIntervalInHours(1) - * .repeatForever()) - * .startAt(futureDate(10, MINUTES)) - * .build(); - * - * scheduler.scheduleJob(job, trigger); - *- * - * @see JobBuilder - * @see ScheduleBuilder - * @see DateBuilder - * @see Trigger - */ - - public interface ITriggerBuilder/// - ///where T : ITrigger - { - T Build(); - TriggerBuilder WithIdentity(string name); - TriggerBuilder WithIdentity(string name, string group); - TriggerBuilder WithIdentity(TriggerKey key); - TriggerBuilder WithDescription(string description); - TriggerBuilder WithPriority(int priority); - TriggerBuilder ModifiedByCalendar(string calendarName); - TriggerBuilder StartAt(DateTimeOffset startTimeUtc); - TriggerBuilder StartNow(); - TriggerBuilder EndAt(DateTimeOffset? endTimeUtc); - TriggerBuilder WithSchedule(IScheduleBuilder scheduleBuilder); - TriggerBuilder ForJob(JobKey jobKey); - TriggerBuilder ForJob(string jobName); - TriggerBuilder ForJob(string jobName, string jobGroup); - TriggerBuilder ForJob(IJobDetail jobDetail); - TriggerBuilder UsingJobData(string key, string value); - TriggerBuilder UsingJobData(string key, int value); - TriggerBuilder UsingJobData(string key, long value); - TriggerBuilder UsingJobData(string key, float value); - TriggerBuilder UsingJobData(string key, Double value); - TriggerBuilder UsingJobData(string key, Boolean value); - TriggerBuilder UsingJobData(JobDataMap newJobDataMap); - } - - public class TriggerBuilder : ITriggerBuilder where T : ITrigger + /// + /// + ///TriggerBuilder
is used to instantiate {@link Trigger}s. + ///+ /// + ///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 variousScheduleBuilder
implementations.Client code can then use the DSL to write code such as this:
+ ///+ /// JobDetail job = newJob(MyJob.class) + /// .withIdentity("myJob") + /// .build(); + /// Trigger trigger = newTrigger() + /// .withIdentity(triggerKey("myTrigger", "myTriggerGroup")) + /// .withSchedule(simpleSchedule() + /// .withIntervalInHours(1) + /// .repeatForever()) + /// .startAt(futureDate(10, MINUTES)) + /// .build(); + /// scheduler.scheduleJob(job, trigger); + ///+ ///+ /// + /// + /// + public class TriggerBuilder where T : ITrigger { private TriggerKey key; private string description; @@ -100,29 +70,29 @@ private TriggerBuilder() { } - /** - * Create a new TriggerBuilder with which to define a - * specification for a Trigger. - * - * @return the new TriggerBuilder - */ - - public static TriggerBuilder NewTrigger() + /// + /// Create a new TriggerBuilder with which to define a + /// specification for a Trigger. + /// + ///+ /// + ///the new TriggerBuilder + public static TriggerBuilderCreate() { - return new TriggerBuilder (); + return new TriggerBuilder (); } - /** - * Produce the Trigger
. - * - * @return a Trigger that meets the specifications of the builder. - */ - + ///+ /// Produce the + ///Trigger
. + ///+ /// + ///a Trigger that meets the specifications of the builder. public T Build() { if (scheduleBuilder == null) { - scheduleBuilder = SimpleScheduleBuilder.SimpleSchedule(); + scheduleBuilder = SimpleScheduleBuilder.Create(); } IMutableTrigger trig = scheduleBuilder.Build(); @@ -149,237 +119,233 @@ public T Build() return (T) trig; } - /** - * Use aTriggerKey
with the given name and default group to - * identify the Trigger. - * - *If none of the 'withIdentity' methods are set on the TriggerBuilder, - * then a random, unique TriggerKey will be generated.
- * - * @param name the name element for the Trigger's TriggerKey - * @return the updated TriggerBuilder - * @see TriggerKey - * @see Trigger#getKey() - */ - + ///+ /// Use a + ///TriggerKey
with the given name and default group to + /// identify the Trigger. + ///+ /// + /// the name element for the Trigger's TriggerKey + ///If none of the 'withIdentity' methods are set on the TriggerBuilder, + /// then a random, unique TriggerKey will be generated.
+ ///the updated TriggerBuilder + ///+ /// public TriggerBuilder WithIdentity(string name) { key = new TriggerKey(name, null); return this; } - /** - * Use a TriggerKey with the given name and group to - * identify the Trigger. - * - * If none of the 'withIdentity' methods are set on the TriggerBuilder, - * then a random, unique TriggerKey will be generated.
- * - * @param name the name element for the Trigger's TriggerKey - * @param group the group element for the Trigger's TriggerKey - * @return the updated TriggerBuilder - * @see TriggerKey - * @see Trigger#getKey() - */ - + ///+ /// Use a TriggerKey with the given name and group to + /// identify the Trigger. + /// + ///+ /// + /// the name element for the Trigger's TriggerKey + /// the group element for the Trigger's TriggerKey + ///If none of the 'withIdentity' methods are set on the TriggerBuilder, + /// then a random, unique TriggerKey will be generated.
+ ///the updated TriggerBuilder + ///+ /// public TriggerBuilder WithIdentity(string name, string group) { key = new TriggerKey(name, group); return this; } - /** - * Use the given TriggerKey to identify the Trigger. - * - * If none of the 'withIdentity' methods are set on the TriggerBuilder, - * then a random, unique TriggerKey will be generated.
- * - * @param key the TriggerKey for the Trigger to be built - * @return the updated TriggerBuilder - * @see TriggerKey - * @see Trigger#getKey() - */ - + ///+ /// Use the given TriggerKey to identify the Trigger. + /// + ///+ /// + /// the TriggerKey for the Trigger to be built + ///If none of the 'withIdentity' methods are set on the TriggerBuilder, + /// then a random, unique TriggerKey will be generated.
+ ///the updated TriggerBuilder + ///+ /// public TriggerBuilder WithIdentity(TriggerKey key) { this.key = key; return this; } - /** - * Set the given (human-meaningful) description of the Trigger. - * - * @param description the description for the Trigger - * @return the updated TriggerBuilder - * @see Trigger#getDescription() - */ - + /// + /// Set the given (human-meaningful) description of the Trigger. + /// + ///+ /// + /// the description for the Trigger + ///the updated TriggerBuilder + ///public TriggerBuilder WithDescription(string description) { this.description = description; return this; } - /** - * Set the Trigger's priority. When more than one Trigger have the same - * fire time, the scheduler will fire the one with the highest priority - * first. - * - * @param priority the priority for the Trigger - * @return the updated TriggerBuilder - * @see Trigger#DEFAULT_PRIORITY - * @see Trigger#getPriority() - */ - + /// + /// Set the Trigger's priority. When more than one Trigger have the same + /// fire time, the scheduler will fire the one with the highest priority + /// first. + /// + ///+ /// + /// the priority for the Trigger + ///the updated TriggerBuilder + ///+ /// public TriggerBuilder WithPriority(int priority) { this.priority = priority; return this; } - /** - * Set the name of the {@link Calendar} that should be applied to this - * Trigger's schedule. - * - * @param calendarName the name of the Calendar to reference. - * @return the updated TriggerBuilder - * @see Calendar - * @see Trigger#getCalendarName() - */ - + /// + /// Set the name of the {@link Calendar} that should be applied to this + /// Trigger's schedule. + /// + ///+ /// + /// the name of the Calendar to reference. + ///the updated TriggerBuilder + ///+ /// public TriggerBuilder ModifiedByCalendar(string calendarName) { this.calendarName = calendarName; return this; } - /** - * Set the time the Trigger should start at - the trigger may or may - * not fire at this time - depending upon the schedule configured for - * the Trigger. However the Trigger will NOT fire before this time, - * regardless of the Trigger's schedule. - * - * @param startTime the start time for the Trigger. - * @return the updated TriggerBuilder - * @see Trigger#getStartTime() - * @see DateBuilder - */ - + /// + /// Set the time the Trigger should start at - the trigger may or may + /// not fire at this time - depending upon the schedule configured for + /// the Trigger. However the Trigger will NOT fire before this time, + /// regardless of the Trigger's schedule. + /// + ///+ /// + /// the start time for the Trigger. + ///the updated TriggerBuilder + ///+ /// public TriggerBuilder StartAt(DateTimeOffset startTimeUtc) { this.startTime = startTimeUtc; return this; } - /** - * Set the time the Trigger should start at to the current moment - - * the trigger may or may not fire at this time - depending upon the - * schedule configured for the Trigger. - * - * @return the updated TriggerBuilder - * @see Trigger#getStartTime() - */ - + /// + /// Set the time the Trigger should start at to the current moment - + /// the trigger may or may not fire at this time - depending upon the + /// schedule configured for the Trigger. + /// + ///+ /// + ///the updated TriggerBuilder + ///public TriggerBuilder StartNow() { this.startTime = DateTimeOffset.UtcNow; return this; } - /** - * Set the time at which the Trigger will no longer fire - even if it's - * schedule has remaining repeats. - * - * @param endTime the end time for the Trigger. If null, the end time is indefinite. - * @return the updated TriggerBuilder - * @see Trigger#getEndTime() - * @see DateBuilder - */ - + /// + /// Set the time at which the Trigger will no longer fire - even if it's + /// schedule has remaining repeats. + /// + ///+ /// + /// the end time for the Trigger. If null, the end time is indefinite. + ///the updated TriggerBuilder + ///+ /// public TriggerBuilder EndAt(DateTimeOffset? endTimeUtc) { this.endTime = endTimeUtc; return this; } - /** - * Set the {@link ScheduleBuilder} that will be used to define the - * Trigger's schedule. - * - * The particular
- * - * @param scheduleBuilder the SchedulerBuilder to use. - * @return the updated TriggerBuilder - * @see ScheduleBuilder - * @see SimpleScheduleBuilder - * @see CronScheduleBuilder - * @see CalendarIntervalScheduleBuilder - */ - + ///SchedulerBuilder
used will dictate - * the concrete type of Trigger that is produced by the TriggerBuilder.+ /// Set the {@link ScheduleBuilder} that will be used to define the + /// Trigger's schedule. + /// + ///+ /// + /// the SchedulerBuilder to use. + ///The particular
+ ///SchedulerBuilder
used will dictate + /// the concrete type of Trigger that is produced by the TriggerBuilder.the updated TriggerBuilder + ///+ /// + /// + /// public TriggerBuilder WithSchedule(IScheduleBuilder scheduleBuilder) { this.scheduleBuilder = scheduleBuilder; return this; } - /** - * Set the identity of the Job which should be fired by the produced - * Trigger. - * - * @param jobKey the identity of the Job to fire. - * @return the updated TriggerBuilder - * @see Trigger#getJobKey() - */ - + /// + /// Set the identity of the Job which should be fired by the produced + /// Trigger. + /// + ///+ /// + /// the identity of the Job to fire. + ///the updated TriggerBuilder + ///public TriggerBuilder ForJob(JobKey jobKey) { this.jobKey = jobKey; return this; } - /** - * Set the identity of the Job which should be fired by the produced - * Trigger - a JobKey
will be produced with the given - * name and default group. - * - * @param jobName the name of the job (in default group) to fire. - * @return the updated TriggerBuilder - * @see Trigger#getJobKey() - */ - + ///+ /// Set the identity of the Job which should be fired by the produced + /// Trigger - a + ///JobKey
will be produced with the given + /// name and default group. + ///+ /// + /// the name of the job (in default group) to fire. + ///the updated TriggerBuilder + ///public TriggerBuilder ForJob(string jobName) { this.jobKey = new JobKey(jobName, null); return this; } - /** - * Set the identity of the Job which should be fired by the produced - * Trigger - a JobKey
will be produced with the given - * name and group. - * - * @param jobName the name of the job to fire. - * @param jobGroup the group of the job to fire. - * @return the updated TriggerBuilder - * @see Trigger#getJobKey() - */ - + ///+ /// Set the identity of the Job which should be fired by the produced + /// Trigger - a + ///JobKey
will be produced with the given + /// name and group. + ///+ /// + /// the name of the job to fire. + /// the group of the job to fire. + ///the updated TriggerBuilder + ///public TriggerBuilder ForJob(string jobName, string jobGroup) { this.jobKey = new JobKey(jobName, jobGroup); return this; } - /** - * Set the identity of the Job which should be fired by the produced - * Trigger, by extracting the JobKey from the given job. - * - * @param jobDetail the Job to fire. - * @return the updated TriggerBuilder - * @see Trigger#getJobKey() - */ - + /// + /// Set the identity of the Job which should be fired by the produced + /// Trigger, by extracting the JobKey from the given job. + /// + ///+ /// + /// the Job to fire. + ///the updated TriggerBuilder + ///public TriggerBuilder ForJob(IJobDetail jobDetail) { JobKey k = jobDetail.Key; @@ -391,93 +357,108 @@ public TriggerBuilder ForJob(IJobDetail jobDetail) return this; } - /** - * Add the given key-value pair to the Trigger's {@link JobDataMap}. - * - * @return the updated TriggerBuilder - * @see Trigger#getJobDataMap() - */ - + /// + /// Add the given key-value pair to the Trigger's {@link JobDataMap}. + /// + ///+ /// + ///the updated TriggerBuilder + ///public TriggerBuilder UsingJobData(string key, string value) { jobDataMap.Put(key, value); return this; } - /** - * Add the given key-value pair to the Trigger's {@link JobDataMap}. - * - * @return the updated TriggerBuilder - * @see Trigger#getJobDataMap() - */ - + /// + /// Add the given key-value pair to the Trigger's {@link JobDataMap}. + /// + ///+ /// + ///the updated TriggerBuilder + ///public TriggerBuilder UsingJobData(string key, int value) { jobDataMap.Put(key, value); return this; } - /** - * Add the given key-value pair to the Trigger's {@link JobDataMap}. - * - * @return the updated TriggerBuilder - * @see Trigger#getJobDataMap() - */ - + /// + /// Add the given key-value pair to the Trigger's {@link JobDataMap}. + /// + ///+ /// + ///the updated TriggerBuilder + ///public TriggerBuilder UsingJobData(string key, long value) { jobDataMap.Put(key, value); return this; } - /** - * Add the given key-value pair to the Trigger's {@link JobDataMap}. - * - * @return the updated TriggerBuilder - * @see Trigger#getJobDataMap() - */ + /// + /// Add the given key-value pair to the Trigger's {@link JobDataMap}. + /// + ///+ /// + ///the updated TriggerBuilder + ///public TriggerBuilder UsingJobData(string key, float value) { jobDataMap.Put(key, value); return this; } - /** - * Add the given key-value pair to the Trigger's {@link JobDataMap}. - * - * @return the updated TriggerBuilder - * @see Trigger#getJobDataMap() - */ - public TriggerBuilder UsingJobData(string key, Double value) + /// + /// Add the given key-value pair to the Trigger's {@link JobDataMap}. + /// + ///+ /// + ///the updated TriggerBuilder + ///+ public TriggerBuilder UsingJobData(string key, double value) { jobDataMap.Put(key, value); return this; } - /** - * Add the given key-value pair to the Trigger's {@link JobDataMap}. - * - * @return the updated TriggerBuilder - * @see Trigger#getJobDataMap() - */ - public TriggerBuilder UsingJobData(string key, Boolean value) + /// + /// Add the given key-value pair to the Trigger's {@link JobDataMap}. + /// + ///+ /// + ///the updated TriggerBuilder + ///+ public TriggerBuilder UsingJobData(string key, decimal value) + { + jobDataMap.Put(key, value); + return this; + } + + /// + /// Add the given key-value pair to the Trigger's {@link JobDataMap}. + /// + ///+ /// + ///the updated TriggerBuilder + ///+ public TriggerBuilder UsingJobData(string key, bool value) { jobDataMap.Put(key, value); return this; } - /** - * Set the Trigger's {@link JobDataMap}, adding any values to it - * that were already set on this TriggerBuilder using any of the - * other 'usingJobData' methods. - * - * @return the updated TriggerBuilder - * @see Trigger#getJobDataMap() - */ + /// + /// Add the given key-value pair to the Trigger's {@link JobDataMap}. + /// + ///+ /// + ///the updated TriggerBuilder + ///public TriggerBuilder UsingJobData(JobDataMap newJobDataMap) { // add any existing data to this new map diff --git a/src/Quartz/TriggerKey.cs b/src/Quartz/TriggerKey.cs index eb0aae55e..5475eee3c 100644 --- a/src/Quartz/TriggerKey.cs +++ b/src/Quartz/TriggerKey.cs @@ -35,8 +35,8 @@ namespace Quartz /// scheduler.scheduleJob(job, trigger); /// - /// + /// + /// public sealed class TriggerKey : Key { public TriggerKey(string name) : base(name, null) @@ -46,15 +46,5 @@ public TriggerKey(string name) : base(name, null) public TriggerKey(string name, string group) : base(name, group) { } - - public static TriggerKey triggerKey(string name) - { - return new TriggerKey(name, null); - } - - public static TriggerKey triggerKey(string name, string group) - { - return new TriggerKey(name, group); - } } } \ No newline at end of file diff --git a/src/Quartz/TriggerState.cs b/src/Quartz/TriggerState.cs index 286a5a3dd..f89f49b00 100644 --- a/src/Quartz/TriggerState.cs +++ b/src/Quartz/TriggerState.cs @@ -26,17 +26,17 @@ namespace Quartz public enum TriggerState { /// - /// Indicates that the Normal, ///is in the "normal" state. + /// Indicates that the is in the "normal" state. /// - /// Indicates that the Paused, ///is in the "paused" state. + /// Indicates that the is in the "paused" state. /// - /// Indicates that the ///is in the "complete" state. + /// Indicates that the is in the "complete" state. /// /// "Complete" indicates that the trigger has not remaining fire-times in @@ -45,11 +45,11 @@ public enum TriggerState Complete, /// - /// Indicates that the ///is in the "error" state. + /// Indicates that the is in the "error" state. /// /// - /// A
arrives at the error state when the scheduler + /// A arrives at the error state when the scheduler /// attempts to fire it, but cannot due to an error creating and executing /// its related job. Often this is due to the 's /// class not existing in the classpath. @@ -63,10 +63,10 @@ public enum TriggerState Error, /// - /// Indicates that the ///is in the "blocked" state. + /// Indicates that the is in the "blocked" state. /// - /// A @@ -74,7 +74,7 @@ public enum TriggerState Blocked, ///arrives at the blocked state when the job that + /// A arrives at the blocked state when the job that /// it is associated with is a and it is /// currently executing. /// - /// Indicates that the None } diff --git a/src/Quartz/TriggerUtils.cs b/src/Quartz/TriggerUtils.cs index 6a5e67715..2fbb271cc 100644 --- a/src/Quartz/TriggerUtils.cs +++ b/src/Quartz/TriggerUtils.cs @@ -27,10 +27,10 @@ namespace Quartz { ///does not exist. + /// Indicates that the does not exist. /// /// Convenience and utility methods for simplifying the construction and - /// configuration of - ///s and DateTimeOffsetOffsets. + /// configuration of s and DateTimeOffsetOffsets. /// - /// + /// + /// /// James House ///Marko Lahma (.NET) public static class TriggerUtils @@ -732,7 +732,7 @@ public static DateTimeOffset GetNextGivenSecondDate(DateTimeOffset? dateUtc, int ////// Returns a list of Dates that are the next fire times of a - /// @@ -770,7 +770,7 @@ public static IList. + /// . /// The input trigger will be cloned before any work is done, so you need /// not worry about its state being altered by this method. /// ComputeFireTimes(ITrigger trigg, ICalendar c /// /// Compute the ///Date
that is 1 second after the Nth firing of - /// the given, taking the triger's associated + /// the given , taking the triger's associated /// into consideration. /// @@ -823,7 +823,7 @@ public static IList ComputeFireTimes(ITrigger trigg, ICalendar c /// - /// Returns a list of Dates that are the next fire times of a + /// Returns a list of Dates that are the next fire times of a /// that fall within the given date range. The input trigger will be cloned /// before any work is done, so you need not worry about its state being /// altered by this method. diff --git a/src/Quartz/Util/Key.cs b/src/Quartz/Util/Key.cs index 39cae692e..4155b7933 100644 --- a/src/Quartz/Util/Key.cs +++ b/src/Quartz/Util/Key.cs @@ -162,8 +162,8 @@ public static string CreateUniqueName(string group) group = DefaultGroup; } - string n1 = UUID.randomUUID().toString(); - string n2 = UUID.nameUUIDFromBytes(group.getBytes()).toString(); + string n1 = Guid.NewGuid().ToString(); + string n2 = Guid.NewGuid().ToString(); return String.Format("{0}-{1}", n2.Substring(24), n1); } diff --git a/src/Quartz/Util/ObjectUtils.cs b/src/Quartz/Util/ObjectUtils.cs index 1cce5462b..16b83647a 100644 --- a/src/Quartz/Util/ObjectUtils.cs +++ b/src/Quartz/Util/ObjectUtils.cs @@ -18,6 +18,7 @@ #endregion using System; +using System.Collections.Generic; using System.Collections.Specialized; using System.ComponentModel; using System.Globalization; @@ -113,8 +114,28 @@ public static T InstantiateType (Type t) return (T) ci.Invoke(new object[0]); } - - /// + /// + /// Sets the object properties using reflection. + /// + public static void SetObjectProperties(object obj, string[] propertyNames, object[] propertyValues) + { + for (int i = 0; i < propertyNames.Length; i++) + { + string name = propertyNames[i]; + string propertyName = name.Substring(0, 1).ToUpper(CultureInfo.InvariantCulture) + name.Substring(1); + + try + { + SetPropertyValue(obj, propertyName, propertyValues[i]); + } + catch (Exception nfe) + { + throw new SchedulerConfigException(string.Format(CultureInfo.InvariantCulture, "Could not parse property '{0}' into correct data type: {1}", name, nfe.Message), nfe); + } + } + } + + ////// Sets the object properties using reflection. /// /// The object to set values to. diff --git a/src/Quartz/Xml/XMLSchedulingDataProcessor.cs b/src/Quartz/Xml/XMLSchedulingDataProcessor.cs index 8317d41fa..b15f4bb33 100644 --- a/src/Quartz/Xml/XMLSchedulingDataProcessor.cs +++ b/src/Quartz/Xml/XMLSchedulingDataProcessor.cs @@ -411,7 +411,7 @@ protected virtual void ProcessInternal(string xml) } DateTime? triggerEndTime = triggerNode.Item.endtimeSpecified ? triggerNode.Item.endtime : (DateTime?) null; - TriggerKey triggerKey = triggerKey(triggerName, triggerGroup); + TriggerKey triggerKey = new TriggerKey(triggerName, triggerGroup); IScheduleBuilder sched = null; @@ -425,7 +425,7 @@ protected virtual void ProcessInternal(string xml) int repeatCount = ParseSimpleTriggerRepeatCount(repeatCountString); TimeSpan repeatInterval = repeatIntervalString == null ? TimeSpan.Zero : TimeSpan.FromMilliseconds(Convert.ToInt64(repeatIntervalString)); - sched = SimpleScheduleBuilder.SimpleSchedule() + sched = SimpleScheduleBuilder.Create() .WithInterval(repeatInterval) .WithRepeatCount(repeatCount); @@ -460,12 +460,12 @@ protected virtual void ProcessInternal(string xml) IntervalUnit intervalUnit = ParseDateIntervalTriggerIntervalUnit(calendarIntervalTrigger.repeatintervalunit.TrimEmptyToNull()); int repeatInterval = repeatIntervalString == null ? 0 : Convert.ToInt32(repeatIntervalString); - sched = CalendarIntervalScheduleBuilder.CalendarIntervalSchedule() - .withInterval(repeatInterval, intervalUnit); + sched = CalendarIntervalScheduleBuilder.Create() + .WithInterval(repeatInterval, intervalUnit); if (!String.IsNullOrWhiteSpace(calendarIntervalTrigger.misfireinstruction)) { - ((CalendarIntervalScheduleBuilder)sched).withMisfireHandlingInstruction(ReadMisfireInstructionFromString(calendarIntervalTrigger.misfireinstruction)); + ((CalendarIntervalScheduleBuilder)sched).WithMisfireHandlingInstruction(ReadMisfireInstructionFromString(calendarIntervalTrigger.misfireinstruction)); } } else @@ -473,16 +473,16 @@ protected virtual void ProcessInternal(string xml) throw new SchedulerConfigException("Unknown trigger type in XML configuration"); } - IMutableTrigger trigger = TriggerBuilder.NewTrigger() - .WithIdentity(triggerName, triggerGroup) - .WithDescription(triggerDescription) - .ForJob(triggerJobName, triggerJobGroup) - .StartAt(triggerStartTime) - .EndAt(triggerEndTime) - .WithPriority(triggerPriority) - .ModifiedByCalendar(triggerCalendarRef) - .WithSchedule(sched) - .Build(); + IMutableTrigger trigger = TriggerBuilder .Create() + .WithIdentity(triggerName, triggerGroup) + .WithDescription(triggerDescription) + .ForJob(triggerJobName, triggerJobGroup) + .StartAt(triggerStartTime) + .EndAt(triggerEndTime) + .WithPriority(triggerPriority) + .ModifiedByCalendar(triggerCalendarRef) + .WithSchedule(sched) + .Build(); if (triggerNode.Item.jobdatamap != null && triggerNode.Item.jobdatamap.entry != null) {