You can write classes in OO COBOL which can be called from Java programs as though they were Java classes. You do this by providing a Java wrapper class, which provides a function for each method in the OO COBOL class. If you have Net Express, the Class and Method Wizards make this easy for you, by generating the Java code at the same time as the COBOL code. You can then publish the resulting Java classes to your UNIX system.
The functions in the Java wrapper class put all the parameters for the method into a Java array, and then call one of the member functions of Java class com.microfocus.cobol.RuntimeSystem to invoke the method in the OO COBOL class and return the result. This is shown in the figure below:
The rest of this chapter explains how you write the OO COBOL class and its Java wrapper.