HP-UX SNAplus2 CPI-C Programmer's Guide (June 2003)
Writing CPI-C Applications
Java CPI-C Considerations
Chapter 2104
CPICReturnCode cpicReturn = new CPICReturnCode();
cpicReturn.intValue(0);
Step 2. Issue the function call:
cpicObject.cminit(bConversationId,
sSymbolicDestination,
cpicReturn);
Step 3. Test the return code against a specific value:
if (cpicReturn.intValue() !=
CPICReturnCode.CM_PARAMETER_ERROR)
. . .
Alternatively, check whether the return code is CM_OK:
try
{
cpicReturn.isOK();
}
catch(CPICReturncode c)
{
. . . // cpicReturn is not set to CM_OK
}
Compiling and Linking the Java CPI-C Application
Before compiling and linking a Java CPI-C application, specify the
directory where Java classes are stored. To do this, set and export the
environment variable CLASSPATH to /opt/sna/java/cpic.jar.
Compile and link the application using the Java compiler javac in the
normal way.
Running the Java CPI-C Application
Before running a Java CPI-C application, specify the directory where
libraries are stored, so that the application can find them at run time. To
do this, set and export the environment variable SHLIB_PATH to
/opt/sna/lib.
You may also need to set and export the APPCTPN to specify the local TP
name for the application, as described in “Specifying the Local TP
Name”.