User-defined node class loading

Details the Java™ classes packaging options and loading order precedence for user-defined nodes.

Java user-defined node classes can be packaged and loaded in two ways:
  • Plug-in Archive (PAR) file; an integration node defined format - Each PAR file is given it's own class loader which isolates any classes it loads from any other part of the IBM® Integration Bus, including nodes in other PAR files.
  • Standard Java archive (JAR) file - All JAR files containing plug-in nodes are loaded into the same classloader and can access classes in JAR files containing other user-defined nodes.

For both packaging mechanisms, if the classloader cannot find a required class within the package it defers to the shared class loader to find the required class. The shared classloader looks in a set of directories on the integration node machine and loads any JAR files found. It can be used to install any required JAR files that do not need to be repeatedly deployed, such as client libraries that the Java compute nodes need to use. For more details, see Java shared classloader.

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

Two key points must be considered when deciding which of the above mechanisms are used to load a class:

  • Isolation between different applications (for example: adding classes to the classpath makes them available to every part of IBM Integration Bus and can cause conflicts).
  • Delegation from one classloader to another can only occur in one direction. If a class is resolved in the shared classloader, then it cannot directly create classes in the PAR classloader.

User-defined nodes class loading search paths

User-defined nodes package in a PAR file

The integration node uses the following search path to find user-defined node classes:
  1. /classes to locate classes in the deployed PAR file.
  2. /lib to locate any JAR files in the deployed PAR file.
  3. workpath/config/<my_int_node_name>/<my_int_server_label>/shared-classes to locate any JAR files in the integration server shared-classes directory.
  4. workpath/config/<my_int_node_name>/shared-classes to locate any JAR files in the integration node shared-classes directory.
  5. workpath/shared-classes/ to locate any JAR files in the top level shared-classes directory.
  6. CLASSPATH environment variable.

User-defined nodes package in a JAR file

The integration node uses the following search path to find user-defined node classes:
  1. The deployed JAR file.
  2. workpath/config/<my_int_node_name>/<my_int_server_label>/shared-classes to locate any JAR files in the integration server shared-classes directory.
  3. workpath/config/<my_int_node_name>/shared-classes to locate any JAR files in the integration node shared-classes directory.
  4. workpath/shared-classes/ to locate any JAR files in the top level shared-classes directory.