org.slf4j.spi.MDCAdapter.remove()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(13.2k)|赞(0)|评价(0)|浏览(125)

本文整理了Java中org.slf4j.spi.MDCAdapter.remove()方法的一些代码示例,展示了MDCAdapter.remove()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。MDCAdapter.remove()方法的具体详情如下:
包路径:org.slf4j.spi.MDCAdapter
类名称:MDCAdapter
方法名:remove

MDCAdapter.remove介绍

[英]Remove the the context identified by the key parameter. The key parameter cannot be null.

This method does nothing if there is no previous value associated with key.
[中]删除由key参数标识的上下文。key参数不能为空。
如果之前没有与key关联的值,则此方法不会执行任何操作。

代码示例

代码示例来源:origin: redisson/redisson

/**
 * Remove the diagnostic context identified by the <code>key</code> parameter using
 * the underlying system's MDC implementation. The <code>key</code> parameter
 * cannot be null. This method does nothing if there is no previous value
 * associated with <code>key</code>.
 *
 * @param key  
 * @throws IllegalArgumentException
 *           in case the "key" parameter is null
 */
public static void remove(String key) throws IllegalArgumentException {
  if (key == null) {
    throw new IllegalArgumentException("key parameter cannot be null");
  }
  if (mdcAdapter == null) {
    throw new IllegalStateException("MDCAdapter cannot be null. See also " + NULL_MDCA_URL);
  }
  mdcAdapter.remove(key);
}

代码示例来源:origin: wildfly/wildfly

/**
 * Remove the diagnostic context identified by the <code>key</code> parameter using
 * the underlying system's MDC implementation. The <code>key</code> parameter
 * cannot be null. This method does nothing if there is no previous value
 * associated with <code>key</code>.
 *
 * @param key  
 * @throws IllegalArgumentException
 *           in case the "key" parameter is null
 */
public static void remove(String key) throws IllegalArgumentException {
  if (key == null) {
    throw new IllegalArgumentException("key parameter cannot be null");
  }
  if (mdcAdapter == null) {
    throw new IllegalStateException("MDCAdapter cannot be null. See also " + NULL_MDCA_URL);
  }
  mdcAdapter.remove(key);
}

代码示例来源:origin: camunda/camunda-bpm-platform

/**
 * Remove the diagnostic context identified by the <code>key</code> parameter using
 * the underlying system's MDC implementation. The <code>key</code> parameter
 * cannot be null. This method does nothing if there is no previous value
 * associated with <code>key</code>.
 *
 * @param key  
 * @throws IllegalArgumentException
 *           in case the "key" parameter is null
 */
public static void remove(String key) throws IllegalArgumentException {
 if (key == null) {
  throw new IllegalArgumentException("key parameter cannot be null");
 }
 if (mdcAdapter == null) {
  throw new IllegalStateException("MDCAdapter cannot be null. See also "
    + NULL_MDCA_URL);
 }
 mdcAdapter.remove(key);
}

代码示例来源:origin: org.echocat.jomon/runtime

@Override
public void remove(String key) {
  _delegate.remove(key);
}

代码示例来源:origin: ops4j/org.ops4j.pax.logging

private void clearDelegateContext() 
{
  MDCAdapter adapter = MDC.getMDCAdapter();
  if (m_bundle != null && adapter != null) {
    adapter.remove("bundle.id");
    adapter.remove("bundle.name");
    adapter.remove("bundle.version");
  }
  // No need to clear the underlying MDC
  // See PAXLOGGING-165.
}

代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-jruby

/**
 * Remove the diagnostic context identified by the <code>key</code> parameter using
 * the underlying system's MDC implementation. The <code>key</code> parameter
 * cannot be null. This method does nothing if there is no previous value
 * associated with <code>key</code>.
 *
 * @param key  
 * @throws IllegalArgumentException
 *           in case the "key" parameter is null
 */
public static void remove(String key) throws IllegalArgumentException {
 if (key == null) {
  throw new IllegalArgumentException("key parameter cannot be null");
 }
 if (mdcAdapter == null) {
  throw new IllegalStateException("MDCAdapter cannot be null. See also "
    + NULL_MDCA_URL);
 }
 mdcAdapter.remove(key);
}

代码示例来源:origin: com.github.oshi/oshi-core-shaded

/**
 * Remove the diagnostic context identified by the <code>key</code> parameter using
 * the underlying system's MDC implementation. The <code>key</code> parameter
 * cannot be null. This method does nothing if there is no previous value
 * associated with <code>key</code>.
 *
 * @param key  
 * @throws IllegalArgumentException
 *           in case the "key" parameter is null
 */
public static void remove(String key) throws IllegalArgumentException {
  if (key == null) {
    throw new IllegalArgumentException("key parameter cannot be null");
  }
  if (mdcAdapter == null) {
    throw new IllegalStateException("MDCAdapter cannot be null. See also " + NULL_MDCA_URL);
  }
  mdcAdapter.remove(key);
}

