Invoking MPE Programs via Java Telnet

The open source Java Telnet Applet inspired me to experiment with just another potential approach for integrating native HP 3000 programs with multi-platform client-server architectures as well as GUI or Web front-ends based on Java and/or Java Foundation Classes (also known as Swing).

The underlying idea is to have a Java program (or applet or servlet) telnet into an HP 3000 to launch a native MPE/iX program and control it "remotely" via its $STDIN and $STDLIST. While this might not be an ideal approach for the general case of GUI or Web evolution of existing (or new) applications, it does have a number of interesting features or properties...

The native MPE program runs in its regular session context, not inside a special listener/server job. This avoids contention issues with job/session related resources like FILE equations, JCW settings or CI variables, that can arise when multiple instances of the program are run on behalf of different users inside a single server job context. By talking to the MPE program via its $STDIN and $STDLIST, there is no need for explicit TCP/IP programming on the host side. This can simplify the work or even make changes to the native MPE program completely unneccessary. MPE programs using a VPLUS user interface might probably be handled by using a special NMXL to intercept the VPLUS transactions and redirect them to some kind of serial stream over $STDIN and $STDLIST (which could even work for programs mixing VPLUS and character mode I/O). By using the native MPE code, one can leverage strengths of the HP 3000 in the area of performance and resource efficiency as well as reduce the learning curve and work associated with a complete re-engineering of existing "legacy" application code. There is also no need for SQL or JDBC when access to TurboIMAGE data, KSAM or flat files is required.

The Java code can run as standalone client program, as applet or as servlet. When run as servlet on the HP 3000, the Java code can even use local MPE files to exchange data with the native program (and use $STDIN and $STDLIST just for parameter passing or signalling when database transactions have been completed). By using the telnet approach, a 3000 based servlet can avoid the issues with JNI and multi-threading that exist with the current green threads implementation of Java/iX.

Here are a few SIGJAVA-L postings with add'l food for thought...

An example prototype using QUERY

This example Java program uses Telnet to launch QUERY.PUB.SYS on the HP 3000 and provides a small GUI that implements database transactions via the QUERY FIND and REPORT commands. The QUERY example was chosen for a prototype because it shows access to the plain TurboIMAGE database "Music" without any need for JDBC or JNI programming. Furthermore it represents a native host program that cannot even be modified for the GUI or Web integration. Notice that the example is fairly "quick & dirty", but it should be sufficient to get an idea.

Here is the download location for the Java Telnet Applet...

And here are source code, javadoc output, as well as a screen shot for QueryClient as well as QueryApplet...

Another example, using a custom server program

Feedback and contributions as welcome, as usual. Especially if you'd like to donate an applet or servlet implementation of the above.
 
Lars Appel, December 1999