public class ThreadProperty{
private static ThreadLocal<Map<String, Object>> threadProperty= new ThreadLocal<Map<String, Object>>() {
protected synchronized Map<String, Object> initialValue() {
return new HashMap<String, Object>();
}
};
public static Object getProperty(String name) {
return threadProperty.get().get(name);
}
public static Object setgetProperty(String name, Object value) {
return threadProperty.get().put(name, value);
}
}
private static ThreadLocal<Map<String, Object>> threadProperty= new ThreadLocal<Map<String, Object>>() {
protected synchronized Map<String, Object> initialValue() {
return new HashMap<String, Object>();
}
};
public static Object getProperty(String name) {
return threadProperty.get().get(name);
}
public static Object setgetProperty(String name, Object value) {
return threadProperty.get().put(name, value);
}
}