@@ -0,0 +1,1400 @@
+package com.alibaba.mtc;%0A%0Aimport java.util.Map;%0Aimport java.util.concurrent.ConcurrentHashMap;%0A%0A/**%0A * @author ding.lid%0A * @since 0.10.0%0A */%0Apublic class MtContextThreadLocal%3CT%3E extends InheritableThreadLocal%3CT%3E %7B%0A    /**%0A     * Override this method to have an initial value other than %3Ctt%3Enull%3C/tt%3E.%0A     *%0A     * @see %7B@link ThreadLocal#initialValue()%7D%0A     */%0A    @Override%0A    protected T initialValue() %7B%0A        return super.initialValue();%0A    %7D%0A%0A    /**%0A     * @see %7B@link java.lang.InheritableThreadLocal#childValue(Object)%7D%0A     */%0A    @Override%0A    protected T childValue(T parentValue) %7B%0A        return super.childValue(parentValue);%0A    %7D%0A%0A    protected T copiedMtContextValue() %7B%0A        return get();%0A    %7D%0A%0A    @Override%0A    public T get() %7B%0A        T value = super.get();%0A        addMtContextThreadLocal();%0A        return value;%0A    %7D%0A%0A    @Override%0A    public void set(T value) %7B%0A        super.set(value);%0A        addMtContextThreadLocal();%0A    %7D%0A%0A    @Override%0A    public void remove() %7B%0A        removeMtContextThreadLocal();%0A        super.remove();%0A    %7D%0A%0A    static Map%3CMtContextThreadLocal%3C?%3E, Object%3E holder = new ConcurrentHashMap%3CMtContextThreadLocal%3C?%3E, Object%3E(); // FIXME Use WeakReference so as to avoid memory leak %0A%0A    void addMtContextThreadLocal() %7B%0A        holder.put(this, null);%0A    %7D%0A%0A    void removeMtContextThreadLocal() %7B%0A        holder.remove(this);%0A    %7D%0A%7D%0A

add MtContextThreadLocal class