且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

更新现有的JobDataMap

更新时间:2023-12-02 21:13:04

参见 http://www.quartz-scheduler.org/docs/tutorial/TutorialLesson03.html


作业实例可以定义为
有状态或无状态。
非有状态作业只有在
添加到调度程序时才存储
JobDataMap。这意味着
,在执行
的工作期间对作业数据地图的内容
所做的任何更改都将丢失,并且在下次作业时看不到

执行。

A Job instance can be defined as "stateful" or "non-stateful". Non-stateful jobs only have their JobDataMap stored at the time they are added to the scheduler. This means that any changes made to the contents of the job data map during execution of the job will be lost, and will not seen by the job the next time it executes.

...有状态的工作恰恰相反 -
每次执行
后,其JobDataMap将被重新存储这个工作。

...a stateful job is just the opposite - its JobDataMap is re-stored after every execution of the job.

通过让它实现StatefulJob
接口,而不是Job
接口,你'将'作为有状态标记' 。