Linkage options part
A linkage options part specifies details on the following issues:
- How a generated program or wrapper calls other generated code
- How a generated program transfers asynchronously to another generated program
Specifying when linkage options are final
You can choose between two alternatives:
- The linkage options specified at generation time are in effect at run time; or
- The linkage options specified in a linkage properties file at deployment time are in effect at run time. Although you can write that file by hand, EGL generates it in this situation:
- You set the linkage options property remoteBind to RUNTIME; and
- You generate a Java program or wrapper with the build descriptor option genProperties set to GLOBAL or PROGRAM.
For details on using the file, see Deploying a linkage properties file. For details on customizing the file, see Linkage properties file (reference).
Elements of a linkage options part
The linkage options part is composed of a set of elements, each of which has a set of properties and values. The following types of elements are available:
- A callLink element specifies the linkage conventions that EGL uses for a given call.
The callLink element always applies to a called program. The following relationships are in effect:
- If the callLink element refers to the program that you are generating, that element helps determine whether to generate a Java wrapper that allows access to the program from native Java code; for an overview, see Java wrapper. If you indicate that the Java wrapper accesses the program by way of an EJB session bean, the callLink element also causes generation of an EJB session bean.
- If you are generating a Java program and if the callLink element refers to a program that is called by that program, the callLink element specifies how the call is implemented; for example, whether the call is local or remote. If you indicate that the calling Java program makes the call through an EJB session bean, the callLink element causes generation of an EJB session bean.
- An asynchLink element specifies how a generated program transfers asynchronously to another program, as occurs when the transferring program invokes the system function sysLib.startTransaction.
- A transferToProgram element specifies how a generated COBOL program transfers control to a program and ends processing. This element is not used for Java output and is meaningful only for a main program that issues a transfer statement of the type transfer to program.
- A transferToTransaction element specifies how a generated program transfers control to a transaction and ends processing. This element is meaningful only for a main program that issues a transfer statement of the type transfer to transaction. The element is unnecessary, however, when the target program is generated with VisualAge Generator or (in the absence of an alias) with EGL.
Identifying the programs or records to which an element refers
In each element, a property (for example, pgmName) identifies the programs or records to which the element refers; and unless otherwise stated, the value of that property can be a valid name, an asterisk, or the beginning of a valid name followed by an asterisk. The asterisk is the wild-card equivalent of one or more characters and provides a way to identify a set of names.
Consider a callLink element that includes the following value for the pgmName property:
myProg*That element pertains to any EGL program part that begins with the letters myProg.
If multiple elements are valid, EGL uses the first element that applies. A series of callLink elements, for example, might be characterized by these pgmName values, in order:
YourProgram YourProg* *Consider the element associated with the last value, where the value of pgmName is only an asterisk. Such an element could apply to any program; but in relation to a particular program, the last element applies only if the previous elements do not. If your program calls YourProgram01, for instance, the linkage specified in the second element (YourProg*) supersedes the third element (*) to define how EGL handles the call.
In most cases, elements with more specific names should precede those with more general names. In the previous example, the element with the asterisk is appropriately positioned to provide the default linkage specifications.
Related concepts
Java wrapper
Parts
Related tasks
Adding a linkage options part to an EGL build file
Deploying a linkage properties file
Editing the asynchLink element of a linkage options part
Editing the callLink element of a linkage options part
Editing the transfer-related elements of a linkage options part
Setting up the J2EE run-time environment for EGL-generated code
Related reference
asynchLink element
call
callLink element
linkage
Linkage properties file (details)
sysLib.startTransaction
transfer
transferToTransaction element