Package org.quartz.jobs
Class JobDataMap
- All Implemented Interfaces:
Serializable
,Cloneable
,Map<String,
Object>
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:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K,
V>, AbstractMap.SimpleImmutableEntry<K, V> -
Constructor Summary
ConstructorDescriptionCreate an emptyJobDataMap
.JobDataMap
(JobDataMap jobDataMap) Constructor - creates a shallow copy of the passed in JobDataMap -
Method Summary
Modifier and TypeMethodDescriptionRetrieve the identifiedString
value from theJobDataMap
.Methods inherited from class java.util.HashMap
clear, clone, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, forEach, get, getOrDefault, isEmpty, keySet, merge, newHashMap, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, values
Methods inherited from class java.util.AbstractMap
equals, hashCode, toString
-
Constructor Details
-
JobDataMap
public JobDataMap()Create an emptyJobDataMap
. -
JobDataMap
Constructor - creates a shallow copy of the passed in JobDataMap- Parameters:
jobDataMap
-
-
-
Method Details
-
getString
Retrieve the identifiedString
value from theJobDataMap
.- Throws:
ClassCastException
- if the identified object is not a String.
-
shallowCopy
-