AS/400 Toolbox for Java \ Proxies

Proxy Support

Start changeAS/400 Toolbox for Java now has added proxy support for some of the classes. Proxy support is the processing that AS/400 Toolbox for Java needs to carry out a task on a Java virtual machine other than the Java virtual machine where the application actually is. Before proxy support, the classes containing the public interface and all classes to process a request were run in the same Java virtual machine as the application. With proxy support, only the public interface needs to be with the application. The classes necessary to process a request are running on another machine. Proxy support does not change the public interface. The same program can run with either the proxy version of AS/400 Toolbox for Java or the traditional version.

The goal of the multiple-tier, proxy scenario is to make the downloaded jar file as small as possible so that downloading this file from an applet takes less time. When you use the proxy classes, the entire AS/400 Toolbox for Java does not need to be installed on the client. To make the smallest jar file possible, use AS400JarMaker on the proxy jar file to choose only those components you need to make the jt400Proxy.jar file as small as possible. The chart below compares the size of the proxy jar files with the traditional jar files:

Size of files

An additional benefit is that fewer ports have to be open through a firewall to do proxy support. With traditional AS/400 Toolbox for Java, multiple ports must be open. This is because command call uses a different port than JDBC, which uses a different port than print, and so on. Each of these ports must be allowed through the firewall. With proxy support, all the data flows through the same port. The default port is 3470. You can choose to call the setPort() method to change the port setting or use the -port option when starting the proxy server:

java com.ibm.as400.access.ProxyServer -port 1234

The jt400Proxy.jar ships with the rest of the traditional AS/400 Toolbox for Java and, like the rest of the AS/400 Toolbox for Java, the proxy classes are pure Java so they can run on any machine with a Java virtual machine. The proxy classes dispatch all method calls to a server application, or proxy server. The full AS/400 Toolbox for Java classes are on the proxy server. When a client uses a proxy class, the request is transferred to the proxy server which creates and administers the real AS/400 Toolbox for Java objects.

The following picture shows how the traditional and proxy client connect to the AS/400. The proxy server can be the AS/400 that the data resides on.

Traditional and proxy connections

An application using proxy support will perform slower that the same application using traditional AS/400 Toolbox for Java classes. This is due to the extra communication needed to support the smaller proxy classes. Applications that make fewer method calls will see the least performance degradation."

How it works

In order to use the proxy server implementation of the AS/400 Toolbox for Java classes, you need to complete these steps:
  1. (Optional) Run AS400ToolboxJarMaker on jt400Proxy.jar to discard classes that you do not need.
  2. Determine how to get jt400Proxy.jar to the client. If you are using a Java program, use the AS400ToolboxInstaller class or another method to get it to the client. If you are using a Java applet, you may be able to download the jar file from the HTML server.
  3. Determine what server you will use for the proxy server. For Java applications, the proxy server can be any computer. For Java applets, the proxy server must be running on the same computer as the HTTP server.
  4. Start the proxy server, using the command "java com.ibm.as400.access.ProxyServer"
  5. On the client, you need to set system properties.
  6. You can now run the client program.

If you want to work with both the proxy classes and classes not in jt400Proxy.jar, you can refer to jt400.jar instead of jt400Proxy.jar. jt400Proxy.jar is a subset of the jt400.jar and, therefore, all of the Proxy classes are contained in the jt400.jar file.

We have provided two specific examples for using a proxy server with the steps listed above. The first shows how to run a Java application using proxy support and the second shows how to run an applet using proxy support:

Classes available

Some AS/400 Toolbox for Java classes are enabled to work with the proxy server application. These include the following:

Other classes are not supported at this time by jt400Proxy. Also, integrated file system permissions are not functional under the proxy jar file. However, you can use the JarMaker class to include these classes from the jt400.jar file.End change


[ Information Center Home Page | Feedback ] [ Legal | AS/400 Glossary ]