Update of /cvsroot/springnet/Spring.Net.Integration/projects/Spring.Scheduling.Quartz/src/Spring/Spring.Scheduling.Quartz/Scheduling/Quartz
In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv27174/Scheduling/Quartz
Modified Files:
CronTriggerObject.cs MethodInvokingJobDetailFactoryObject.cs
MethodInvokingRunnable.cs
ResourceJobSchedulingDataProcessor.cs
SchedulerFactoryObject.cs SimpleTriggerObject.cs
Removed Files:
MethodInvokingJobDetailFactoryBean.cs
Log Message:
Updated to Quartz.NET latest trunk version, fixed compilation problems and set initial project layout
Index: MethodInvokingRunnable.cs
===================================================================
RCS file: /cvsroot/springnet/Spring.Net.Integration/projects/Spring.Scheduling.Quartz/src/Spring/Spring.Scheduling.Quartz/Scheduling/Quartz/MethodInvokingRunnable.cs,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** MethodInvokingRunnable.cs 10 Sep 2007 21:34:10 -0000 1.1
--- MethodInvokingRunnable.cs 11 Sep 2007 09:33:50 -0000 1.2
***************
*** 24,72 ****
using Spring.Objects.Support;
! namespace Spring.Scheduling.Quartz.scheduling.support
{
! /// <summary>
! /// Adapter that implements the Runnable interface as a configurable
! /// method invocation based on Spring's MethodInvoker.
! /// </summary>
! /// <remarks>
! /// <p>
! /// Derives from ArgumentConvertingMethodInvoker, inheriting common
! /// configuration properties from MethodInvoker.
! /// </p>
! ///
! /// <p>
! /// Useful to generically encapsulate a method invocation as timer task for
! /// <code>java.util.Timer</code>, in combination with a DelegatingTimerTask adapter.
! /// Can also be used with JDK 1.5's <code>java.util.concurrent.Executor</code>
! /// abstraction, which works with plain Runnables.
! /// </p>
! /// <p>
! /// Extended by Spring's MethodInvokingTimerTaskFactoryObject adapter
! /// for <code>TimerTask</code>. Note that you can populate a
! /// ScheduledTimerTask object with a plain MethodInvokingRunnable instance
! /// as well, which will automatically get wrapped with a DelegatingTimerTask.
! /// </p>
! /// </remarks>
! /// <author>Juergen Hoeller</author>
! /// <seealso cref="MethodInvoker" />
! /// <seealso cref="ArgumentConvertingMethodInvoker" />
! public class MethodInvokingRunnable : ArgumentConvertingMethodInvoker, IInitializingObject, IThreadRunnable
! {
! protected ILog logger;
/// <summary>
/// Initializes a new instance of the <see cref="MethodInvokingRunnable"/> class.
/// </summary>
! public MethodInvokingRunnable()
! {
! logger = LogManager.GetLogger(GetType());
! }
! protected virtual string InvocationFailureMessage
! {
! get { return string.Format("Invocation of method '{0}' on target object [{1}] failed", TargetMethod, TargetObject); }
! }
/// <summary>
--- 24,79 ----
using Spring.Objects.Support;
! namespace Spring.Scheduling.Quartz
{
! /// <summary>
! /// Adapter that implements the Runnable interface as a configurable
! /// method invocation based on Spring's MethodInvoker.
! /// </summary>
! /// <remarks>
! /// <p>
! /// Derives from ArgumentConvertingMethodInvoker, inheriting common
! /// configuration properties from MethodInvoker.
! /// </p>
! ///
! /// <p>
! /// Useful to generically encapsulate a method invocation as timer task for
! /// <code>java.util.Timer</code>, in combination with a DelegatingTimerTask adapter.
! /// Can also be used with JDK 1.5's <code>java.util.concurrent.Executor</code>
! /// abstraction, which works with plain Runnables.
! /// </p>
! /// <p>
! /// Extended by Spring's MethodInvokingTimerTaskFactoryObject adapter
! /// for <code>TimerTask</code>. Note that you can populate a
! /// ScheduledTimerTask object with a plain MethodInvokingRunnable instance
! /// as well, which will automatically get wrapped with a DelegatingTimerTask.
! /// </p>
! /// </remarks>
! /// <author>Juergen Hoeller</author>
! /// <seealso cref="MethodInvoker" />
! /// <seealso cref="ArgumentConvertingMethodInvoker" />
! public class MethodInvokingRunnable : ArgumentConvertingMethodInvoker, IInitializingObject, IThreadRunnable
! {
! /// <summary>
! /// Logger instance shared by this instance and its sub-class instances.
! /// </summary>
! protected ILog logger;
/// <summary>
/// Initializes a new instance of the <see cref="MethodInvokingRunnable"/> class.
/// </summary>
! public MethodInvokingRunnable()
! {
! logger = LogManager.GetLogger(GetType());
! }
! /// <summary>
! /// Gets the invocation failure message.
! /// </summary>
! /// <value>The invocation failure message.</value>
! protected virtual string InvocationFailureMessage
! {
! get { return string.Format("Invocation of method '{0}' on target object [{1}] failed", TargetMethod, TargetObject); }
! }
/// <summary>
***************
*** 96,103 ****
/// required property) or if initialization fails.
/// </exception>
! public virtual void AfterPropertiesSet()
! {
! Prepare();
! }
/// <summary>
--- 103,110 ----
/// required property) or if initialization fails.
/// </exception>
! public virtual void AfterPropertiesSet()
! {
! Prepare();
! }
/// <summary>
***************
*** 105,125 ****
/// run method to be called in that separately executing thread.
/// </summary>
! public virtual void Run()
! {
! try
! {
! Invoke();
! }
! catch (TargetInvocationException ex)
! {
! logger.Error(InvocationFailureMessage, ex);
! // Do not throw exception, else the main loop of the Timer will stop!
! }
! catch (Exception ex)
! {
! logger.Error(InvocationFailureMessage, ex);
! // Do not throw exception, else the main loop of the Timer will stop!
! }
! }
! }
}
\ No newline at end of file
--- 112,132 ----
/// run method to be called in that separately executing thread.
/// </summary>
! public virtual void Run()
! {
! try
! {
! Invoke();
! }
! catch (TargetInvocationException ex)
! {
! logger.Error(InvocationFailureMessage, ex);
! // Do not throw exception, else the main loop of the Timer will stop!
! }
! catch (Exception ex)
! {
! logger.Error(InvocationFailureMessage, ex);
! // Do not throw exception, else the main loop of the Timer will stop!
! }
! }
! }
}
\ No newline at end of file
Index: CronTriggerObject.cs
===================================================================
RCS file: /cvsroot/springnet/Spring.Net.Integration/projects/Spring.Scheduling.Quartz/src/Spring/Spring.Scheduling.Quartz/Scheduling/Quartz/CronTriggerObject.cs,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** CronTriggerObject.cs 10 Sep 2007 21:34:10 -0000 1.1
--- CronTriggerObject.cs 11 Sep 2007 09:33:50 -0000 1.2
***************
*** 41,54 ****
/// instead of registering the JobDetail separately.
/// </p>
- /// <p><b>NOTE:</b> This convenience subclass does not work with trigger
- /// persistence in Quartz, due Quartz's trigger handling.
- /// You shouldn't use this class if you rely on trigger persistence based on this class
- /// You can always use the standard Quartz <see cref="CronTrigger" /> class instead.
- /// </p>
/// </remarks>
/// <author>Juergen Hoeller</author>
/// <seealso cref="Trigger.Name" />
/// <seealso cref="Trigger.Group" />
! /// <seealso cref="Trigger.StartTime" />
/// <seealso cref="Trigger.JobName" />
/// <seealso cref="Trigger.JobGroup" />
--- 41,49 ----
/// instead of registering the JobDetail separately.
/// </p>
/// </remarks>
/// <author>Juergen Hoeller</author>
/// <seealso cref="Trigger.Name" />
/// <seealso cref="Trigger.Group" />
! /// <seealso cref="Trigger.StartTimeUtc" />
/// <seealso cref="Trigger.JobName" />
/// <seealso cref="Trigger.JobGroup" />
***************
*** 81,87 ****
/// Default is <code>MISFIRE_INSTRUCTION_SMART_POLICY</code>.
/// </summary>
! /// <seealso cref="CronTrigger.MISFIRE_INSTRUCTION_FIRE_ONCE_NOW" />
! /// <seealso cref="CronTrigger.MISFIRE_INSTRUCTION_DO_NOTHING" />
! /// <seealso cref="Trigger.MISFIRE_INSTRUCTION_SMART_POLICY" />
public virtual string MisfireInstructionName
{
--- 76,82 ----
/// Default is <code>MISFIRE_INSTRUCTION_SMART_POLICY</code>.
/// </summary>
! /// <seealso cref="MisfirePolicy.CronTrigger.FireOnceNow" />
! /// <seealso cref="MisfirePolicy.CronTrigger.DoNothing" />
! /// <seealso cref="MisfirePolicy.SmartPolicy" />
public virtual string MisfireInstructionName
{
***************
*** 162,168 ****
Group = SchedulerConstants.DEFAULT_GROUP;
}
! if (StartTime == DateTime.MinValue)
{
! StartTime = DateTime.Now;
}
if (TimeZone == null)
--- 157,163 ----
Group = SchedulerConstants.DEFAULT_GROUP;
}
! if (StartTimeUtc == DateTime.MinValue)
{
! StartTimeUtc = DateTime.UtcNow;
}
if (TimeZone == null)
--- MethodInvokingJobDetailFactoryBean.cs DELETED ---
Index: SchedulerFactoryObject.cs
===================================================================
RCS file: /cvsroot/springnet/Spring.Net.Integration/projects/Spring.Scheduling.Quartz/src/Spring/Spring.Scheduling.Quartz/Scheduling/Quartz/SchedulerFactoryObject.cs,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** SchedulerFactoryObject.cs 10 Sep 2007 21:34:10 -0000 1.1
--- SchedulerFactoryObject.cs 11 Sep 2007 09:33:50 -0000 1.2
***************
*** 79,86 ****
{
private const string CONTEXT_KEY_CONFIG_TIME_TASK_EXECUTOR = "sched_factory_conf_t_t_exec";
public const int DEFAULT_THREAD_COUNT = 10;
public const string PROP_THREAD_COUNT = "org.quartz.threadPool.threadCount";
- private IApplicationContext applicationContext;
private string applicationContextSchedulerContextKey;
private bool autoStartup = true;
--- 79,99 ----
{
private const string CONTEXT_KEY_CONFIG_TIME_TASK_EXECUTOR = "sched_factory_conf_t_t_exec";
+
+ /// <summary>
+ /// Default thread count to be set to thread pool.
+ /// </summary>
public const int DEFAULT_THREAD_COUNT = 10;
+
+ /// <summary>
+ /// Property name for thread count in thread pool.
+ /// </summary>
public const string PROP_THREAD_COUNT = "org.quartz.threadPool.threadCount";
+ /// <summary>
+ /// Logger for this instance and its sub-class instances.
+ /// </summary>
+ protected ILog logger;
+
+ private IApplicationContext applicationContext;
private string applicationContextSchedulerContextKey;
private bool autoStartup = true;
***************
*** 93,97 ****
private IJobListener[] jobListeners;
private string[] jobSchedulingDataLocations;
- protected ILog logger;
private bool overwriteExistingJobs = false;
private NameValueCollection quartzProperties;
--- 106,109 ----
***************
*** 407,411 ****
/// <seealso cref="ITriggerListener.Name" />
/// <seealso cref="Trigger.AddTriggerListener" />
! /// <seealso cref="CronTriggerObject.TriggerListenerNames" />
/// <seealso cref="Trigger.TriggerListenerNames" />
public virtual ITriggerListener[] TriggerListeners
--- 419,423 ----
/// <seealso cref="ITriggerListener.Name" />
/// <seealso cref="Trigger.AddTriggerListener" />
! /// <seealso cref="Trigger.TriggerListenerNames" />
/// <seealso cref="Trigger.TriggerListenerNames" />
public virtual ITriggerListener[] TriggerListeners
***************
*** 710,713 ****
--- 722,731 ----
}
+ /// <summary>
+ /// Merges the properties into map. This effectively also
+ /// overwrites existing properties with same key in map.
+ /// </summary>
+ /// <param name="properties">The properties to merge into given map.</param>
+ /// <param name="map">The map to merge to.</param>
protected virtual void MergePropertiesIntoMap(NameValueCollection properties, NameValueCollection map)
{
Index: ResourceJobSchedulingDataProcessor.cs
===================================================================
RCS file: /cvsroot/springnet/Spring.Net.Integration/projects/Spring.Scheduling.Quartz/src/Spring/Spring.Scheduling.Quartz/Scheduling/Quartz/ResourceJobSchedulingDataProcessor.cs,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** ResourceJobSchedulingDataProcessor.cs 10 Sep 2007 21:34:10 -0000 1.1
--- ResourceJobSchedulingDataProcessor.cs 11 Sep 2007 09:33:50 -0000 1.2
***************
*** 63,66 ****
--- 63,73 ----
}
+ /// <summary>
+ /// Returns an <see cref="T:System.IO.Stream"/> from the fileName as a resource.
+ /// </summary>
+ /// <param name="fileName">Name of the file.</param>
+ /// <returns>
+ /// an <see cref="T:System.IO.Stream"/> from the fileName as a resource.
+ /// </returns>
protected override Stream GetInputStream(string fileName)
{
Index: MethodInvokingJobDetailFactoryObject.cs
===================================================================
RCS file: /cvsroot/springnet/Spring.Net.Integration/projects/Spring.Scheduling.Quartz/src/Spring/Spring.Scheduling.Quartz/Scheduling/Quartz/MethodInvokingJobDetailFactoryObject.cs,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** MethodInvokingJobDetailFactoryObject.cs 10 Sep 2007 21:34:10 -0000 1.1
--- MethodInvokingJobDetailFactoryObject.cs 11 Sep 2007 09:33:50 -0000 1.2
***************
*** 217,222 ****
jobDetail = new JobDetail(jobDetailName, group, jobClass);
jobDetail.JobDataMap.Put("methodInvoker", this);
! jobDetail.Volatility = true;
! jobDetail.Durability = true;
// Register job listener names.
--- 217,222 ----
jobDetail = new JobDetail(jobDetailName, group, jobClass);
jobDetail.JobDataMap.Put("methodInvoker", this);
! jobDetail.Volatile = true;
! jobDetail.Durable = true;
// Register job listener names.
Index: SimpleTriggerObject.cs
===================================================================
RCS file: /cvsroot/springnet/Spring.Net.Integration/projects/Spring.Scheduling.Quartz/src/Spring/Spring.Scheduling.Quartz/Scheduling/Quartz/SimpleTriggerObject.cs,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** SimpleTriggerObject.cs 10 Sep 2007 21:34:10 -0000 1.1
--- SimpleTriggerObject.cs 11 Sep 2007 09:33:50 -0000 1.2
***************
*** 39,54 ****
/// instead of registering the JobDetail separately.
/// </p>
- ///
- /// <p>
- /// <b>NOTE:</b> This convenience subclass does not work with trigger
- /// persistence in Quartz, due to Quartz's trigger handling.
- /// Don't use this class if you rely on trigger persistence based on this class.
- /// You can always use the standard Quartz <see cref="SimpleTrigger" /> class instead.
- /// </p>
/// </remarks>
/// <author>Juergen Hoeller</author>
/// <seealso cref="Trigger.Name" />
/// <seealso cref="Trigger.Group" />
! /// <seealso cref="Trigger.StartTime" />
/// <seealso cref="Trigger.JobName" />
/// <seealso cref="Trigger.JobGroup" />
--- 39,47 ----
/// instead of registering the JobDetail separately.
/// </p>
/// </remarks>
/// <author>Juergen Hoeller</author>
/// <seealso cref="Trigger.Name" />
/// <seealso cref="Trigger.Group" />
! /// <seealso cref="Trigger.StartTimeUtc" />
/// <seealso cref="Trigger.JobName" />
/// <seealso cref="Trigger.JobGroup" />
***************
*** 88,99 ****
/// Set the misfire instruction via the name of the corresponding
/// constant in the SimpleTrigger class.
! /// Default is <code>MISFIRE_INSTRUCTION_SMART_POLICY</code>.
/// </summary>
! /// <seealso cref="SimpleTrigger.MISFIRE_INSTRUCTION_FIRE_NOW" />
! /// <seealso cref="SimpleTrigger.MISFIRE_INSTRUCTION_RESCHEDULE_NEXT_WITH_EXISTING_COUNT" />
! /// <seealso cref="SimpleTrigger.MISFIRE_INSTRUCTION_RESCHEDULE_NEXT_WITH_REMAINING_COUNT" />
! /// <seealso cref="SimpleTrigger.MISFIRE_INSTRUCTION_RESCHEDULE_NOW_WITH_EXISTING_REPEAT_COUNT" />
! /// <seealso cref="SimpleTrigger.MISFIRE_INSTRUCTION_RESCHEDULE_NOW_WITH_REMAINING_REPEAT_COUNT" />
! /// <seealso cref="Trigger.MISFIRE_INSTRUCTION_SMART_POLICY" />
public virtual string MisfireInstructionName
{
--- 81,92 ----
/// Set the misfire instruction via the name of the corresponding
/// constant in the SimpleTrigger class.
! /// Default is <see cref="MisfirePolicy.SmartPolicy" />.
/// </summary>
! /// <seealso cref="MisfirePolicy.SimpleTrigger.FireNow" />
! /// <seealso cref="MisfirePolicy.SimpleTrigger.RescheduleNextWithExistingCount" />
! /// <seealso cref="MisfirePolicy.SimpleTrigger.RescheduleNextWithRemainingCount" />
! /// <seealso cref="MisfirePolicy.SimpleTrigger.RescheduleNowWithExistingRepeatCount" />
! /// <seealso cref="MisfirePolicy.SimpleTrigger.RescheduleNowWithRemainingRepeatCount" />
! /// <seealso cref="MisfirePolicy.SmartPolicy" />
public virtual string MisfireInstructionName
{
***************
*** 136,140 ****
/// Specifying a relative delay is appropriate in that case.
/// </remarks>
! /// <seealso cref="Trigger.StartTime" />
public virtual long StartDelay
{
--- 129,133 ----
/// Specifying a relative delay is appropriate in that case.
/// </remarks>
! /// <seealso cref="Trigger.StartTimeUtc" />
public virtual long StartDelay
{
***************
*** 210,216 ****
Group = SchedulerConstants.DEFAULT_GROUP;
}
! if (StartTime == DateTime.MinValue)
{
! StartTime = DateTime.Now.AddMilliseconds(startDelay);
}
if (jobDetail != null)
--- 203,209 ----
Group = SchedulerConstants.DEFAULT_GROUP;
}
! if (StartTimeUtc == DateTime.MinValue)
{
! StartTimeUtc = DateTime.UtcNow.AddMilliseconds(startDelay);
}
if (jobDetail != null)
|