/** * Get the current thread's MDC as a map. * */ public static Map getContext() { if (setContext()) { return m_context.getContext(); } else { return m_defaultContext.getContext(); } }
/** Get the context identified by the <code>key</code> parameter. <p>This method has no side effects. */ static public Object get(String key) { if (setContext()) { return m_context.get(key); } else { return m_defaultContext.get(key); } }
/** Remove the the context identified by the <code>key</code> parameter. */ public static void remove(String key) { if (setContext()) { m_context.remove(key); } else { m_defaultContext.remove(key); } }
/** Clear map with key/value in current thread's MDC */ public static void clear() { if (setContext()) { m_context.clear(); } else { m_defaultContext.clear(); } }
/** Put a context value (the <code>o</code> parameter) as identified with the <code>key</code> parameter into the current thread's context map. <p>If the current thread does not have a context map it is created as a side effect. */ static public void put(String key, Object o) { if (setContext()) { m_context.put(key, o); } else { m_defaultContext.put(key, o); } }