org.apache.log
public final class ContextMap extends Object implements Serializable
Field Summary | |
---|---|
static ThreadLocal | c_localContext |
Hashtable | m_map |
ContextMap | m_parent |
boolean | m_readOnly |
Constructor Summary | |
---|---|
ContextMap()
Default constructor. | |
ContextMap(ContextMap parent)
Constructor that sets parent contextMap.
|
Method Summary | |
---|---|
static void | bind(ContextMap context)
Bind a particular ContextMap to current thread.
|
void | checkReadable()
Utility method to verify that Context is read-only. |
void | clear()
Empty the context map.
|
Object | get(String key, Object defaultObject)
Get an entry from the context.
|
Object | get(String key)
Get an entry from the context.
|
static ContextMap | getCurrentContext()
Get the Current ContextMap.
|
static ContextMap | getCurrentContext(boolean autocreate)
Get the Current ContextMap.
|
int | getSize()
Get the number of contexts in map.
|
boolean | isReadOnly()
Determine if context is read-only.
|
void | makeReadOnly()
Make the context read-only.
|
Object | readResolve()
Helper method that sets context to read-only after de-serialization.
|
void | set(String key, Object value)
Set a value in context
|
Parameters: parent the parent ContextMap
Parameters: context the context map (may be null)
Parameters: key the key to map defaultObject a default object to return if key does not exist
Returns: the object in context
Parameters: key the key to map
Returns: the object in context or null if none with specified key
Returns: the current ContextMap
Parameters: autocreate true if a ContextMap is to be created if it doesn't exist
Returns: the current ContextMap
Returns: the number of contexts in map
Returns: true if Context is read only, false otherwise
Returns: the corrected object version
Parameters: key the key value the value (may be null)