Ejemplo n.º 1
0
        private void loadOrphanJobs(SchedulerNode schedulerNode)
        {
            TreeNode orphanJobsNode = schedulerNode.Nodes.Add("Orphan Jobs");
            var      groupNames     = schedulerNode.Scheduler.GetScheduler().GetJobGroupNames();

            foreach (var jobGroupName in groupNames)
            {
                var matcher = GroupMatcher <JobKey> .GroupEquals(jobGroupName);

                var jobKeys = schedulerNode.Scheduler.GetScheduler().GetJobKeys(matcher);
                foreach (var jobKey in jobKeys)
                {
                    try
                    {
                        var triggers = schedulerNode.Scheduler.GetScheduler().GetTriggersOfJob(jobKey);
                        if (triggers.Count == 0)
                        {
                            orphanJobsNode.Nodes.Add(
                                new JobNode(schedulerNode.Scheduler.GetScheduler().GetJobDetail(jobKey)));
                        }
                    }
                    catch (Exception ex)
                    {
                        _Log.Error("Error loading orphan jobs.", ex);
                        schedulerNode.Nodes.Add(string.Format("Unable to add job {0})", jobKey.Name));
                    }
                }
            }
        }
Ejemplo n.º 2
0
        private static void loadCalendars(SchedulerNode schedulerNode)
        {
            TreeNode calendarsNode = schedulerNode.Nodes.Add("Calendars");

            foreach (var calendarName in schedulerNode.Scheduler.GetScheduler().GetCalendarNames())
            {
                //TODO: make this a calendar node instead
                calendarsNode.Nodes.Add(calendarName);
            }
        }
Ejemplo n.º 3
0
        private void loadJobGroups(QuartzScheduler scheduler)
        {
            try
            {
                this.Cursor = Cursors.WaitCursor;

                jobDetailsToggle(false);

                SchedulerNode schedulerNode = new SchedulerNode(scheduler);
                if (jobGroupsTreeView.Nodes.ContainsKey(schedulerNode.Name))
                {
                    jobGroupsTreeView.Nodes.RemoveByKey(schedulerNode.Name);
                }

                schedulerNode.ContextMenuStrip = ctxScheduler;
                jobGroupsTreeView.Nodes.Add(schedulerNode);
                TreeNode jobGroupsNode = schedulerNode.Nodes.Add("Job Groups");
                var      jobGroups     = scheduler.GetScheduler().GetJobGroupNames();
                foreach (string jobGroup in jobGroups)
                {
                    TreeNode jobGroupNode = jobGroupsNode.Nodes.Add(jobGroup);
                    TreeNode jobsNode     = jobGroupNode.Nodes.Add("Jobs");
                    addJobNodes(jobsNode);
                }

                jobGroupsTreeView.Nodes[0].Expand();
                jobGroupsNode.Expand();

                StripStatusLabel_Job_Groups.Text = DateTime.Now.ToString("yyyy.MM.dd HH:mm.ss");
                loadOrphanJobs(schedulerNode);
                loadStuckTriggers(schedulerNode);
                loadCalendars(schedulerNode);
            }
            finally
            {
                this.Cursor = Cursors.Default;
            }
        }
Ejemplo n.º 4
0
 private void loadStuckTriggers(SchedulerNode schedulerNode)
 {
     TreeNode jobGroupsNode = schedulerNode.Nodes.Add("Stuck Triggers");
 }