The PL/I implementation of the native method looks much like any other PL/I subroutine.
The sample program contains a series of *PROCESS statements that define the important compiler options.
*Process Limits( Extname( 31 ) ) Margins( 1, 100 ) ; *Process Dllinit xinfo(def); *Process Default( IEEE );
Here is a brief description of them and why they are useful:
The PL/I procedure name must conform to the Java naming convention in order to be located by the Java Class Loader at execution time. The Java naming scheme consists of three parts. The first part identifies the routine to the Java environment, the second part is the name of the Java class that defines the native method, and the third part is the name of the native method itself.
Here is a breakdown of the external PL/I procedure name _Java_callingPLI_callToPLI in the sample program:
The complete procedure statement for the sample program looks like this:
Java_callingPLI_callToPLI:
Proc( JNIEnv , MyJObject )
External( "_Java_callingPLI_callToPLI" )
Options( NoDescriptor ByValue linkage(stdcall) );
The PL/I include file which contains the PL/I definition of the Java interfaces is contained in two include files, jni.cop which in turn includes jni_md.cop. These include files are included with this statement:
%include jni;
For a complete listing of the jni.cop file look in the \ibmpliw\include directory