Generic Java Driver V2
The initial version of the Generic Java Driver (GJD) is limited in that only one GJD can exist in a process. You cannot use a Java UPoC in the process as the UPoC. Driver setup fails when it tries to start a JVM.
The Generic Java Driver provides a framework for Java code that can be used to implement the functionality of a system driver.
Features of the Generic Java Driver include:
- The GJD can permit more than one GJD protocol thread in one process.
- The use of Java UPoCs in the process is supported.
- There is no restriction on the GJD and Java UPoC start order.
- GJD protocol threads permit shutdown and restart when possible.
The changes that are made in V2 are backwards compatible with the prior version of the GJD.
Environment variable "CLASSPATH"
Any existing class path specified in the environment variable CLASSPATH is added to the end of the user-specified entries by the ini files. This conforms with prior use of the variable by the Java UPoC code.
Non-engine Java UPoC
When an idle Java UPoC is called, in hcitcl the JVM that loads is the one that is not modified by the changes contained in GJD V2.
Using multiple javadriver threads in one process
In earlier versions, restarting a java thread would fail to load lib files, causing a resource recycling issue.
You can use multiple Java driver threads in one process by setting a
USE_LOADER=true
directive in the pni file.
This cannot be used on the GUI side.
When the GUI saves NetConfig:
- If one Java driver is found in one process, then the
use_loader
key is removed. - If multiple Java drivers are found in one process, then the original
value of
use_loader
is retained, if there is any. Otherwise,use_loader=true
is updated in the pni file.
A warning message then opens, stating that multiple javadriver threads are detected in one process.
The engine with the directive can have each thread load a class in its
own thread local urlclassloader
without interfering
with each other on the process level. However, you can create in your own code a classloader
that can be shared among threads. This results
in classes that will not be recycled after the CIS engine thread is down. In this case,
you must carefully manage the classloader
. In a similar
manner, this can also happen in the Spring context. This opens an additional warning
message.