Introduction

This chapter introduces the JTmax server and describes the environment components and configuration.

1. JTmax Server Environment

JTmax server is used when a Tmax client or a Tmax server calls an application service that is written in Java and located outside the Tmax server. Tmax must use an Async Java gateway.

The following illustrates the JTmax server environment.

figure 1 1
JTmax Server Environment

The Java gateway attempts to connect to the JTmax server when Tmax starts. If the Java gateway fails to connect, the gateway attempts to connect to the JTmax server again when a service request must be called through the Java gateway.

JTmax can create an application object and manipulate it, if necessary, to manage the life cycle. JTmax can also control service requests by implementing a callback interface.

2. Environment Configuration

2.1. Tmax Configuration

In the Tmax configuration, set the Async Java gateway to connect to the JTmax server.

*SERVICE
JTMAXSERVICE       SVRNAME = javagw

*GATEWAY
javagw         GWTYPE = JEUS_ASYNC, PORTNO = 11100,
               RGWADDR = "192.168.11.20",
               RGWPORTNO = 9669,
               BACKUP_RGWADDR = "192.168.11.21",
               BACKUP_RGWPORTNO = 9669,
               CLOPT = "-r ",
               NODENAME = tmax,
               CPC = 1
  • SERVICE section

    • Set SVRNAME to the gateway name and define the service.

  • GATEWAY section

    • Create a gateway in the GATEWAY section.

    • GWTYPE must be set to JEUS_ASYNC. For INBOUND, PORTNO is the port number listened to. For OUTBOUND, RGWADDR is the IP and RGWPORTNO is the PORT to connect to. When trying to back up, connect to BACKUP_RGWADDR and BACKUP_RGWPORTNO.

    • As many as "maxclh*cpc count" connections are created in the JTmax server.

2.2. JTmaxServer Configuration

Although separate file configurations are unnecessary, to record logs or to handle FDL, additional configuration is required.

log.level=info
log.bufsize=1024
log.dir=/logs/jtmaxserver
log.file=jtmaxserver.log

fdl.file=/fdl/tmax.fdl
  • Set the file path to "-Dwebt.properties=absolute path" when executing an application.

  • log.level has three settings: none, info, and debug.

JTmaxServer Inbound Message Settings

Set the maximum message size using jeus.net.msg.max to handle inbound services.

jeus.net.msg.max=5000000(default)

The following shows how to use this setting.

  1. jvm command option

    -Djeus.net.msg.max=6000000
  2. Configure this on the webtasync server.

    System.setProperty("jeus.net.msg.max", "6000000");

3. API

3.1. JTmaxServer

The JTmaxServer class processes requests from the Async Java gateway of Tmax. A user implements JTmaxEventHandler to process requests.

The following shows how to use JTmaxServer.

JTmaxServer server = new JTmaxServer("jtmaxserver1", 6555, 10, new SampleHandler());
try {
        server.startServer();
}
catch (IOException e) {
        error process...
}

3.2. JTmaxResult

The JTmaxResult class stores the process results from JTmaxEventHandler. This class can contain information such as whether the service was successful, the error code, and data to be returned.

3.3. JTmaxEventHandler

The JTmaxEventHandler interface must be implemented by a user to process service requests. Methods for handling tpcall, tpacall, and transactions must be implemented.

For more information about basic data usage (WebtBuffer, WebtSetringBuffer, WebtCarrayBuffer, WebtFieldBuffer), refer to Tmax WebT User Guide.