/** * Clears all cells related MDC entries and the NDC. */ public static void clear() { MDC.remove(MDC_DOMAIN); MDC.remove(MDC_CELL); MDC.remove(MDC_SESSION); NDC.clear(); } }
/** * Setup the cell diagnostic context of the calling * thread. Threads created from the calling thread automatically * inherit this information. The old diagnostic context is * captured and returned. */ public static CDC reset(String cellName, String domainName) { CDC cdc = new CDC(); setMdc(MDC_CELL, cellName); setMdc(MDC_DOMAIN, domainName); MDC.remove(MDC_SESSION); NDC.clear(); return cdc; }
private void apply() { setMdc(MDC_DOMAIN, _domain); setMdc(MDC_CELL, _cell); setMdc(MDC_SESSION, _session); if (_ndc == null) { NDC.clear(); } else { NDC.set(_ndc); } }