Calls to the driver

When Java code invokes into the Java Driver, it specifies a LINKCLASS in the .ini file. The ToCloverleafLink class in the provided JavaDriver.jar is such a class. This type of class can send messages into the Java Driver and from the system engine. It can also query the named queues for messages that are stored in the recovery database. After this, it sets the driver status, and ivokes a password function implemented in C code.

The minimum a class must do for these things are these lines, found in the ToCloverleafLink.java file:

private static int linkPtrI = 0;
private static native ArrayList<String[]> driverRequest(int pointer, String[] rqData);
private static native String driverMsgsIn(int pointer, ArrayList<String[]> ibData, int dbWaitI);
private static native void driverSetStatus(int pointer, int state, String errStr);
private static native String driverPwdEncode(int doEncode, String pwd);
  • The linkPtrI is a pointer that the JNI code initializes to permit the Java code to invoke it. It must be present in your class with this name and type. It also must be passed as the first parameter to all the subsequent methods except driverPwdEncode. This does not have any thread context so does not require the pointer.
  • Use the driverRequest method to run queries against the named queues. See the public executeQueueQuery method for how to invoke this method.
  • Use the driverMsgsIn method to send messages into the driver. See the public sendMessagesToCloverleaf method for how to invoke this method.
  • Use the driverSetStatus method to set the status of the system thread, as it shows in NetMonitor. See the public setDriverStatus method for how to invoke this method.
  • Use the driverPwdEncode method to invoke a C algorithm to encode a password and decode it. See the public doPassword method for how to invoke this method.

Some of these methods rely on constants declared nearby to make the array interactions simpler. You can copy these constants as well if they are suitable.