Calling to and from Java™ programs
- EGL-generated Java™ program to EGL-generated Java™ program
- Non-EGL Java™ program to EGL program
- EGL-generated Java™ program to non-EGL Java™ program
- EGL-generated Java™ program to DLL
- EGL-generated Java™ program to .EXE or .BAT file
- EGL-generated Java™ program
to remote mainframe code, as described in the following topics:
- Calling a remote CICS® program from EGL-generated Java™ code or the debugger
- Calling a remote IMS™ program from EGL-generated Java™ code or the debugger
- Calling a remote IMS™ transaction from EGL-generated Java™ code or the debugger
EGL-generated Java™ program to EGL-generated Java™ program
- Within the same package as the calling program.
- Qualified with a package name using dot syntax.
- Identified with a linkage option part. For more information, see Overview of linkage options part.
Non-EGL Java™ program to EGL program
- Move the logic from the EGL program part to an EGL service part, deploy the logic as a SOAP service, and access the service from the non-EGL generated program. For more information, see the following topics:
- Create Java™ wrapper classes for the EGL program. For more information, see Generating Java wrappers.
EGL-generated Java™ program to non-EGL Java™ program
To invoke non-EGL Java™ code from Java™ code generated by EGL, you must create an Interface part of type JavaObject. The Interface part contains function descriptions for the Java™ methods you wish to call.
- If the function is marked static, invoke it using the name of the Interface part and dot syntax (interfacePart.method()).
- Otherwise, create a variable based on that Interface part and use it in much the same way you would a library, appending the interface variable name to the name of the method using dot syntax (interface.method()).
EGL-generated Java™ program to DLL
You can call functions in a single, non-EGL dynamic link library (DLL) (written in, for example, C or COBOL) from an EGL Java™ program. The file extension for the DLL depends on your environment (examples include .dll, .so, and .sl).
You create a Library part of type nativeLibrary to act as an interface between your EGL program and the DLL. The Library part lists function names and parameters, and can use the alias property of the functions where function names do not match EGL conventions.
Access the functions by using dot syntax (library.function()) or by creating a use declaration for the library to make its functions global to your program.
EGL-generated Java™ program to .EXE or .BAT file
- sysLib.callCmd()
- This function transfers control to a specified executable; when the executable terminates, control returns to the calling EGL program.
- sysLib.startCmd()
- This function transfers control to a specified executable, then keeps running; both the EGL program and the executable run at the same time.