• [C#][Quartz]添加监听器


    namespace Quartz.Listener
    {
        public class SchedulerListener : SchedulerListenerSupport
        {
            private static log4net.ILog log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name);
            public override void JobAdded(IJobDetail jobDetail)
            {
                log.DebugFormat("JobAdded.Group.{0}.Name.{1}.Description.{2}", jobDetail.Key.Group, jobDetail.Key.Name, jobDetail.Description);
                base.JobAdded(jobDetail);
            }
    
            public override void JobDeleted(JobKey jobKey)
            {
                log.DebugFormat("JobDeleted.Group.{0}.Name.{1}", jobKey.Group, jobKey.Name);
                base.JobDeleted(jobKey);
            }
    
            public override void JobPaused(JobKey jobKey)
            {
                log.DebugFormat("JobPaused.Group.{0}.Name.{1}", jobKey.Group, jobKey.Name);
                base.JobPaused(jobKey);
            }
    
            public override void JobResumed(JobKey jobKey)
            {
                log.DebugFormat("JobResumed.Group.{0}.Name.{1}", jobKey.Group, jobKey.Name);
                base.JobResumed(jobKey);
            }
    
            public override void JobScheduled(ITrigger trigger)
            {
                log.DebugFormat("JobScheduled.TriggerGroup.{0}.TriggerName.{1}.JobGroup.{2}.JobName.{3}", trigger.Key.Group, trigger.Key.Name, trigger.JobKey.Group, trigger.JobKey.Name);
                base.JobScheduled(trigger);
            }
    
            public override void JobsPaused(string jobGroup)
            {
                log.DebugFormat("JobsPaused.Group.{0}", jobGroup);
                base.JobsPaused(jobGroup);
            }
    
            public override void JobsResumed(string jobGroup)
            {
                log.DebugFormat("JobsResumed.Group.{0}", jobGroup);
                base.JobsResumed(jobGroup);
            }
    
            public override void JobUnscheduled(TriggerKey triggerKey)
            {
                log.DebugFormat("JobUnscheduled.TriggerGroup.{0}.TriggerName.{1}", triggerKey.Group, triggerKey.Name);
                base.JobUnscheduled(triggerKey);
            }
    
            public override void SchedulerError(string msg, SchedulerException cause)
            {
                log.ErrorFormat("SchedulerError.msg.{0}.cause.Message.{1}.cause.Source.{2}.cause.StackTrace.{3}.InnerException.Message.{4}",
                    msg, cause.Message, cause.Source, cause.StackTrace, cause.InnerException.Message);
                base.SchedulerError(msg, cause);
            }
    
            public override void SchedulerInStandbyMode()
            {
                log.Warn("SchedulerInStandbyMode");
                base.SchedulerInStandbyMode();
            }
    
            public override void SchedulerShutdown()
            {
                log.Warn("SchedulerShutdown");
                base.SchedulerShutdown();
            }
    
            public override void SchedulerShuttingdown()
            {
                log.Warn("SchedulerShuttingdown");
                base.SchedulerShuttingdown();
            }
    
            public override void SchedulerStarted()
            {
                log.Warn("SchedulerStarted");
                base.SchedulerStarted();
            }
    
            public override void SchedulingDataCleared()
            {
                log.Warn("SchedulingDataCleared");
                base.SchedulingDataCleared();
            }
    
            public override void TriggerFinalized(ITrigger trigger)
            {
                log.DebugFormat("TriggerFinalized.TriggerGroup.{0}.TriggerName.{1}.JobGroup.{2}.JobName.{3}", trigger.Key.Group, trigger.Key.Name, trigger.JobKey.Group, trigger.JobKey.Name);
                base.TriggerFinalized(trigger);
            }
    
            public override void TriggerPaused(TriggerKey triggerKey)
            {
                log.DebugFormat("TriggerPaused.TriggerGroup.{0}.TriggerName.{1}", triggerKey.Group, triggerKey.Name);
                base.TriggerPaused(triggerKey);
            }
    
            public override void TriggerResumed(TriggerKey triggerKey)
            {
                log.DebugFormat("TriggerResumed.TriggerGroup.{0}.TriggerName.{1}", triggerKey.Group, triggerKey.Name);
                base.TriggerResumed(triggerKey);
            }
    
            public override void TriggersPaused(string triggerGroup)
            {
                log.DebugFormat("TriggersPaused.Group.{0}", triggerGroup);
                base.TriggersPaused(triggerGroup);
            }
    
            public override void TriggersResumed(string triggerGroup)
            {
                log.DebugFormat("TriggersResumed.Group.{0}", triggerGroup);
                base.TriggersResumed(triggerGroup);
            }
        }
    }
  • 相关阅读:
    N皇后
    逆波兰中缀转后缀代码
    ImportError: No module named Image
    稳定排序 和 不稳定排序 ::::::::::: 内排序和外排序
    逆波兰中 中缀表达式转后缀表达式的方法
    第一章:Unix基础知识
    软件设计流程
    linux 下 tar.xz 文件的解压方法
    fedora 解决 Python.h:没有那个文件或目录 错误的方法
    Shell排序
  • 原文地址:https://www.cnblogs.com/z5337/p/9087552.html
Copyright © 2020-2023  润新知