1 4 package org.jboss.test.cmp2.enums.ejb; 5 6 9 public class FacadeUtil 10 { 11 12 private static org.jboss.test.cmp2.enums.ejb.FacadeHome cachedRemoteHome = null; 13 14 16 20 public static org.jboss.test.cmp2.enums.ejb.FacadeHome getHome() throws javax.naming.NamingException 21 { 22 if (cachedRemoteHome == null) { 23 javax.naming.InitialContext initialContext = new javax.naming.InitialContext (); 25 try { 26 java.lang.Object objRef = initialContext.lookup(org.jboss.test.cmp2.enums.ejb.FacadeHome.JNDI_NAME); 27 cachedRemoteHome = (org.jboss.test.cmp2.enums.ejb.FacadeHome) javax.rmi.PortableRemoteObject.narrow(objRef, org.jboss.test.cmp2.enums.ejb.FacadeHome.class); 28 } finally { 29 initialContext.close(); 30 } 31 } 32 return cachedRemoteHome; 33 } 34 35 40 public static org.jboss.test.cmp2.enums.ejb.FacadeHome getHome( java.util.Hashtable environment ) throws javax.naming.NamingException 41 { 42 javax.naming.InitialContext initialContext = new javax.naming.InitialContext (environment); 44 try { 45 java.lang.Object objRef = initialContext.lookup(org.jboss.test.cmp2.enums.ejb.FacadeHome.JNDI_NAME); 46 return (org.jboss.test.cmp2.enums.ejb.FacadeHome) javax.rmi.PortableRemoteObject.narrow(objRef, org.jboss.test.cmp2.enums.ejb.FacadeHome.class); 47 } finally { 48 initialContext.close(); 49 } 50 } 51 52 } | Popular Tags |