From: Pierre T. <pie...@gm...> - 2011-01-05 13:37:42
|
Thank you Josh. I am reading The Definitive Guide to Jython. I really like it. The only thing I dislike is the covering about how to use Jython code from the Java side. The chapter 10 on this subject gives some examples but it does not go deep enough for me. What I believe is missing is how to match the Jython types and Java types. Like the "PyString" in the code examples, I don't know where this is coming from. When I'll finish the book, I'll do a review for Apress. I didn't buy the book, I received it from Apress. I'll write a positive review of course :-). 2011/1/4 Josh Juneau <jun...@gm...> > I agree with Pierre on everything...you should definitely take a look at > PlyJy as it will help out a lot. If you have any questions, please let me > know. > > Please accept my apologies if I do not get back to you very quickly, things > are hectic as usual! :) > > Best > > Josh Juneau > jun...@gm... > http://jj-blogger.blogspot.com > http://www.jythonpodcast.com > Twitter ID: javajuneau > > > > On Mon, Jan 3, 2011 at 4:12 PM, Dinesh Sundaram <sp....@gm...>wrote: > >> Hi Pierre, >> >> Thanks for your response.The information helped me.I have one more >> query.Please clarify. >> >> I now have my JythonFactory which has the below Jython reference object >> method(getJythonObject) >> ** >> *public* *static* Object getJythonObject(String interfaceName,String >> pathToJythonModule) >> >> When I try to run the below line in my Main.Java, I get a >> ClassCastException >> >> EmployeeType eType = (EmployeeType) jf.getJythonObject( >> "jyinterface.interfaces.EmployeeType", >> "<<path to module>>/Employee.py"); >> >> Exception in thread "main" *java.lang.ClassCastException*: >> org.python.core.PySingleton cannot be cast to >> jyinterface.interfaces.EmployeeType >> Please suggest how do I access the EmployeeType interface methods >> without casting. >> >> Thanks a lot. >> >> Regards, >> Dinesh. >> >> >> On Mon, Jan 3, 2011 at 3:21 PM, Pierre Thibault < >> pie...@gm...> wrote: >> >>> 2011/1/3 Dinesh Sundaram <sp....@gm...> >>> >>>> Hi All, >>>> >>> >>> Hi! >>> >>> >>>> >>>> I am in a process of developing a new test framework in java.The >>>> framework requires some Jython class and methods to be used. >>>> >>>> I tried few options like JEPP and ClassLoader code but could not >>>> succeed. >>>> >>>> Could you please share some sample java code for the following >>>> requirements >>>> >>>> 1. Import a Jython compiled class say "xyz$py.class " in my java code >>>> and access the jython methods and class in it. >>>> >>> >>> You should look at the chapter 10 of the Definitive Guide to Jython<http://www.jython.org/jythonbook/en/1.0/JythonAndJavaIntegration.html> >>> . >>> >>>> >>>> 2. Methods to directly invoke a Jython class or method in a jython file >>>> say "xyz.py" in my Java code (Not from .class) >>>> >>> >>> I think you cannot you. Jython is producing Java bytecode. >>> >>> >>>> >>>> Thanks a lot and your guidance would be much appreciated. >>>> >>>> Regards, >>>> Dinesh. >>>> >>>> >>>> ------------------------------------------------------------------------------ >>>> Learn how Oracle Real Application Clusters (RAC) One Node allows >>>> customers >>>> to consolidate database storage, standardize their database environment, >>>> and, >>>> should the need arise, upgrade to a full multi-node Oracle RAC database >>>> without downtime or disruption >>>> http://p.sf.net/sfu/oracle-sfdevnl >>>> _______________________________________________ >>>> Jython-users mailing list >>>> Jyt...@li... >>>> https://lists.sourceforge.net/lists/listinfo/jython-users >>>> >>>> >>> >>> >>> -- >>> A+ >>> >>> ------------- >>> Pierre >>> >>> >>> ------------------------------------------------------------------------------ >>> Learn how Oracle Real Application Clusters (RAC) One Node allows >>> customers >>> to consolidate database storage, standardize their database environment, >>> and, >>> should the need arise, upgrade to a full multi-node Oracle RAC database >>> without downtime or disruption >>> http://p.sf.net/sfu/oracle-sfdevnl >>> _______________________________________________ >>> Jython-users mailing list >>> Jyt...@li... >>> https://lists.sourceforge.net/lists/listinfo/jython-users >>> >>> >> >> >> ------------------------------------------------------------------------------ >> Learn how Oracle Real Application Clusters (RAC) One Node allows customers >> to consolidate database storage, standardize their database environment, >> and, >> should the need arise, upgrade to a full multi-node Oracle RAC database >> without downtime or disruption >> http://p.sf.net/sfu/oracle-sfdevnl >> _______________________________________________ >> Jython-users mailing list >> Jyt...@li... >> https://lists.sourceforge.net/lists/listinfo/jython-users >> >> > -- A+ ------------- Pierre My blog (http://posterous.com/people/ZyFJW2iVYBz)<http://posterous.com/people/ZyFJW2iVYBz> YouTube page (http://www.youtube.com/user/tubetib)<http://www.youtube.com/user/tubetib> Twitter (http://twitter.com/pierreth2) <http://twitter.com/pierreth2> Google profile (http://www.google.com/profiles/106045618354056753098)<http://www.google.com/profiles/106045618354056753098> |