代码示例来源:origin: wolpi/prim-ftpd

/**
 * Remove the the context identified by the <code>key</code> parameter using
 * the underlying system's MDC implementation. The <code>key</code> parameter
 * cannot be null. This method does nothing if there is no previous value
 * associated with <code>key</code>.
 * 
 * @throws IllegalArgumentException
 *           in case the "key" parameter is null
 */
public static void remove(String key) throws IllegalArgumentException {
 if (key == null) {
  throw new IllegalArgumentException("key parameter cannot be null");
 }
 if (mdcAdapter == null) {
  throw new IllegalStateException("MDCAdapter cannot be null. See also "
    + NULL_MDCA_URL);
 }
 mdcAdapter.remove(key);
}

代码示例来源:origin: org.apache.activemq/activemq-all

/**
 * Remove the diagnostic context identified by the <code>key</code> parameter using
 * the underlying system's MDC implementation. The <code>key</code> parameter
 * cannot be null. This method does nothing if there is no previous value
 * associated with <code>key</code>.
 *
 * @param key  
 * @throws IllegalArgumentException
 *           in case the "key" parameter is null
 */
public static void remove(String key) throws IllegalArgumentException {
  if (key == null) {
    throw new IllegalArgumentException("key parameter cannot be null");
  }
  if (mdcAdapter == null) {
    throw new IllegalStateException("MDCAdapter cannot be null. See also " + NULL_MDCA_URL);
  }
  mdcAdapter.remove(key);
}

代码示例来源:origin: org.apache.directory.api/api-ldap-client-all

/**
 * Remove the diagnostic context identified by the <code>key</code> parameter using
 * the underlying system's MDC implementation. The <code>key</code> parameter
 * cannot be null. This method does nothing if there is no previous value
 * associated with <code>key</code>.
 *
 * @param key  
 * @throws IllegalArgumentException
 *           in case the "key" parameter is null
 */
public static void remove(String key) throws IllegalArgumentException {
  if (key == null) {
    throw new IllegalArgumentException("key parameter cannot be null");
  }
  if (mdcAdapter == null) {
    throw new IllegalStateException("MDCAdapter cannot be null. See also " + NULL_MDCA_URL);
  }
  mdcAdapter.remove(key);
}

代码示例来源:origin: com.impetus.fabric/fabric-jdbc-driver-shaded

/**
 * Remove the diagnostic context identified by the <code>key</code> parameter using
 * the underlying system's MDC implementation. The <code>key</code> parameter
 * cannot be null. This method does nothing if there is no previous value
 * associated with <code>key</code>.
 *
 * @param key  
 * @throws IllegalArgumentException
 *           in case the "key" parameter is null
 */
public static void remove(String key) throws IllegalArgumentException {
  if (key == null) {
    throw new IllegalArgumentException("key parameter cannot be null");
  }
  if (mdcAdapter == null) {
    throw new IllegalStateException("MDCAdapter cannot be null. See also " + NULL_MDCA_URL);
  }
  mdcAdapter.remove(key);
}

代码示例来源:origin: at.bestsolution.efxclipse.eclipse/org.slf4j.api

/**
 * Remove the diagnostic context identified by the <code>key</code> parameter using
 * the underlying system's MDC implementation. The <code>key</code> parameter
 * cannot be null. This method does nothing if there is no previous value
 * associated with <code>key</code>.
 *
 * @param key  
 * @throws IllegalArgumentException
 *           in case the "key" parameter is null
 */
public static void remove(String key) throws IllegalArgumentException {
 if (key == null) {
  throw new IllegalArgumentException("key parameter cannot be null");
 }
 if (mdcAdapter == null) {
  throw new IllegalStateException("MDCAdapter cannot be null. See also "
    + NULL_MDCA_URL);
 }
 mdcAdapter.remove(key);
}

代码示例来源:origin: ops4j/org.ops4j.pax.logging

/**
 * Remove the diagnostic context identified by the <code>key</code> parameter using
 * the underlying system's MDC implementation. The <code>key</code> parameter
 * cannot be null. This method does nothing if there is no previous value
 * associated with <code>key</code>.
 *
 * @param key  
 * @throws IllegalArgumentException
 *           in case the "key" parameter is null
 */
public static void remove(String key) throws IllegalArgumentException {
  if (key == null) {
    throw new IllegalArgumentException("key parameter cannot be null");
  }
  if (mdcAdapter == null) {
    throw new IllegalStateException("MDCAdapter cannot be null. See also " + NULL_MDCA_URL);
  }
  mdcAdapter.remove(key);
}

代码示例来源:origin: com.alibaba.citrus.tool/antx-autoexpand

/**
 * Remove the the context identified by the <code>key</code> parameter using
 * the underlying system's MDC implementation. The  <code>key</code> parameter 
 * cannot be null. This method does nothing if there is no previous value 
 * associated with <code>key</code>.
 * 
 * @throws IllegalArgumentException in case the "key" parameter is null
 */
