org.springframework.core.NamedThreadLocal.remove()方法的使用及代码示例

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

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

NamedThreadLocal.remove介绍

暂无

代码示例

代码示例来源:origin: spring-projects/spring-framework

static InjectionPoint setCurrentInjectionPoint(@Nullable InjectionPoint injectionPoint) {
  InjectionPoint old = currentInjectionPoint.get();
  if (injectionPoint != null) {
    currentInjectionPoint.set(injectionPoint);
  }
  else {
    currentInjectionPoint.remove();
  }
  return old;
}

代码示例来源:origin: org.springframework/spring-beans

static InjectionPoint setCurrentInjectionPoint(@Nullable InjectionPoint injectionPoint) {
  InjectionPoint old = currentInjectionPoint.get();
  if (injectionPoint != null) {
    currentInjectionPoint.set(injectionPoint);
  }
  else {
    currentInjectionPoint.remove();
  }
  return old;
}

代码示例来源:origin: spring-projects/spring-framework

/**
 * Obtain a bean instance from the given supplier.
 * @param instanceSupplier the configured supplier
 * @param beanName the corresponding bean name
 * @return a BeanWrapper for the new instance
 * @since 5.0
 * @see #getObjectForBeanInstance
 */
protected BeanWrapper obtainFromSupplier(Supplier<?> instanceSupplier, String beanName) {
  Object instance;
  String outerBean = this.currentlyCreatedBean.get();
  this.currentlyCreatedBean.set(beanName);
  try {
    instance = instanceSupplier.get();
  }
  finally {
    if (outerBean != null) {
      this.currentlyCreatedBean.set(outerBean);
    }
    else {
      this.currentlyCreatedBean.remove();
    }
  }
  if (instance == null) {
    instance = new NullBean();
  }
  BeanWrapper bw = new BeanWrapperImpl(instance);
  initBeanWrapper(bw);
  return bw;
}

代码示例来源:origin: org.springframework/spring-beans

/**
 * Obtain a bean instance from the given supplier.
 * @param instanceSupplier the configured supplier
 * @param beanName the corresponding bean name
 * @return a BeanWrapper for the new instance
 * @since 5.0
 * @see #getObjectForBeanInstance
 */
protected BeanWrapper obtainFromSupplier(Supplier<?> instanceSupplier, String beanName) {
  Object instance;
  String outerBean = this.currentlyCreatedBean.get();
  this.currentlyCreatedBean.set(beanName);
  try {
    instance = instanceSupplier.get();
  }
  finally {
    if (outerBean != null) {
      this.currentlyCreatedBean.set(outerBean);
    }
    else {
      this.currentlyCreatedBean.remove();
    }
  }
  if (instance == null) {
    instance = new NullBean();
  }
  BeanWrapper bw = new BeanWrapperImpl(instance);
  initBeanWrapper(bw);
  return bw;
}

代码示例来源:origin: apache/servicemix-bundles

static InjectionPoint setCurrentInjectionPoint(InjectionPoint injectionPoint) {
  InjectionPoint old = currentInjectionPoint.get();
  if (injectionPoint != null) {
    currentInjectionPoint.set(injectionPoint);
  }
  else {
    currentInjectionPoint.remove();
  }
  return old;
}

相关文章

微信公众号

最新文章

更多