Setting up a TCP/IP listener for J2EE called applications
If you want a calling program to use TCP/IP to start a called program in a J2EE application client module, you must set up a TCP/IP listener for the called program.
You must meet the following requirements:
- The called program must be generated to or copied to a J2EE application client module.
- The main class of the application client module is the EGL TCP/IP listener.
- A port is assigned to the listener.
Setting the main class of an application client
To set the main class of an application
client, follow these steps:
- Edit the project's Deployment Descriptor (
application-client.xml) or manifest file (MANIFEST.MF). - Under the heading Main Class, enter: com.ibm.javart.calls.listener.TcpipListenerJ2EE.
Assigning a port to the listener
To assign
the listener's port, follow these steps:
- Open the project's Deployment Descriptor (
application-client.xml). - Under the heading Environment Variables, click Add.
- In the name field, enter tcpiplistener.port.
- In the type field, enter java.lang.Integer.
- In the value field, type a port number. This should be the same value given in the serverID field of the calling program's linkage options part.
Running the application client
An application
client can be started in either of two ways; the options available
to you depend on which J2EE server you use:
- If you use the WebSphere® Application Server,
you can start the application client from the workbench by using the
launch configuration. Follow these steps:
- Locate the Run menu item in the workbench. Click .
- Click the type of launch configuration appropriate for your server. For example, for WebSphere® Application Server it is WebSphere® v6.1 Application Client.
- Select an existing configuration. Alternatively, you can click New to create a new configuration. You must enter the names of the application client and its enterprise application (EAR) in the appropriate fields.
- Start the application client from the command line. The command
will vary depending on your J2EE server, so consult your server's
documentation. For WebSphere® Application Server,
you can use
launchClient.bat, which is in the WebSphere® Application Server installation directory, in thebinsubdirectory. You can startlaunchClient.batby entering the following at the command prompt:launchClient myCode.ear -CCjar=myJar.jar- myCode
- The name of your enterprise archive (EAR).
- myJar
- The name of the application client JAR file.
launchClient.batin the documentation for WebSphere® Application Server.