C H A P T E R  5

Sun 3270 Pathway Sample Programs

The sample programs included with Sun 3270 Pathway illustrate how to use it. This chapter provides a brief description of these programs.

The Sun 3270 Pathway Bean samples described in Sun 3270 Pathway Bean Samples are located in the directory:

INSTROOT/samples/bean

The Pathway Recorder sample described in Pathway Recorder Sample is located in the directory:

INSTROOT/samples/recorder

For more information about how to invoke these samples, refer to the comments included in the source files. For information about the ACCT transaction, refer to the Sun Mainframe Transaction Processing Software Installation Guide.


Sun 3270 Pathway Bean Samples

Sample1.java

Sample1.java shows how to:

After it is visible and connected to the end-system, the user can interact with Sun 3270 Pathway.

Sample1Applet.java

Sample1Applet.java is a version of Sample1.java that runs as a Java applet. A Java security restriction prevents a Java applet from connecting to any host other than the one from which it is served. For information about how to work around this problem, see Chapter 10.

Sample2.java

The Sample2.java program is the same as Sample1.java, but also listens for and prints the events raised by the Terminal object. The event listening is done in the Sample2EventListener.java class.

Sample3.java

Sample3.java is a more sophisticated example in which a nonvisible Terminal is used to extract information from a 3270 application running in a Sun Mainframe Transaction Processing (Sun MTP) region.

To run this sample requires a running region with the ACCT transaction available.

This sample takes a host, port, and surname as parameters and returns the numbers of all the accounts available to the ACCT transaction that have that surname.


Pathway Recorder Sample

ACCTSample.java

ACCTSample.java is an example demonstrating how to invoke a Pathway Recorder-generated class ACCTBean.java.

To run this sample requires a running region with the ACCT transaction available.

It performs a similar task to Sample3.java, but is using a generated bean to perform the navigation on the Terminal. This sample takes host, port, and surname parameters and returns the first account available to the ACCT transaction that has that surname.