package com.menglar.soap.item.common.utils;
public class ThreadLocalUtils {
private final static ThreadLocal<Object> userThreadLocal = new ThreadLocal<>();
/**
* 设置数据到当前线程
*/
public static void set(Object o){
userThreadLocal.set(o);
}
/**
* 获取线程中的数据
* @return
*/
public static Object get( ){
return userThreadLocal.get();
}
}
ThreadLocalUtils (工具类四)
最新推荐文章于 2024-10-01 08:05:58 发布