beautypg.com

Terminating the java vm, Developing a multithread application, Generating an object – FUJITSU J Adapter Class Generator User Manual

Page 23

background image

Chapter 3. Developing Programs 23

Terminating the Java VM

When an adapter class is no longer used, the Java VM must be terminated. Use the

JVM-TERMINATE method of the FJ-JAVA-CONTROL class to terminate the Java VM.
A coding sample is shown below:

...
REPOSITORY.
CLASS FJ-JAVA-CONTROL
...
PROCEDURE DIVISION.
...
INVOKE FJ-JAVA-CONTROL "JVM-TERMINATE".
...

Developing a Multithread Application

A multithread application using an adapter class must connect the current thread to

the Java virtual machine (VM). When the multithread application is terminated, the

current thread must first be disconnected from the Java VM.
Use the JVM-INIT method or the JVM-ATTACH method of the FJ-JAVA-CONTROL

class to connect the current thread to the Java VM.
To disconnect the current thread from the Java VM, use the JVM-TERMINATE

method or the JVM-DETACH method of the FJ-JAVA-CONTROL class.
A multithread application sample is shown below:

Figure 3.2

Generating an Object

Generate an object by invoking the adapter class factory method corresponding to

the constructor. Generate the factory method with the following name (see

"

Constructor

").

Create-JavaClassName-nn (nn is 01 to 99)