|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jcoderz.commons.LogThreadContext
public final class LogThreadContext
This class holds logging context information that is bound to the current thread.
The values of the map should be strictly Strings. This is to avoid misuse of the map as thread local cache and to avoid storing large object graphs in the context.
| Method Summary | |
|---|---|
static Map |
get()
Returns the underlying map that is used to store context parameters of the current thread. |
static String |
get(String key)
Returns the value of the selected context parameter, or null if the selected parameter is not set. |
static String |
put(String key,
String value)
Add a value identified by the given key to the thread context. |
static String |
remove(String key)
Removes the value that is currently stored for the given key. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static String put(String key,
String value)
The adder of the value is responsible that the value is removed if the context is left. There can only be one value set for a given key.
key - the identifier of the value to be set.value - the value to be stored in the context.
public static String get(String key)
key - the identifier of the value to be retrieved.
public static String remove(String key)
key - the identifier of the value to be removed.
public static Map get()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||