Is there no “schedule” listener or callback member in the IJob interface itself that the scheduler can use to notify the job that it is shutting down? I’m just starting to work with Quartz and I don’t know what the Java framework has, but I know that most threading frameworks have some mechanism to tell the thread that it is being suspended or shut down.
For instance, the PLINQ framework has a BackgroundWorker.WorkerSupportsCancellation flag that if you set to true it will update a BackgroundWorker.CancellationPending flag that you can monitor in your loop and act accordingly. Of course there is always the classic strategy like the ASP.Net Application_End method you can override as well.
I would think an addition like this to Quartz, even if it is a branch from the Java version, would be really useful. It would allow you to properly save state if necessary.
Matt Penner
Network Engineer II
Val Verde Unified School District
--
You received this message because you are subscribed to the Google Groups "Quartz.NET" group.
To view this discussion on the web visit https://groups.google.com/d/msg/quartznet/-/Ptgmcz-9kCMJ.
To post to this group, send email to quar...@googlegroups.com.
To unsubscribe from this group, send email to quartznet+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/quartznet?hl=en.
http://quartznet.sourceforge.net/apidoc/topic15.html
-Marko
Matt Penner
Network Engineer II
Val Verde Unified School District
mpe...@valverde.edu
(951) 940-6100 x10709
[CLSCompliant(false)]
public static class SchedulerExtension
{
public static void InterruptCurrentlyExecutingJobs(this IScheduler scheduler)
{
foreach (var result in scheduler.GetCurrentlyExecutingJobs().Cast<JobExecutionContext>().Select(je => je.JobInstance).OfType<IInterruptableJob>())
{
result.Interrupt();
}
}
}