|
From: Jeff E. <jem...@fr...> - 2005-12-08 17:19:27
|
If I have a reference to a java object, I often issue these sorts of commands. They are a cross between Python and Java reflection and a bit quicker to type than the raw reflection API. dir(obj.class) dir(obj.class.superclass) obj.class.interfaces dir(obj.class.interfaces[1]) obj.class.declaredMethods obj.class.someMethod.argslist obj.class.interfaces[1].anotherMethod.argslist[0].data Bill Woodward wrote: > Good morning, > > I'm using Jython 2.2a1 to do some client-side testing of a J2EE > application on a somewhat more obscure J2EE application server. In > Jython, I am able to obtain an object from JNDI and call methods on it > in Jython, very nicely, thank you very much. However, when I try to > turn that Jython code into some server-side Java code, I'm running > into a problem. In Jython, I can look at the class (using "<object > name>.__class__"), as well as getting method and variable information > about the class (using "dir(<object name>.__class__)"), but the actual > Java class that is listed is an 'Impl' class. > > In order to use this object in Java, I need to know what interface to > cast it to. The application server is not well documented in this > area, and I'm having trouble finding out what the Java interface is. > Is there any way in Jython to obtain the interface(s) that class > implements? Or should I use the Java reflection classes to get it? > > TIA, > - Bill > > -- > Bill Woodward wp...@sa... http://www.saifa.net > > "I have more trouble with D. L. Moody than with any other man I ever > met." -- D. L. Moody > s/D. L. Moody/Bill Woodward/g > > > ------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. Do you grep through log files > for problems? Stop! Download the new AJAX search engine that makes > searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! > http://ads.osdn.com/?ad_idv37&alloc_id865&op=click > _______________________________________________ > Jython-users mailing list > Jyt...@li... > https://lists.sourceforge.net/lists/listinfo/jython-users |