1 package org.slf4j.spi; 2 3 /** 4 * This interface abstracts the service offered by various MDC 5 * implementations. 6 * 7 * @author Ceki Gülcü 8 * @since 1.4.1 9 */ 10 public interface MDCAdapter { 11 12 /** 13 * Put a context value (the <code>val</code> parameter) as identified with 14 * the <code>key</code> parameter into the current thread's context map. 15 * 16 * <p>If the current thread does not have a context map it is created as a side 17 * effect of this call. 18 */ 19 public void put(String key, String val); 20 21 /** 22 * Get the context identified by the <code>key</code> parameter. 23 * 24 * @return the string value identified by the <code>key</code> parameter. 25 */ 26 public String get(String key); 27 28 /** 29 * Remove the the context identified by the <code>key</code> parameter. 30 */ 31 public void remove(String key); 32 33 /** 34 * Clear all entries in the MDC. 35 */ 36 public void clear(); 37 38 } 39