`

TheadLoacl 用法

    博客分类:
  • J2SE
 
阅读更多
写道


public class LabelContextHolder {
private static ThreadLocal<Label> contextHolder = new ThreadLocal<Label>();

public static void setLabel(Label label) {
contextHolder.set(label);
}

public static Label getLabel() {
return contextHolder.get();
}

public static void clear() {
contextHolder.remove();
}
}
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics