NonStop Server for Java 7.0 Programmer's Reference

For invocation API users, build your own executable and link that executable against the JVM DLL.
For migration considerations information, see “Calling Java methods from C or C++” (page 37).
For a demo, see invocation API demo provided by NSJ7 in
install_dir/demo/invocation_api.
For more information, see “Linker and compiler options” (page 38).
Floating-point support
By default, NSJ 3.1.x and earlier versions converted any floating-point value that crossed the JNI
boundary to a TNS float. This default can be overridden by supplying a line in the file
TandemVMClassFP.properties. If a particular class required IEEE floating-point values passed
to its JNI code instead of TNS float values; a property was added to the file (with the name of the
class being the name of the property) to this file. Users also set the value of the property to IEEE_FP,
indicating that they wanted IEEE floating-point values passed to their JNI code or TANDEM_FP,
indicating that they wanted TNS floating-point values passed to their JNI code.
A user program cannot specify the floating-point type by using the
TandemVMClassFP.properties file. Thus, any user-program or Java based product with JNI
code that obtains floating-point values from Java must call the NSK_FLOAT_* Guardian routines
to convert these values to TNS floats. Similarly, any float value passed to Java must be an IEEE
float value. Table 15 (page 94) illustrates the NSJ7 application’s floating-point usage compared
to earlier versions.
Table 15 Summary of floating-point support
NSJ 7.0NSJ 6.0NSJ 5.xNSJ 4.xNSJ 3.xNSJ 2.x
IEEE floatIEEE floatIEEE floatIEEE floatIEEE floatIEEE floatJava
floating-point
usage
IEEE floatIEEE floatIEEE floatIEEE floatEither IEEE or
Tandem float
Either IEEE or
Tandem float
JNI code
floating-point
IEEE floatIEEE floatIEEE floatIEEE floatEither IEEE or
Tandem float
Tandem floatJNI calling
convention
IEEE floatIEEE floatIEEE floatIEEE floatIEEE floatTandem floatJava compiler
flag
IEEE floatIEEE floatIEEE floatIEEE floatTandem floatTandem floatJava linker flag
Since NSJ 3.1.x and earlier versions set the linker flag for the process to TNS float, any use of the
C runtime library used routines that handled TNS floats. For NSJ versions 4, 5, 5.1, 6.0, and 7.0
versions, the linker flags described in “Linker and compiler options” (page 38) are used to specify
IEEE floating-point. Accordingly, the C runtime library uses routines that handle IEEE floating-point.
For NSJ versions 4, 5, 5.1, 6.0, and 7.0 versions, any C runtime library calls such as sprintf
or sscanf, made from JNI code, assumes IEEE float values and calling conventions.
For example, assume that JNI code, written for a previous version of Java, converts a TNS
floating-point value to a string, which is then passed to Java.
To migrate the program, you must change the JNI code to convert the TNS floating-point value to
an IEEE floating-point value and then call sprintf to convert the floating-point value to a string.
For more information, see “Floating-point implementation” (page 39).
Using AWT classes
If your Java programs use AWT classes with NonStop Server for Java 3.1.x or earlier versions,
change your program code to catch a HeadlessException rather than an
UnsupportedClassException.
94 Migrating applications