Thread: [Ejtools-cvs] CVS: applications/jndi.browser/src/main/net/sourceforge/ejtools/jndibrowser/model/ejb
Brought to you by:
letiemble
From: Laurent E. <let...@us...> - 2002-04-30 21:13:23
|
Update of /cvsroot/ejtools/applications/jndi.browser/src/main/net/sourceforge/ejtools/jndibrowser/model/ejb In directory usw-pr-cvs1:/tmp/cvs-serv6009/applications/jndi.browser/src/main/net/sourceforge/ejtools/jndibrowser/model/ejb Modified Files: EJBHomeProxy.java EJBObjectProxy.java PropertyChanger.java Log Message: Add getTitle support for I18N Pretty print source code Index: EJBHomeProxy.java =================================================================== RCS file: /cvsroot/ejtools/applications/jndi.browser/src/main/net/sourceforge/ejtools/jndibrowser/model/ejb/EJBHomeProxy.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** EJBHomeProxy.java 22 Apr 2002 17:38:59 -0000 1.1 --- EJBHomeProxy.java 30 Apr 2002 21:13:19 -0000 1.2 *************** *** 7,11 **** package net.sourceforge.ejtools.jndibrowser.model.ejb; - // Standard Imports import java.awt.Component; import java.beans.BeanInfo; --- 7,10 ---- *************** *** 19,24 **** import javax.rmi.PortableRemoteObject; - // Other Imports - //import com.dreambean.awt.GenericCustomizer; import net.sourceforge.ejtools.awt.GenericCustomizer; import net.sourceforge.ejtools.jndibrowser.model.JNDIEntry; --- 18,21 ---- *************** *** 36,42 **** /**Description of the Field */ protected BeanInfo info; - protected BeanInfo proxyInfo; /**Description of the Field */ protected EJBHome home; --- 33,40 ---- /**Description of the Field */ protected BeanInfo info; /**Description of the Field */ protected EJBHome home; + /** Description of the Field */ + protected Object proxy; *************** *** 60,70 **** } ! this.info = Introspector.getBeanInfo(this.getClass()); ! this.proxyInfo = Introspector.getBeanInfo(this.homeClass); ! ! System.out.println("BeanInfo " +info ); ! System.out.println("BeanInfo " +proxyInfo ); ! this.className = homeClass.getName(); } --- 58,64 ---- } ! this.info = Introspector.getBeanInfo(this.homeClass); this.className = homeClass.getName(); + this.proxy = Proxy.newProxyInstance(homeClass.getClassLoader(), new Class[]{BeanInfo.class, homeClass}, this); } *************** *** 81,85 **** try { ! c = new GenericCustomizer(Proxy.newProxyInstance(homeClass.getClassLoader(), new Class[]{BeanInfo.class, homeClass}, this)); } catch (Exception e) --- 75,79 ---- try { ! c = new GenericCustomizer(proxy); } catch (Exception e) *************** *** 105,113 **** if (method.getDeclaringClass().equals(BeanInfo.class)) { ! if (method.getName().startsWith("getIcon")){ ! return method.invoke(info, args); ! }else{ ! return method.invoke(proxyInfo, args); ! } } else if (method.getDeclaringClass().equals(Object.class)) --- 99,103 ---- if (method.getDeclaringClass().equals(BeanInfo.class)) { ! return method.invoke(info, args); } else if (method.getDeclaringClass().equals(Object.class)) *************** *** 142,151 **** } ! /* ! * public String toString() ! * { ! * return homeClass.getName().substring(homeClass.getName().lastIndexOf(".") + 1); ! * } ! */ } - --- 132,140 ---- } ! ! public String toString() ! { ! return homeClass.getName().substring(homeClass.getName().lastIndexOf(".") + 1); ! } ! } Index: EJBObjectProxy.java =================================================================== RCS file: /cvsroot/ejtools/applications/jndi.browser/src/main/net/sourceforge/ejtools/jndibrowser/model/ejb/EJBObjectProxy.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** EJBObjectProxy.java 22 Apr 2002 17:38:59 -0000 1.1 --- EJBObjectProxy.java 30 Apr 2002 21:13:19 -0000 1.2 *************** *** 7,11 **** package net.sourceforge.ejtools.jndibrowser.model.ejb; - // Standard Imports import java.awt.Component; import java.beans.BeanInfo; --- 7,10 ---- *************** *** 20,25 **** import javax.ejb.EJBObject; - // Other Imports - //import com.dreambean.awt.GenericCustomizer; import net.sourceforge.ejtools.awt.GenericCustomizer; import net.sourceforge.ejtools.jndibrowser.model.JNDIEntry; --- 19,22 ---- *************** *** 34,52 **** { /** Description of the Field */ ! BeanInfo info; ! /** Description of the Field */ ! BeanInfo proxyInfo; /** Description of the Field */ ! Object obj; /** Description of the Field */ ! Customizer c; /** Description of the Field */ ! Class remote; /** Description of the Field */ ! String desc; /** Description of the Field */ ! Object proxy; /** Description of the Field */ ! PropertyChangeSupport ps; --- 31,47 ---- { /** Description of the Field */ ! protected BeanInfo info; /** Description of the Field */ ! protected Object obj; /** Description of the Field */ ! protected transient Customizer c; /** Description of the Field */ ! protected Class remote; /** Description of the Field */ ! protected String desc; /** Description of the Field */ ! protected Object proxy; /** Description of the Field */ ! protected PropertyChangeSupport ps; *************** *** 71,82 **** } ! this.info = Introspector.getBeanInfo(this.getClass()); ! this.proxyInfo = Introspector.getBeanInfo(this.remote); ! ! proxy = Proxy.newProxyInstance(cl, ! new Class[]{BeanInfo.class, remote, PropertyChanger.class}, ! this); ! ! ps = new PropertyChangeSupport(proxy); } --- 66,72 ---- } ! this.info = Introspector.getBeanInfo(this.remote); ! this.proxy = Proxy.newProxyInstance(cl, new Class[]{BeanInfo.class, remote, PropertyChanger.class}, this); ! this.ps = new PropertyChangeSupport(proxy); } *************** *** 108,120 **** public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { - System.out.println("Invoke " + method); if (method.getDeclaringClass().equals(BeanInfo.class)) { ! System.out.println("Invoke " + method.getName()); ! if (method.getName().equals("getIcon")){ ! return method.invoke(info, args); ! }else{ ! return method.invoke(proxyInfo, args); ! } } else if (method.getDeclaringClass().equals(Object.class)) --- 98,104 ---- public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { if (method.getDeclaringClass().equals(BeanInfo.class)) { ! return method.invoke(info, args); } else if (method.getDeclaringClass().equals(Object.class)) *************** *** 160,177 **** if (desc == null) { ! /* ! * try ! * { ! * Method m = EJBObject.class.getMethod("getPrimaryKey", new Class[0]); ! * desc = m.invoke(obj, new Object[0]).toString(); ! * } ! * catch (Exception e) ! * { ! */ ! // desc = remote.getName().substring(remote.getName().lastIndexOf(".") + 1); ! desc = remote.toString(); ! /* ! * } ! */ } return desc; --- 144,160 ---- if (desc == null) { ! try ! { ! Method m = EJBObject.class.getMethod("getPrimaryKey", new Class[0]); ! desc = m.invoke(obj, new Object[0]).toString(); ! } ! catch (Exception e) ! { ! ! desc = remote.getName().substring(remote.getName().lastIndexOf(".") + 1); ! //desc = remote.toString(); ! ! } ! } return desc; Index: PropertyChanger.java =================================================================== RCS file: /cvsroot/ejtools/applications/jndi.browser/src/main/net/sourceforge/ejtools/jndibrowser/model/ejb/PropertyChanger.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** PropertyChanger.java 22 Apr 2002 17:41:03 -0000 1.1 --- PropertyChanger.java 30 Apr 2002 21:13:19 -0000 1.2 *************** *** 7,11 **** package net.sourceforge.ejtools.jndibrowser.model.ejb; - // Standard Imports import java.beans.PropertyChangeListener; --- 7,10 ---- |