Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
MCCDEV> javah -o dpslcbpm_jni.h -classpath [------] "edu.stanford.slac.aida.dp.d
pSlcBpm.DpSlcBpmI_impl"

 

 

Create your JNI interface module (the C code that the java calls). By convention we call this module dp<servername>_jni.c. It must have the *ATTRIBUTES*=JNI at the top so cmp knows how to compile it, and it should include the output file from the step above. Eg:

Code Block
/*
      **MEMBER**=SLCLIBS:AIDASHRLIB
      **ATTRIBUTES**=JNI
*/
#include "dpslcbpm_jni.h"

 

 

Create the dp<servername>_jni_helper.c file. This is the module that defines the functions that access the control system. The names of the functions it *defines* must all be in upper-case (due to the compiling and linking configurations specified in slccom:compile.com and the build com files). But the functions that those function call (in the control system shareables), need not be in upper-case.

...

Code Block
MCCDEV> lib/create aidashr_devlib.olbolbMCCDEV> define slctxt [], slc_txt
MCCDEV> cinc *.c

 

 
Create an aidashr_xfr_alpha.opt. Due to namemanging of JNI and VMS linking
namespace restrictions, it's important to do this with java$jni_example:scan_globals_for_option.com.

Code Block
MCCDEV> libr/extract=dpslcbpm_jni/output=dpslcbpm_jni aidashr_devlib
MCCDEV>  @java$jni_example:scan_globals_for_option *.obj aidashr_xfr_alpha.opt

 

Link your aidashr, using the opt file created above:

Code Block
MCCDEV> buildtest aidashr /default default

 

Run the server. The java command to run an AIDA server takes several arguments, to pass the values of
environment variables to the server at startup, so we have little .com files for each server. To override the default classpath (JAVA$CLASSPATH) which points to the aida.jar in slcimage, and the default AIDASHR (in SLCSHR), redefine the logicals before running the START<server>.COM file:

Code Block
MCCDEV> define myjava$classpath [------]
MCCDEV> testshrx/define/default aidashr
MCCDEV> @startdpslcbpm