1 28 29 package org.apache.commons.transaction.memory.jca; 30 31 import java.util.HashMap ; 32 import java.util.Map ; 33 34 import org.apache.commons.transaction.memory.TransactionalMapWrapper; 35 36 41 public class MemoryMapResourceManager { 42 43 protected static MemoryMapResourceManager instance = new MemoryMapResourceManager(); 44 45 public static MemoryMapResourceManager getInstance() { 46 return instance; 47 } 48 49 protected Map maps = new HashMap (); 50 51 public synchronized TransactionalMapWrapper lookup(Object id) { 52 53 TransactionalMapWrapper map = (TransactionalMapWrapper) maps.get(id); 54 if (map == null) { 56 map = new TransactionalMapWrapper(new HashMap ()); 57 maps.put(id, map); 58 } 59 60 return map; 61 } 62 } 63 | Popular Tags |