1 7 package org.ejtools.jndi.browser.model.ejb; 8 9 import javax.ejb.EJBLocalHome ; 10 import javax.naming.Context ; 11 import javax.rmi.PortableRemoteObject ; 12 13 import org.ejtools.jndi.browser.model.JNDIEntry; 14 15 34 public class EJBLocalHomeProxy extends JNDIEntry 35 { 36 37 protected EJBLocalHome home; 38 39 protected Class homeClass; 40 41 42 49 public EJBLocalHomeProxy(Context context, String jndiName) 50 throws Exception 51 { 52 Object o = context.lookup(jndiName); 54 home = (EJBLocalHome ) PortableRemoteObject.narrow(o, EJBLocalHome .class); 55 56 Class [] intf = home.getClass().getInterfaces(); 58 for (int i = 0; i < intf.length; i++) 59 { 60 if (EJBLocalHome .class.isAssignableFrom(intf[i])) 61 { 62 homeClass = intf[i]; 63 } 64 } 65 66 this.setName(jndiName); 67 this.setClassName(homeClass.getName()); 68 } 69 70 71 76 public String toString() 77 { 78 return homeClass.getName().substring(homeClass.getName().lastIndexOf(".") + 1); 79 } 80 81 } 82 | Popular Tags |