Another way to call COBOL from Java is to use the application programming interface (API) contained in the Java archive, CVM.jar. This interface can be used by Java developers to call COBOL functionality (such as programs and entry points) from their Java class.
CVM.jar consists of two main classes:
Class | Description |
---|---|
CVM | CVM is a singleton class representing the ACUCOBOL-GT runtime. This class allows Java developers to programmatically manage the ACUCOBOL-GT runtime, giving them low-level control of COBOL objects from Java. |
CALL_OPTIONS | This options class is used for setting options for each called COBOL program. |
Note that you can call COBOL from Java locally or remotely. You can even have the runtime execute remotely without a COBOL object executing on the client. All you need on the client is a Java program and a runtime. For this to work, you set CODE_PREFIX in the configuration file that you provide with the runtime initialization to point to a remote server hosting your COBOL application. The remote server must also be running AcuConnect. AcuConnect is able to execute a COBOL object remotely and share data with the local runtime. For more information on executing remote COBOL programs with AcuConnect, see the AcuConnect User's Guide.