1 23 24 package org.objectweb.jorm.facility.naming.generator; 25 26 import org.objectweb.jorm.api.PMapper; 27 import org.objectweb.jorm.api.PException; 28 29 import java.util.HashMap ; 30 31 35 public class LongGenMgrRegistry { 36 static HashMap mgrs = new HashMap (); 37 38 41 public static void deregisterLonGenMgr(LongGenMgr lgm) { 42 mgrs.remove(lgm.getPMapper()); 43 } 44 45 48 public static LongGenMgr getLongGenMgr(PMapper m) { 49 LongGenMgr res; 50 res = (LongGenMgr) mgrs.get(m); 51 return res; 52 } 53 54 57 public static synchronized void registerLonGenMgr(LongGenMgr lgm) 58 throws PException { 59 if (mgrs.get(lgm.getPMapper()) != null) { 60 throw new PException("LongGenMgr already registered."); 61 } 62 mgrs.put(lgm.getPMapper(), lgm); 63 } 64 } 65 | Popular Tags |