How to pass instance variables into Quartz job?

后端 未结 6 1650
遇见更好的自我
遇见更好的自我 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:57

    Solve this problem by creating one interface with one HashMap putting required information there.

    Implement this interface in your Quartz Job class this information will be accessible.

    In IFace

    Map map = new HashMap<>();
    

    In Job

    map.get(context.getJobDetail().getKey()) =>  will give you Object
    

提交回复
热议问题