I had the displeasure of working with AS/400 Java on OS/400 V3R7. Back then, I was using the Hursley port of Java. Hursley is the IBM lab in England that originally ported Suns Java Virtual Machine (JVM) C code to the AS/400. The Hursley port worked, but it ran like a dog. IBM rewrote the JVM for V4R1 to take advantage of the internals of OS/400. Still, I wasnt doing any AS/400 Java demosthe JVM was still slow. With V4R2, the JVM started to run a little faster, and, by V4R3, OS/400s JVM was able to support real-world Java applications. V4R4 removed many of any remaining performance issues, but, with V4R5, IBM has, once again, improved the JVM speedthis time by up to a whopping 65 percent. And that 65 percent improvement is on Java apps that are running on V4R5 on a stock V4R4 machinenot one of the new boxes that sport a 100 percent increase in MHz speed.
Java Toolbox for the AS/400
The Java Toolbox for the AS/400 (JT400) has also been enhanced with V4R5. JT400 has added a number of Java classes and packages that augment the development of Web applications and integration with legacy databases and programs. Classes of note are the ServiceProgramCall and FTP. Java packages of note are com.ibm.as400.util.html, com.ibm.as400.util.servlet, and com.ibm.as400.security. Also new with JT400 is a set of proxy classes that are used to reduce download time for Java applets.
JT400s ServiceProgramCall class allows you to call an AS/400 service program from Java. ServiceProgramCalls interface is much like its ProgramCall parent class except that you qualify the name of the module that you wish to invoke from a particular service program. JT400s Program Call Markup Language (PCML) now also supports service programs.
The FTP class makes it ridiculously easy to use the Internets File Transfer Facility. The FTP class has methods (with names like connect, send, list, get, and put) that are extremely simplistic to use, so youll be able to automate the transfer of objects between TCP/IP computers within your Java programs.
Server-side Java is where its at with business applications nowadays, but sometimes the pseudo-GUI of HTML just isnt good enough and a Java applet is required. The problem with Java applets is the time it takes to download the applet and its required jar files to the browser. The new jt400Proxy.jar file provides proxy classes that communicate with an AS/400-based proxy server.
New Java Packages
V4R5s JT400 package of HTML classes, com.ibm.as400.util.html, provides Java classes that encapsulate the use of HTML. That way your Java code doesnt have all that ugly embedded HTML code. The com.ibm.as400.util.servlet package has a set of classes that map SQL result sets automatically to HTML tables. My article, Free and Easy with WebSQL, published in the February 2000 issue of MC, provided a sample Java servlet application called WebSQL that used the com.ibm.as400.util.servlet package.
The com.ibm.as400.security package contains classes to make secured connections with the AS/400, authenticate any users identity on the AS/400, and associate the user with the underlying OS/400 thread.
The last JT400 enhancement that I want to mention is that somehow, someway, Rochester was able to reduce the jt400.jar file from 2.5 MB to 550 KB.
Just-In-Time
Sun, IBM, and others have been working hard to improve the execution speed of Java. One of the technologies that have been created to improve Java execution speeds is Just-In- Time (JIT) compilation. The JIT engine compiles heavily used sections of Java code in real time as the JVM is executing the interpreted Java byte code. The compiled section of code is gone after the Java class is removed from the JVM, and the JIT compilation repeats when the class is again instanced into the JVM.
But the AS/400 statically compiles Java classes into hidden service programs. And that static compilation is done automatically. So why is JIT important if AS/400 Java is fully compiled? The short answer is JavaServer Pages (JSPs). JSPs are essentially HTML with embedded Java code. In the JSP development environment, the JSP files are frequently modified, which, until V4R5, caused a static compilation. In this dynamic JSP development environment, the use of JIT compilation actually improves performance over statically compiled JSPs. The AS/400s JIT compiler is almost as fast as the top optimization level (40) of the Create Java Program (CRTJVAPGM) command.
Side Order
I want to mention two other items about V4R5 Java: One, IBM will provide V4R5 support for Java 1.3 by the end of July (it intends to have Java 1.3 available via PTF for V4R4 by the second half of this year), and, two, with V4R5 you will be able to code stored procedures with Java.
Java keeps getting faster. Not only do you have the 65 percent performance boost, but with a hardware upgrade you can also factor in the 100 percent increase in MHz speed. Stack on top of the performance improvements the increased knowledge and available literature on coding Java applications for performance such as Alex Garrisons A Programmers Notebook: Making Servlets Run Faster and Paul Remtemas Java Performance Tips in the April and May 2000 issues of MC, respectively, and your Java apps begin to approach the speed of todays RPG and COBOL applications.
LATEST COMMENTS
MC Press Online