org.quartz
Class JobDataMap

java.lang.Object
  extended byorg.quartz.utils.DirtyFlagMap
      extended byorg.quartz.JobDataMap
All Implemented Interfaces:
java.lang.Cloneable, java.util.Map, java.io.Serializable

public class JobDataMap
extends DirtyFlagMap
implements java.io.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.

Author:
James House
See Also:
Job, StatefulJob, Serialized Form

Nested Class Summary
 
Nested classes inherited from class java.util.Map
java.util.Map.Entry
 
Constructor Summary
JobDataMap()
          Create an empty JobDataMap.
JobDataMap(java.util.Map map)
          Create a JobDataMap with the given data.
 
Method Summary
 boolean containsTransientData()
           
 boolean getAllowsTransientData()
           
 boolean getBoolean(java.lang.String key)
          Retrieve the identified code>boolean value from the JobDataMap.
 char getChar(java.lang.String key)
          Retrieve the identified code>char value from the JobDataMap.
 double getDouble(java.lang.String key)
          Retrieve the identified code>double value from the JobDataMap.
 float getFloat(java.lang.String key)
          Retrieve the identified code>float value from the JobDataMap.
 int getInt(java.lang.String key)
          Retrieve the identified code>int value from the JobDataMap.
 java.lang.String[] getKeys()
           
 long getLong(java.lang.String key)
          Retrieve the identified code>long value from the JobDataMap.
 java.lang.String getString(java.lang.String key)
          Retrieve the identified code>String value from the JobDataMap.
 java.lang.Object put(java.lang.Object key, java.lang.Object value)
          Adds the given Serializable object value to the JobDataMap.
 void put(java.lang.String key, boolean value)
          Adds the given boolean value to the Job's data map.
 void put(java.lang.String key, char value)
          Adds the given char value to the Job's data map.
 void put(java.lang.String key, double value)
          Adds the given double value to the Job's data map.
 void put(java.lang.String key, float value)
          Adds the given float value to the Job's data map.
 void put(java.lang.String key, int value)
          Adds the given int value to the Job's data map.
 void put(java.lang.String key, long value)
          Adds the given long value to the Job's data map.
 void put(java.lang.String key, java.lang.String value)
          Adds the given String value to the Job's data map.
 void putAll(java.util.Map map)
          Adds the name-value pairs in the given Map to the JobDataMap.
 void removeTransientData()
          Nulls-out any data values that are non-Serializable.
 void setAllowsTransientData(boolean allowsTransientData)
          Tell the JobDataMap that it should allow non-Serializable data.
 
Methods inherited from class org.quartz.utils.DirtyFlagMap
clear, clearDirtyFlag, clone, containsKey, containsValue, entrySet, equals, get, getWrappedMap, isDirty, isEmpty, keySet, remove, size, values
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.Map
hashCode
 

Constructor Detail

JobDataMap

public JobDataMap()

Create an empty JobDataMap.


JobDataMap

public JobDataMap(java.util.Map map)

Create a JobDataMap with the given data.

Method Detail

setAllowsTransientData

public void setAllowsTransientData(boolean allowsTransientData)

Tell the JobDataMap that it should allow non-Serializable data.

If the JobDataMap does contain non-Serializable objects, and it belongs to a non-volatile Job that is stored in a JobStore that supports persistence, then those elements will be nulled-out during persistence.


getAllowsTransientData

public boolean getAllowsTransientData()

containsTransientData

public boolean containsTransientData()

removeTransientData

public void removeTransientData()

Nulls-out any data values that are non-Serializable.


putAll

public void putAll(java.util.Map map)

Adds the name-value pairs in the given Map to the JobDataMap.

All keys must be Strings, and all values must be Serializable.

Specified by:
putAll in interface java.util.Map
Overrides:
putAll in class DirtyFlagMap

put

public void put(java.lang.String key,
                int value)

Adds the given int value to the Job's data map.


put

public void put(java.lang.String key,
                long value)

Adds the given long value to the Job's data map.


put

public void put(java.lang.String key,
                float value)

Adds the given float value to the Job's data map.


put

public void put(java.lang.String key,
                double value)

Adds the given double value to the Job's data map.


put

public void put(java.lang.String key,
                boolean value)

Adds the given boolean value to the Job's data map.


put

public void put(java.lang.String key,
                char value)

Adds the given char value to the Job's data map.


put

public void put(java.lang.String key,
                java.lang.String value)

Adds the given String value to the Job's data map.


put

public java.lang.Object put(java.lang.Object key,
                            java.lang.Object value)

Adds the given Serializable object value to the JobDataMap.

Specified by:
put in interface java.util.Map
Overrides:
put in class DirtyFlagMap

getInt

public int getInt(java.lang.String key)

Retrieve the identified code>int value from the JobDataMap.

Throws:
java.lang.ClassCastException - if the identified object is not an Integer.

getLong

public long getLong(java.lang.String key)

Retrieve the identified code>long value from the JobDataMap.

Throws:
java.lang.ClassCastException - if the identified object is not a Long.

getFloat

public float getFloat(java.lang.String key)

Retrieve the identified code>float value from the JobDataMap.

Throws:
java.lang.ClassCastException - if the identified object is not a Float.

getDouble

public double getDouble(java.lang.String key)

Retrieve the identified code>double value from the JobDataMap.

Throws:
java.lang.ClassCastException - if the identified object is not a Double.

getBoolean

public boolean getBoolean(java.lang.String key)

Retrieve the identified code>boolean value from the JobDataMap.

Throws:
java.lang.ClassCastException - if the identified object is not a Boolean.

getChar

public char getChar(java.lang.String key)

Retrieve the identified code>char value from the JobDataMap.

Throws:
java.lang.ClassCastException - if the identified object is not a Character.

getString

public java.lang.String getString(java.lang.String key)

Retrieve the identified code>String value from the JobDataMap.

Throws:
java.lang.ClassCastException - if the identified object is not a String.

getKeys

public java.lang.String[] getKeys()


Copyright James House (c) 2001-2004