Quartz Scheduler: How to pass custom objects as JobParameter?

后端 未结 5 1768
时光说笑
时光说笑 2020-12-06 16:28

I am planning to write a ASP.NET page to trigger the job on demand. Currently, I am using SimpleTrigger class to trigger the job but none of the __Trigger class supports obj

5条回答
  •  爱一瞬间的悲伤
    2020-12-06 17:25

    When you schedule a job you can set a JobDataMap on the JobDetail object and pass this to your scheduler, there are some limitations described in the quartz.net tutorial. The job can access the data via:

    JobDataMap dataMap = context.JobDetail.JobDataMap;
    

    However I prefer to access my job configuration, via an repository injected into the job.

提交回复
热议问题