I have a cache which I implemented using a simeple HashMap. like -
HashMap cache = new HashMap();
What about CopyOnWrite.. collections:
java.util.concurrent.CopyOnWriteArraySet java.util.concurrent.CopyOnWriteArraySet and org.apache.mina.util.CopyOnWriteMap
They can be a good match in your case and they are thread-safe.