Packaging a Java user-defined node

How to package a Java™ user-defined node.

Before you begin

You must have a user-defined node written in Java. This node can be one of the provided sample nodes that are described in Sample node files, or a node that you have created yourself by using the instructions in either Creating a message processing or output node in Java or Creating an input node in Java.

About this task

You can package a user-defined node in two ways:
  • PAR
    A Plug-in Archive (PAR) is the deployment unit for Java user-defined nodes. The PAR contains the user-defined node classes and, if required as dependencies, can contain JAR files. A PAR file is a compressed file with a .par file extension. The directory structure in the .par file has the following format:
    • /classes

      The user-defined node classes are stored in this location.

    • /lib

      JAR files that are required by the user-defined node are stored in this location. This directory is optional because it might not be necessary to include JAR files.

    The following procedure describes how to package an example user-defined node, parexamplenode. In this example, the PAR is to be contained in par.example.parexamplenode.class with a JAR file dependency dependency.jar.
    1. Create the directory structure; for example:
      • /classes/par/example/parexamplenode.class
      • /lib/dep.jar
    2. Issue a file compression command to create the PAR; for example:

      jar cvf parexample.par classes lib

    The PAR must be placed in the LIL path that is specified in Installing user-defined extension runtime files on an integration node.

  • JAR

    User-defined nodes can be packaged by using a simple JAR. For example, if your node is defined in example/jarexamplenode.class, create the JAR by using the jar cvf jarexample.jar example command.

    The preferred way to package a Java user-defined node is to use a PAR file, because all dependencies can be packaged with the node, and each node is loaded in a separate class loader. For information about loading classes, see User-defined node class loading.

    The JAR must be placed in the LIL path that is specified in Installing user-defined extension runtime files on an integration node.

Deployment dependencies

About this task

If a user-defined node requires an external package, the package can be deployed in one of following ways:
  • The external packages can be added to the /lib directory in the deployed PAR.
  • For external packages that are shared between several node types, the packages can be added to one of the following locations:
    • One of the shared-classes directories. For more details of these directories, see Java shared classloader.
    • The CLASSPATH environment variable, where all user-defined nodes that are in the integration node installation can access the packages