Package org.apache.log
Class ContextMap
java.lang.Object
org.apache.log.ContextMap
- All Implemented Interfaces:
- Serializable
Deprecated.
Will be dropped in 3.3
The ContextMap contains non-hierarchical context information
 relevant to a particular LogEvent. It may include information
 such as;
 
- user ->fred
- hostname ->helm.realityforge.org
- ipaddress ->1.2.3.4
- interface ->127.0.0.1
- caller ->com.biz.MyCaller.method(MyCaller.java:18)
- source ->1.6.3.2:33
- See Also:
- 
Constructor SummaryConstructorsConstructorDescriptionDeprecated.Default constructor.ContextMap(ContextMap parent) Deprecated.Constructor that sets parent contextMap.
- 
Method SummaryModifier and TypeMethodDescriptionstatic final voidbind(ContextMap context) Deprecated.Bind a particular ContextMap to current thread.voidclear()Deprecated.Empty the context map.Deprecated.Get an entry from the context.Deprecated.Get an entry from the context.static final ContextMapDeprecated.Get the Current ContextMap.static final ContextMapgetCurrentContext(boolean autocreate) Deprecated.Get the Current ContextMap.intgetSize()Deprecated.Get the number of contexts in map.booleanDeprecated.Determine if context is read-only.voidDeprecated.Make the context read-only.voidDeprecated.Set a value in context
- 
Constructor Details- 
ContextMappublic ContextMap()Deprecated.Default constructor.
- 
ContextMapDeprecated.Constructor that sets parent contextMap.- Parameters:
- parent- the parent ContextMap
 
 
- 
- 
Method Details- 
getCurrentContextDeprecated.Get the Current ContextMap. This method returns a ContextMap associated with current thread. If the thread doesn't have a ContextMap associated with it then a new ContextMap is created.- Returns:
- the current ContextMap
 
- 
getCurrentContextDeprecated.Get the Current ContextMap. This method returns a ContextMap associated with current thread. If the thread doesn't have a ContextMap associated with it and autocreate is true then a new ContextMap is created.- Parameters:
- autocreate- true if a ContextMap is to be created if it doesn't exist
- Returns:
- the current ContextMap
 
- 
bindDeprecated.Bind a particular ContextMap to current thread.- Parameters:
- context- the context map (may be null)
 
- 
makeReadOnlypublic void makeReadOnly()Deprecated.Make the context read-only. This makes it safe to allow untrusted code reference to ContextMap.
- 
isReadOnlypublic boolean isReadOnly()Deprecated.Determine if context is read-only.- Returns:
- true if Context is read only, false otherwise
 
- 
clearpublic void clear()Deprecated.Empty the context map.
- 
getDeprecated.Get an entry from the context.- Parameters:
- key- the key to map
- defaultObject- a default object to return if key does not exist
- Returns:
- the object in context
 
- 
getDeprecated.Get an entry from the context.- Parameters:
- key- the key to map
- Returns:
- the object in context or null if none with specified key
 
- 
setDeprecated.Set a value in context- Parameters:
- key- the key
- value- the value (may be null)
 
- 
getSizepublic int getSize()Deprecated.Get the number of contexts in map.- Returns:
- the number of contexts in map
 
 
-