COBOL RunUnit
created: 18 January 2021
revision: 1
Multiple RunUnits in Java
- Compile the COBOL that you want to call. For procedural COBOL programs use the NOILSTATIC directive, which is the default. This enables any COBOL classes created to be included in a run unit.
- Any COBOL program or CLASS with instance data/methods can be used with multiple run units providing you do not compile with the REENTRANT or ILSTATIC directives.
Use RunUnit
- Either use the
RunUnit.Call()
method to call the COBOL class, or:- Make sure that any parameters are Java primitive data types.
- Create an instance of the procedural COBOL program to be called.
- Add the program instance to the new run unit, using the
RunUnit.Add()
method. - Invoke the program instance within the new run unit.
- Use the
StopRun()
method to destroy the run unit when you have finished with it. - NOTE In OO COBOL programs in a mixed language environment, do not use static methods and data as they cause run-time errors.
- NOTE Ensure that data access is synchronized, as the run units will be executing in different threads.
- JavaEE Session Management
Monitor RunUnit with Mission Control and CTF
RunUnit myRUBean = new RunUnit("MyApplication", RunUnitStartupOptions.UseManagementBean);
mbeans=true
in cobconfig.properties. in the jar file, or in the class folder- -Dcom.sun.management.jmxremote
- JMX to Docker and AWS
- AWS monitor in seconds
- CTF Emmiter