本文介绍了更新现有的JobDataMap的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个已安排的Quartz作业。我想更新与之关联的JobDataMap。如果我得到一个带有 JobDataMap jobDataMap = scheduler.getJobDetail(....)。getJobDataMap()
的JobDataMap,该地图是实时吗?即。如果我改变它,它会被保存在调度程序中吗?如果没有,我该如何坚持?
I have a Quartz job that has already been scheduled. I want to update the JobDataMap associated with it. If I get a JobDataMap with JobDataMap jobDataMap = scheduler.getJobDetail(....).getJobDataMap()
, is that map "live"? ie. if I change it, will it be persisted in the scheduler? If not, how do I persist it?
推荐答案
参见:
...有状态的工作恰恰相反 -
每次执行
后,其JobDataMap将被重新存储这个工作。
...a stateful job is just the opposite - its JobDataMap is re-stored after every execution of the job.
通过让它实现StatefulJob
接口,而不是Job
接口,你'将'作为有状态标记' 。
这篇关于更新现有的JobDataMap的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!