See information about the latest product version
Packaging a Java user-defined node
How to package a Java™ user-defined node.
Before you start
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.
- PARA 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.- Create the directory structure; for example:
- /classes/par/example/parexamplenode.class
- /lib/dep.jar
- 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 a broker.
- /classes
- 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 a broker.
Deployment dependencies
- 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 broker installation can access the packages