1 7 package org.enhydra.pim.spec; 8 9 import org.enhydra.pim.business.PersonManagerI; 10 import org.enhydra.pim.exception.EnhydraPimException; 11 12 17 public class PersonManagerFactory { 18 19 private static final String EJB_LOCAL_HOME = "org.enhydra.pim.ejb.session.PersonManagerLocalHome"; 20 21 private static final String EJB_UTIL_CLASS_NAME = "org.enhydra.pim.ejb.session.PersonManagerUtil"; 22 23 private static PersonManagerI personManager = null; 24 25 28 public static PersonManagerI getPersonManager() throws EnhydraPimException { 29 30 if (personManager == null) { 31 try { 32 if (SpecUtil.useEjb) { 33 Object manager = SpecUtil.getLocalEjbManagerObject(EJB_UTIL_CLASS_NAME, EJB_LOCAL_HOME); 34 personManager = (PersonManagerI) manager; 35 return personManager; 36 } 37 Class objectClass = Class.forName("org.enhydra.pim.business.PersonManager"); 38 personManager = (PersonManagerI) objectClass.newInstance(); 39 } catch (Exception ex) { 40 } 41 } 42 return personManager; 43 } 44 } | Popular Tags |