예제 #1
0
        private static void ScheduleJob(IScheduler scheduler, WorkflowJobConfig jobConfig, VendorConfiguration configuration)
        {
            var map = new JobDataMap();

            map.SetLateDependencyBundle(configuration);

            var job = JobBuilder
                      .Create(jobConfig.JobType)
                      .SetJobData(map)
                      .Build();

            var trigger = TriggerBuilder.Create()
                          .StartNow()
                          .WithSimpleSchedule(schedule => schedule
                                              .WithIntervalInSeconds(60)
                                              .RepeatForever())
                          .Build();

            scheduler.ScheduleJob(job, trigger);

            //job resolving is in Quartz\LifetimeScopeJobFactory.cs
        }
 protected void Register(ContainerBuilder builder, WorkflowJobConfig config)
 {
     builder.RegisterInstance(config).Named <WorkflowJobConfig>(typeof(TVendor).Name);
     RecursiveRegister(builder, config.JobType);
 }