Package org.ops4j.pax.logging.log4jv2
Class Log4jv2ThreadContextMap
- java.lang.Object
-
- org.ops4j.pax.logging.log4jv2.Log4jv2ThreadContextMap
-
- All Implemented Interfaces:
org.apache.logging.log4j.spi.ThreadContextMap
public class Log4jv2ThreadContextMap extends Object implements org.apache.logging.log4j.spi.ThreadContextMap
The actual ThreadContext Map. A new ThreadContext Map is created each time it is updated and the Map stored is always immutable. This means the Map can be passed to other threads without concern that it will be updated. Since it is expected that the Map will be passed to many more log events than the number of keys it contains the performance should be much better than if the Map was copied for each event.
-
-
Constructor Summary
Constructors Constructor Description Log4jv2ThreadContextMap()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclear()booleancontainsKey(String key)Stringget(String key)Map<String,String>getCopy()Map<String,String>getImmutableMapOrNull()booleanisEmpty()voidput(String key, String value)voidremove(String key)
-
-
-
Method Detail
-
put
public void put(String key, String value)
- Specified by:
putin interfaceorg.apache.logging.log4j.spi.ThreadContextMap
-
get
public String get(String key)
- Specified by:
getin interfaceorg.apache.logging.log4j.spi.ThreadContextMap
-
remove
public void remove(String key)
- Specified by:
removein interfaceorg.apache.logging.log4j.spi.ThreadContextMap
-
clear
public void clear()
- Specified by:
clearin interfaceorg.apache.logging.log4j.spi.ThreadContextMap
-
containsKey
public boolean containsKey(String key)
- Specified by:
containsKeyin interfaceorg.apache.logging.log4j.spi.ThreadContextMap
-
getCopy
public Map<String,String> getCopy()
- Specified by:
getCopyin interfaceorg.apache.logging.log4j.spi.ThreadContextMap
-
getImmutableMapOrNull
public Map<String,String> getImmutableMapOrNull()
- Specified by:
getImmutableMapOrNullin interfaceorg.apache.logging.log4j.spi.ThreadContextMap
-
isEmpty
public boolean isEmpty()
- Specified by:
isEmptyin interfaceorg.apache.logging.log4j.spi.ThreadContextMap
-
-