1 /* 2 * Generated file - Do not edit! 3 */ 4 package org.jboss.test.cmp2.fkmapping.ejb; 5 6 /** 7 * Utility class for Institute. 8 */ 9 public class InstituteUtil 10 { 11 12 /** Cached local home (EJBLocalHome). Uses lazy loading to obtain its value (loaded by getLocalHome() methods). */ 13 private static org.jboss.test.cmp2.fkmapping.ejb.InstituteLocalHome cachedLocalHome = null; 14 15 // Home interface lookup methods 16 17 /** 18 * Obtain local home interface from default initial context 19 * @return Local home interface for Institute. Lookup using JNDI_NAME 20 */ 21 public static org.jboss.test.cmp2.fkmapping.ejb.InstituteLocalHome getLocalHome() throws javax.naming.NamingException 22 { 23 // Local homes shouldn't be narrowed, as there is no RMI involved. 24 if (cachedLocalHome == null) { 25 // Obtain initial context 26 javax.naming.InitialContext initialContext = new javax.naming.InitialContext(); 27 try { 28 cachedLocalHome = (org.jboss.test.cmp2.fkmapping.ejb.InstituteLocalHome) initialContext.lookup(org.jboss.test.cmp2.fkmapping.ejb.InstituteLocalHome.JNDI_NAME); 29 } finally { 30 initialContext.close(); 31 } 32 } 33 return cachedLocalHome; 34 } 35 36 }