001    package railo.runtime.dump;
002    
003    import java.util.HashMap;
004    import java.util.Map;
005    
006    
007    public class ThreadLocalDump {
008    
009            private static ThreadLocal<Map<Object,String>> local=new ThreadLocal<Map<Object,String>>();
010    
011            public static void set(Object o, String c) {
012                    
013                    touch().put(o,c);
014            }
015    
016            public static Map<Object, String> getMap() {
017                    return touch();
018            }
019            
020            public static void remove(Object o) {
021                    touch().remove(o);
022            }
023            
024            public static String get(Object obj) {
025                    Map<Object,String> list = touch();
026                    return list.get(obj);
027            }
028    
029            private static Map<Object,String> touch() {
030                    Map<Object,String> set = local.get();
031                    if(set==null) {
032                            set = new HashMap<Object,String>();
033                            local.set(set);
034                    }
035                    return set;
036            }
037    
038    }
039    
040