Java tutorial
//package com.java2s; import java.util.Map; public class Main { public static final ThreadLocal<Map<String, Object>> threadCacheHolder = new ThreadLocal(); public static Object get(String key) { Map<String, Object> threadCache = threadCacheHolder.get(); if (threadCache == null) { return null; } return threadCache.get(key); } }