Also without thinking about to long we may be wise to use a [ConcurrentHashMap](http://docs.oracle.com/javase/1.5.0/docs/api/java/util/concurrent/ConcurrentHashMap.html). This takes care of all the synchronized stuff by being threadsafe.