@Beta public final class MDCs extends Object
MDC.| Modifier and Type | Method and Description |
|---|---|
static void |
put(String key,
String val)
Minor improvement over
MDC.put(String, String). |
static void |
putRunRemove(Map<String,String> keysValues,
Runnable runnable)
put(String, String) each key/val of the passed Map into the MDC, runs the provided
Runnable, and (ensure that) the all keys of the Map are
MDC.remove(String)'d (even if there was an exception). |
static void |
putRunRemove(MDCEntry entry,
Runnable runnable) |
static void |
putRunRemove(Runnable runnable,
MDCEntry... keysValues) |
static void |
putRunRemove(String key,
String val,
Runnable runnable)
put(String, String) a key/val into the MDC, runs the provided
Runnable, and (ensure that) the given key is
MDC.remove(String)'d (even if there was an exception). |
public static void put(String key, String val)
MDC.put(String, String). Specifically, it:
key (to
detect forgotten remove, instead of overwriting)
null as val
IllegalArgumentException - if val is value is already set (and was previously not
MDC.remove(String))public static void putRunRemove(String key, String val, Runnable runnable)
put(String, String) a key/val into the MDC, runs the provided
Runnable, and (ensure that) the given key is
MDC.remove(String)'d (even if there was an exception).public static void putRunRemove(Map<String,String> keysValues, Runnable runnable)
put(String, String) each key/val of the passed Map into the MDC, runs the provided
Runnable, and (ensure that) the all keys of the Map are
MDC.remove(String)'d (even if there was an exception).Copyright © 2019 OpenDaylight. All rights reserved.