1 23 24 package org.objectweb.jorm.facility.naming.polymorphid; 25 26 import org.objectweb.jorm.api.PMapper; 27 import org.objectweb.jorm.api.PException; 28 29 import java.util.HashMap ; 30 31 36 public class PolymorphIdMgrRegistry { 37 static HashMap mgrs = new HashMap (); 38 39 42 public static void deregisterPolymorphIdMgr(PolymorphIdMgr pim) { 43 mgrs.remove(pim.getPMapper()); 44 } 45 46 49 public static PolymorphIdMgr getPolymorphIdMgr(PMapper m) { 50 PolymorphIdMgr res; 51 res = (PolymorphIdMgr) mgrs.get(m); 52 return res; 53 } 54 55 58 public static synchronized void registerPolymorphIdMgr(PolymorphIdMgr pim) 59 throws PException { 60 if (mgrs.get(pim.getPMapper()) != null) { 61 throw new PException("PolymorphIdMgr already registered."); 62 } 63 mgrs.put(pim.getPMapper(), pim); 64 } 65 } 66 | Popular Tags |