码迷,mamicode.com
首页 > 其他好文 > 详细

IfmContextHolder(ThreadLocal)

时间:2017-12-09 10:18:56      阅读:163      评论:0      收藏:0      [点我收藏+]

标签:pre   private   ring   package   ati   public   cal   tom   ext   

package com.yundaex.wms.config;

public class IfmContextHolder {

    private static final ThreadLocal<String> contextHolder = new ThreadLocal<String>();

    public static void setCustomerType(String customerType) {
        contextHolder.set(customerType);
    }

    public static String getCustomerType() {
        return contextHolder.get();
    }

    public static void clearCustomerType() {
        contextHolder.remove();
    }
}

 

IfmContextHolder(ThreadLocal)

标签:pre   private   ring   package   ati   public   cal   tom   ext   

原文地址:http://www.cnblogs.com/tonggc1668/p/8010611.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!