How to pass instance variables into Quartz job?

后端 未结 6 1486
遇见更好的自我
遇见更好的自我 2021-01-31 16:55

I wonder how to pass an instance variable externally in Quartz?

Below is pseudo code I would like to write. How can I pass externalInstance into this Job?



        
6条回答
  •  攒了一身酷
    2021-01-31 17:51

    While scheduling the job using a trigger, you would have defined JobDataMap that is added to the JobDetail. That JobDetail object will be present in the JobExecutionContext passed to the execute() method in your Job. So, you should figure out a way to pass your externalInstance through the JobDataMap. HTH.

提交回复
热议问题