public static void remove(String key) throws IllegalArgumentException {
 if (key == null) {
  throw new IllegalArgumentException("key parameter cannot be null");
 }
 
 if (mdcAdapter == null) {
  throw new IllegalStateException("MDCAdapter cannot be null. See also "
    + NULL_MDCA_URL);
 }
 mdcAdapter.remove(key);
}

代码示例来源:origin: org.jboss.eap/wildfly-client-all

/**
 * Remove the diagnostic context identified by the <code>key</code> parameter using
 * the underlying system's MDC implementation. The <code>key</code> parameter
 * cannot be null. This method does nothing if there is no previous value
 * associated with <code>key</code>.
 *
 * @param key  
 * @throws IllegalArgumentException
 *           in case the "key" parameter is null
 */
public static void remove(String key) throws IllegalArgumentException {
  if (key == null) {
    throw new IllegalArgumentException("key parameter cannot be null");
  }
  if (mdcAdapter == null) {
    throw new IllegalStateException("MDCAdapter cannot be null. See also " + NULL_MDCA_URL);
  }
  mdcAdapter.remove(key);
}

代码示例来源:origin: io.virtdata/virtdata-lib-realer

/**
 * Remove the diagnostic context identified by the <code>key</code> parameter using
 * the underlying system's MDC implementation. The <code>key</code> parameter
 * cannot be null. This method does nothing if there is no previous value
 * associated with <code>key</code>.
 *
 * @param key  
 * @throws IllegalArgumentException
 *           in case the "key" parameter is null
 */
public static void remove(String key) throws IllegalArgumentException {
  if (key == null) {
    throw new IllegalArgumentException("key parameter cannot be null");
  }
  if (mdcAdapter == null) {
    throw new IllegalStateException("MDCAdapter cannot be null. See also " + NULL_MDCA_URL);
  }
  mdcAdapter.remove(key);
}

代码示例来源:origin: Nextdoor/bender

/**
 * Remove the diagnostic context identified by the <code>key</code> parameter using
 * the underlying system's MDC implementation. The <code>key</code> parameter
 * cannot be null. This method does nothing if there is no previous value
 * associated with <code>key</code>.
 *
 * @param key  
 * @throws IllegalArgumentException
 *           in case the "key" parameter is null
 */
public static void remove(String key) throws IllegalArgumentException {
  if (key == null) {
    throw new IllegalArgumentException("key parameter cannot be null");
  }
  if (mdcAdapter == null) {
    throw new IllegalStateException("MDCAdapter cannot be null. See also " + NULL_MDCA_URL);
  }
  mdcAdapter.remove(key);
}

代码示例来源:origin: com.ning.billing/killbill-osgi-bundles-analytics

/**
 * Remove the diagnostic context identified by the <code>key</code> parameter using
 * the underlying system's MDC implementation. The <code>key</code> parameter
 * cannot be null. This method does nothing if there is no previous value
 * associated with <code>key</code>.
 *
 * @param key  
 * @throws IllegalArgumentException
 *           in case the "key" parameter is null
 */
public static void remove(String key) throws IllegalArgumentException {
 if (key == null) {
  throw new IllegalArgumentException("key parameter cannot be null");
 }
 if (mdcAdapter == null) {
  throw new IllegalStateException("MDCAdapter cannot be null. See also "
    + NULL_MDCA_URL);
 }
 mdcAdapter.remove(key);
}

代码示例来源:origin: uk.co.nichesolutions/slf4j-api

/**
 * Remove the diagnostic context identified by the <code>key</code> parameter using
 * the underlying system's MDC implementation. The <code>key</code> parameter
 * cannot be null. This method does nothing if there is no previous value
 * associated with <code>key</code>.
 *
 * @param key  
 * @throws IllegalArgumentException
 *           in case the "key" parameter is null
 */
public static void remove(String key) throws IllegalArgumentException {
  if (key == null) {
    throw new IllegalArgumentException("key parameter cannot be null");
  }
  if (mdcAdapter == null) {
    throw new IllegalStateException("MDCAdapter cannot be null. See also " + NULL_MDCA_URL);
  }
  mdcAdapter.remove(key);
}

代码示例来源:origin: org.kill-bill.billing/killbill-platform-osgi-bundles-logger

/**
 * Remove the diagnostic context identified by the <code>key</code> parameter using
 * the underlying system's MDC implementation. The <code>key</code> parameter
 * cannot be null. This method does nothing if there is no previous value
 * associated with <code>key</code>.
 *
 * @param key  
 * @throws IllegalArgumentException
 *           in case the "key" parameter is null
 */
public static void remove(String key) throws IllegalArgumentException {
  if (key == null) {
    throw new IllegalArgumentException("key parameter cannot be null");
  }
  if (mdcAdapter == null) {
    throw new IllegalStateException("MDCAdapter cannot be null. See also " + NULL_MDCA_URL);
  }
  mdcAdapter.remove(key);
}

相关文章