JavaCompute node class loading by using a configurable service

The JavaCompute node loads and runs a Java™ class that is defined as the Java class property on the node. Normally, this class is deployed, along with any other required classes, in a Java archive (JAR) file that is contained in a BAR file. Any Java classes that are deployed in this way are loaded by an integration server-wide class loader. You can override this behavior by using the Javaclass loader configurable service property on the node.

As an alternative to using a configurable service, you can use shared libraries to provide isolation for deployed Java classes. Java classes that are deployed in a shared library are not available to the integration server-wide class loader. When you deploy a shared library that contains Java files, a new class loader is created for that shared library. For more information, see JavaCompute node class loading.

The class loader that is defined by the JavaClassLoader configurable service has a list of JAR files, defined by the includedDeployedJars property, which it owns and uses. Whenever these JAR files are deployed, the configurable service class loader receives the JAR files and uses them for resolving classes. The JAR files are no longer available to the integration server class loader, and any node that uses that class loader does not have access to any classes that are contained in those JAR files.

The configurable service class loader first searches all the deployed JAR files that it has received for a required class. If a required class cannot be found, the configurable service class loader defers to the shared class loader. The shared class loader looks in a set of directories on the integration node machine and loads any JAR files that are found. The shared class loader can be used to install required JAR files that do not need to be deployed repeatedly, such as client libraries that the JavaCompute nodes need to use. For more details, see Java shared classloader. You can override this mechanism by setting the sharedJarPath property on the configurable service to use a specified directory to find installed JAR files, rather than the shared classes directories.

If the required class cannot be found in any of the deployed JAR files, or in the JAR files that are installed in the shared classes directories, a class loader that contains all the integration node-supplied classes is checked (for example, this class loader contains the jplugin2.jar), followed by the classpath, and then the Java virtual machine (JVM) system class loader.

For information about how to create a JavaClassLoader configurable service, see mqsicreateconfigurableservice command. Properties of the JavaClassLoader configurable service are defined in JavaClassLoader configurable service.