class %ZHSLIB.PackageManager.Developer.JavaUtility class for installing a Java library and helper methods for using it at runtime.
Method Inventory (Including Private)
parameter SERVER = 127.0.0.1;
Java Runtime is expected to be hosted locally.
Methods (Including Private)
classmethod EnableJVMConnection(pResourceName As %String, jarPath As %String = "", pVerbose As %Boolean = 0) [ Language = objectscript ]
Creates an object gateway definition for a module which uses the JavaLibrary processor class. Must be run from the library namespace, since that contains the processor with the library information
private classmethod EnsureActive(objectGateway As %Net.Remote.ObjectGateway) [ Language = objectscript ]
Object Gateway is closed on system or instance shutdown. This method can be used to ensure that the gateway is open before trying to make a connection.
Returns a %Net.Remote.Gateway object, used for a specific IRIS process to connect with the JVM. Will try to use shared memory.
private classmethod GetNewGatewayPort() as %Integer [ Language = objectscript ]
Gets a new port which can be used for the object gateway. Increments based on the Web Server port to prevent multiple kits from using the same port. Goes up in blocks of 89, since we could possibly have a few gateways on those multiple kits and 89 is a sufficiently high prime number.
classmethod HandleJavaException(ex As %Exception.AbstractException) [ Language = objectscript ]
Utility that can be placed in a "catch" block which is "try"ing Java code. If the error occurred in Java, will extract and throw the relevent error message.
classmethod Uninstall(pResourceName As %String, pVerbose As %Boolean = 0) [ Language = objectscript ]
Uninstalls the object gateway from the instance. This is an instance- wide uninstall, not namespace-wide, so it shouldn't be called if only a namespace is being uninstalled.