1 22 package org.jboss.system; 23 24 import java.util.Map ; 25 26 import org.jboss.logging.Logger; 27 28 import EDU.oswego.cs.dl.util.concurrent.ConcurrentReaderHashMap; 29 30 40 public class Registry 41 { 42 private static final Logger log = Logger.getLogger(Registry.class); 43 44 public static Map entries = new ConcurrentReaderHashMap(); 45 46 public static void bind(final Object key, final Object value) 47 { 48 entries.put(key, value); 49 if(log.isTraceEnabled()) 50 log.trace("bound " + key + "=" + value); 51 } 52 53 public static Object unbind(final Object key) 54 { 55 Object obj = entries.remove(key); 56 if(log.isTraceEnabled()) 57 log.trace("unbound " + key + "=" + obj); 58 return obj; 59 } 60 61 public static Object lookup(final Object key) 62 { 63 Object obj = entries.get(key); 64 if(log.isTraceEnabled()) 65 log.trace("lookup " + key + "=" + obj); 66 return obj; 67 } 68 } 69 | Popular Tags |