Class JobDataMap

All Implemented Interfaces:
Serializable, Cloneable, Map<String,Object>

public class JobDataMap extends HashMap<String,Object> implements Serializable
Holds state information for Job instances.

JobDataMap instances are stored once when the Job is added to a scheduler. They are also re-persisted after every execution of StatefulJob instances.

JobDataMap instances can also be stored with a Trigger. This can be useful in the case where you have a Job that is stored in the scheduler for regular/repeated use by multiple Triggers, yet with each independent triggering, you want to supply the Job with different data inputs.

The JobExecutionContext passed to a Job at execution time also contains a convenience JobDataMap that is the result of merging the contents of the trigger's JobDataMap (if any) over the Job's JobDataMap (if any).

Author:
James House, timmolter
See Also:
  • Constructor Details

    • JobDataMap

      public JobDataMap()
      Create an empty JobDataMap.
    • JobDataMap

      public JobDataMap(JobDataMap jobDataMap)
      Constructor - creates a shallow copy of the passed in JobDataMap
      Parameters:
      jobDataMap -
  • Method Details

    • getString

      public String getString(String key)
      Retrieve the identified String value from the JobDataMap.
      Throws:
      ClassCastException - if the identified object is not a String.
    • shallowCopy

      public JobDataMap shallowCopy()