|
Hi Jon, the problem I see is: marketing guys are telling the rpg guys calling java methods is cool, the threading issues are solved, if you compile your rpg with *serialize. rpg programmers don't know anything about multi-threading and therefor I never would call any rpg programm or procedure synchronous via jni. I wouldrecommend to use stored procedures for programs and UDFs for subprocedures. Dieter Am Sonntag, 17. März 2002 21:00 schrieben Sie: > >> but you must be careful with threading issues. The rpg must not call > >> any > > java function that might start another thread. > > Agreed but I'm mostly interested in Java calling RPG than the other way > round. There are also problems with RPG creating Java object in that you > have to do your own "garbage collection" as the JVM doesn't know about nay > object the RPG creates and can't clean them up. > > As to examples - Barabara Morris wrote a piece for iSeries Magazine but I > can't find the article on the web site. The source code can be found at > our old companies web site (they haven't cleaned up the pages so they are > still there) the URL is http://www.e400.com/JonSusan/HansAndBarbaraMay.html > and click on the "Get source files" link alongside the Java reference. > > The RPG manual has a lot of good stuff in it on the subject but the > examples are not too wonderful. > > In essence, all you need to do is add: > > EXTPROC(*JAVA:'classname' :'methodname') to the Prototype of the > subprocedure. Then you simply add the native method prototype to your Java > code, and make sure you invoke the System.load method in your class to load > the service program containing the native method(s). > > The only real drawback is that because the compiler does such a lot of work > on the parms etc. "under the hood" you can't call the same subproc from > RPG. That means that for any subprocs used by both Java and RPG the Java > has to use a stub procedure to call the "real" thing. > > I have some materials in my V5 presentation that you are welcome to have a > PDF of if you e-mail me OFF-LIST. > > Jon Paris > Partner400 > > > _______________________________________________ > This is the Java Programming on and around the iSeries / AS400 (JAVA400-L) > mailing list To post a message email: JAVA400-L@midrange.com > To subscribe, unsubscribe, or change list options, > visit: http://lists.midrange.com/cgi-bin/listinfo/java400-l > or email: JAVA400-L-request@midrange.com > Before posting, please take a moment to review the archives > at http://archive.midrange.com/java400-l. -- mfG Dieter Bender DV-Beratung Dieter Bender Wetzlarerstr. 25 35435 Wettenberg Tel. +49 641 9805855 Fax +49 641 9805856 www.bender-dv.de
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.