1 25 26 package org.objectweb.jonas_ejb.container; 27 28 import java.io.Serializable ; 29 import java.rmi.RemoteException ; 30 31 import javax.ejb.EJBHome ; 32 import javax.ejb.HomeHandle ; 33 import javax.naming.Context ; 34 import javax.naming.InitialContext ; 35 import javax.naming.NamingException ; 36 import javax.rmi.PortableRemoteObject ; 37 38 import org.objectweb.util.monolog.api.BasicLevel; 39 40 46 public class JHomeHandle implements HomeHandle , Serializable { 47 48 51 private String homename = null; 52 53 56 private EJBHome ejbHome = null; 57 58 62 public JHomeHandle(String hname) { 63 homename = hname; 64 } 65 66 70 76 public EJBHome getEJBHome() throws RemoteException { 77 if (TraceEjb.isDebugIc()) { 78 TraceEjb.interp.log(BasicLevel.DEBUG, homename); 79 } 80 Context ic = null; 81 if (ejbHome == null) { 82 try { 83 ic = new InitialContext (); 84 Object o = ic.lookup(homename); 85 ejbHome = (EJBHome ) PortableRemoteObject.narrow(o, EJBHome .class); 86 } catch (NamingException e) { 87 throw new RemoteException ("getEJBHome", e); 88 } 89 } 90 return ejbHome; 91 } 92 } 93 94 95 | Popular Tags |