Sample Applications and Starter Kits for Java are now available!
JimJohnston 2700036SPS Visits (7553)
With the availability of z/TPF support for Java™, you can now run Java applications on your z/TPF system. These applications can be structured as stand-alone applications or as service applications in Java.
On the z/TPF system, stand-alone Java applications can represent drivers, utilities, server daemons or other processes and are started using the ZFILE java command. The ZFILE java command is the standard java command that is supported by the IBM runtime environment on other platforms and accepts the same set of command-line options. Java sample applications are available for download and demonstrate how to build stand-alone Java applications, load the Java Archive (JAR) files to your z/TPF system, and run the applications. For more information, please see the readme file that is provided with the download.
With service applications in Java, you can extend existing z/TPF applications by having them call services that are implemented in Java. The services in Java are implemented by using Java API for RESTful Web Services (JAX-RS) and are packaged as service applications. The service applications are deployed to z/TPF Application Manager for Java (JAM) support and run as long-running Java processes.
Existing z/TPF applications use the tpf_srvcInvoke() function to call a service by the service name. Under the covers, the native request structure is converted to Java objects and passed to an available Java application thread in one of the long-running Java processes. The Java application thread processes the request and returns the response, which is converted from Java objects back to a native structure.
Because service applications in Java rely on the JAX-RS programming model, the same service that is available to existing z/TPF applications through the tpf_srvcInvoke() function can also be called by remote systems using REST over HTTP.
The Service applications in Java starter kit is available for downloading and demonstrates how to create Service applications in Java with two samples. The first sample shows how remote systems use REST over HTTP to call an example flight reservation service in Java on z/TPF. The second sample shows how to extend an existing z/TPF Application with a sample ‘priceLookup’ service written in Java. Both examples are ready to run and also include instructions for how to use TPF Toolkit and Maven™ Projects to build the examples yourself.
In addition, YouTube Videos are available that demonstrate using TPF Toolkit and other tools to create service applications in Java. For more information, please see the readme file that is provided with the download.