JobFactory.cs 725 B

12345678910111213141516171819202122232425
  1. using System;
  2. using GxPress.Service.Interface.ElasticSearch;
  3. using Quartz;
  4. using Quartz.Spi;
  5. namespace GxPress.Api.Tools
  6. {
  7. public class JobFactory : IJobFactory
  8. {
  9. private readonly IServiceProvider container;
  10. private readonly IElasticSearchService elasticSearchService;
  11. public JobFactory(IServiceProvider container,IElasticSearchService elasticSearchService)
  12. {
  13. this.container = container;
  14. this.elasticSearchService=elasticSearchService;
  15. }
  16. public IJob NewJob(TriggerFiredBundle bundle, IScheduler scheduler)
  17. {
  18. return new MyJob(elasticSearchService);
  19. }
  20. public void ReturnJob(IJob job)
  21. {
  22. }
  23. }
  24. }