예제 #1
0
        static void Main(string[] args)
        {
            ISchedulerFactory schedFact = new StdSchedulerFactory();
            IScheduler scheduler = schedFact.GetScheduler();
            IJobListener retryableJobListener = new RetryableJobListener(scheduler);
            scheduler.AddGlobalJobListener(retryableJobListener);
            scheduler.Start();

            // construct job info
            JobDetail jobDetail = new JobDetail("DummyJob", null, typeof(DummyJob));
            
            // fire only once
            Trigger trigger = TriggerUtils.MakeImmediateTrigger(0, TimeSpan.Zero);
            trigger.Name = "Chuck Norris";
            
            // start
            scheduler.ScheduleJob(jobDetail, trigger); 
        }
예제 #2
0
        static void Main(string[] args)
        {
            ISchedulerFactory schedFact            = new StdSchedulerFactory();
            IScheduler        scheduler            = schedFact.GetScheduler();
            IJobListener      retryableJobListener = new RetryableJobListener(scheduler);

            scheduler.AddGlobalJobListener(retryableJobListener);
            scheduler.Start();

            // construct job info
            JobDetail jobDetail = new JobDetail("DummyJob", null, typeof(DummyJob));

            // fire only once
            Trigger trigger = TriggerUtils.MakeImmediateTrigger(0, TimeSpan.Zero);

            trigger.Name = "Chuck Norris";

            // start
            scheduler.ScheduleJob(jobDetail, trigger);
        }