NonStop Server for Java Programmer's Reference (NSJ 4.0+)

Maximum Concurrent Transactions.
When calling a C or C++ routine, where the function passes or returns and parameters of type float
or double, NonStop Server for Java 4 performs no conversion. All float and double values remain in
IEEE floating-point format when crossing the JNI boundary. For more information, see IEEE
Floating-Point Implementation.
When using the JNI_OnLoad function you must use the following name:
JNI_OnLoad_libname
where libname is the name of the library that your program passed to the
System.loadLibrary function.
The JNI_OnUnload function is not supported by NonStop Server for Java 4.
When naming library files, observe the following rules:
Do not use names that begin with Tandem, tandem, or tdm.
You can create libraries as an archive file whose name ends in .a or a relinkable library file whose
name ends in .lib.
Do not use the same file name for more than one archive file, even if the two archive files are in
different directories.
The remainder of this subsection explains:
Calling C or C++ Methods From Java
Calling Java Methods From C or C++
Using the compaq.liblist System Property
Linker and Compiler Options
For more information about JNI, see the Sun Microsystems JNI document
(http://java.sun.com/j2se/1.4.1/docs/guide/jni/index.html).
Calling C or C++ Methods From Java
To call C or C++ methods from Java, follow these steps:
Compile the Java code.1.
Use javah to generate header files.2.
Compile the C or C++ code. C++ code must be compiled using the following compiler command-line
options: -Wversion2 and -WIEEE_float.
If the native code has large variables on the stack, calling this native code might exceed the default
stack space provided for each thread. If the native code exceeds the amount of stack space allocated
for it, unpredictable results can occur. To prevent overflowing the available stack space, consider
allocating large variables on the heap rather than using the stack. Otherwise, you can increase the
default stack size for each thread by specifying the -Xss option when starting java. This option
increases the stack size for every thread. For more information about the -Xss option, see java in
the NonStop Server for Java Tools Reference Pages.
3.
Create either a relinkable library (.lib) file or an archive library (.a) file and specify the linker
option set floattype IEEE_float.
4.
Place the newly created library (.a or .lib) file in /usr/tandem/java_public_lib.5.