Chapter 4. IBM Toolbox for Java 253
An application that uses proxy
support performs more slowly than if
it uses standard IBM Toolbox for Java
classes due to the extra
communication needed to support
the smaller proxy classes.
Applications that make fewer method
calls have less performance
degradation.
Before proxy support, the classes
containing the public interface, all the
classes needed to process a request,
and the application itself ran on the
same JVM. When using proxy
support, the public interface must be part of the application, but classes for processing
requests can run on a different JVM. Proxy support does not change the public interface. The
same program can run with either the proxy version of the IBM Toolbox for Java or the
standard version.
4.8.1 Classes enabled to work with proxy server
Some IBM Toolbox for Java classes are enabled to work with the proxy server application.
These include:
򐂰 JDBC
򐂰 Record-level access
򐂰 Integrated file system
򐂰 Print
򐂰 Data queues
򐂰 Command call
򐂰 Program call
򐂰 Service program call
򐂰 User space
򐂰 Data area
򐂰 AS400 class
򐂰 SecureAS400 class
Other classes are not supported at this time by proxy support. Also, integrated file system
permissions are not functional using only the proxy JAR file. However, you can use the
JarMaker class to include these classes from the jt400.jar file.
4.8.2 Proxy support example
In this section, we modify the JDBCExample example in 4.6.2, JDBC application example
on page 153, to use proxy support. There are three machines in this example: client, proxy
server, and database server. The following steps show how to set up proxy support:
1. Choose a machine to act as the proxy server. The Java environment and CLASSPATH on
the proxy server machine should include the jt400.jar file. This machine must be able to
connect to the iSeries server.
2. Open a Qshell session and start the proxy server on this machine by typing:
java com.ibm.as400.access.ProxyServer -verbose
Specifying verbose will allow you to monitor when the client connects and disconnects.
See Figure 4-75 on page 254.
Figure 4-74 iSeries proxy support
254 Building Java Applications for the iSeries Server with VisualAge for Java 3.5
Figure 4-75 Starting the proxy server
3. On the client machine, the Java environment and CLASSPATH should include the
jt400Proxy.jar file and your application classes. In the VisualAge for Java 3.5 IDE, you can
specify the IBM Enterprise Toolkit for AS400 package in your Class Path. See Figure 4-76.
This machine must be able to connect to the proxy server but does not need a connection
to the iSeries server.
Figure 4-76 Setting the classpath for proxy support
4. Set the value of the com.ibm.as400.access.AS400.proxyServer system property to be the
name of your proxy server (refer to Figure 4-77), and run the application.
QSH Command Entry
$
> export -s CLASSPATH=/qibm/ProdData/Http/Public/jt400/lib/jt400.jar:$CLASSPATH
$
> java com.ibm.as400.access.ProxyServer -verbose
Proxy server started.
Proxy server listening to port 3470.
===>
F3=Exit F6=Print F9=Retrieve F12=Disconnect
F13=Clear F17=Top F18=Bottom F21=CL command entry
Chapter 4. IBM Toolbox for Java 255
Figure 4-77 Setting the properties for proxy support
5. When you click the Connect button, you should see (if you specified verbose mode in step
2) the application make at least one connection to the proxy server. See Figure 4-78.
Figure 4-78 Connecting to the proxy server
6. After the connection is established successfully, you can run your applications functions,
such as Get Part. See Figure 4-79 on page 256.
QSH Command Entry
$
> export -s CLASSPATH=/qibm/ProdData/Http/Public/jt400/lib/jt400.jar:$CLASSPATH
$
> java com.ibm.as400.access.ProxyServer -verbose
Proxy server started.
Proxy server listening to port 3470.
Proxy server accepted connection requested by p23m2548.rchland.ibm.com/9.5.62
.33 as connection 1001.
===>
F3=Exit F6=Print F9=Retrieve F12=Disconnect
F13=Clear F17=Top F18=Bottom F21=CL command entry

Get Building Java Applications for the iSeries Server with VisualAge for Java 3.5 now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.