org.quartz
Class SchedulerContext

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

public class SchedulerContext
extends DirtyFlagMap
implements java.io.Serializable

Holds context/environment data that can be made available to Jobs as they are executed. This feature is much like the ServletContext feature when working with J2EE servlets.

Author:
James House
See Also:
Scheduler.getContext(), Serialized Form

Nested Class Summary
 
Nested classes inherited from class java.util.Map
java.util.Map.Entry
 
Constructor Summary
SchedulerContext()
          Create an empty JobDataMap.
SchedulerContext(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 SchedulerContext.
 char getChar(java.lang.String key)
          Retrieve the identified code>char value from the SchedulerContext.
 double getDouble(java.lang.String key)
          Retrieve the identified code>double value from the SchedulerContext.
 float getFloat(java.lang.String key)
          Retrieve the identified code>float value from the SchedulerContext.
 int getInt(java.lang.String key)
          Retrieve the identified code>int value from the SchedulerContext.
 java.lang.String[] getKeys()
           
 long getLong(java.lang.String key)
          Retrieve the identified code>long value from the SchedulerContext.
 java.lang.String getString(java.lang.String key)
          Retrieve the identified code>String value from the SchedulerContext.
 java.lang.Object put(java.lang.Object key, java.lang.Object value)
          Adds the given Object value to the SchedulerContext.
 void put(java.lang.String key, boolean value)
          Adds the given boolean value to the SchedulerContext.
 void put(java.lang.String key, char value)
          Adds the given char value to the SchedulerContext.
 void put(java.lang.String key, double value)
          Adds the given double value to the SchedulerContext.
 void put(java.lang.String key, float value)
          Adds the given float value to the SchedulerContext.
 void put(java.lang.String key, int value)
          Adds the given int value to the SchedulerContext.
 void put(java.lang.String key, long value)
          Adds the given long value to the SchedulerContext.
 void put(java.lang.String key, java.lang.String value)
          Adds the given String value to the SchedulerContext.
 void putAll(java.util.Map map)
          Adds the name-value pairs in the given Map to the SchedulerContext.
 void removeTransientData()
          Nulls-out any data values that are non-Serializable.
 void setAllowsTransientData(boolean allowsTransientData)
          Tell the SchedulerContext 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

SchedulerContext

public SchedulerContext()

Create an empty JobDataMap.


SchedulerContext

public SchedulerContext(java.util.Map map)

Create a JobDataMap with the given data.

Method Detail

setAllowsTransientData

public void setAllowsTransientData(boolean allowsTransientData)

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

Future versions of Quartz may make distinctions on how it propogates data in the SchedulerContext between instances of proxies to a single scheduler instance - i.e. if Quartz is being used via RMI.


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 SchedulerContext.

All keys must be Strings.

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 SchedulerContext.


put

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

Adds the given long value to the SchedulerContext.


put

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

Adds the given float value to the SchedulerContext.


put

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

Adds the given double value to the SchedulerContext.


put

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

Adds the given boolean value to the SchedulerContext.


put

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

Adds the given char value to the SchedulerContext.


put

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

Adds the given String value to the SchedulerContext.


put

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

Adds the given Object value to the SchedulerContext.

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 SchedulerContext.

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 SchedulerContext.

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 SchedulerContext.

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 SchedulerContext.

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 SchedulerContext.

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 SchedulerContext.

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 SchedulerContext.

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

getKeys

public java.lang.String[] getKeys()


Copyright James House (c) 2001-2004