Custom extensions

The Java archive (JAR) files that implement the B2Bi trading engine are in two directories under the installation directory:

  • The jars directory contains files specific to the trading engine.
  • The corelib directory contains third-party libraries.

The jars directory contains the API interface definitions you need to compile your application. Add all files in this directory to the classpath of your compiler.

Caution   If you are referencing third-party libraries from your custom modifications, ensure the versions of the libraries you want to use are identical to the versions in the corelib directory. The B2Bi trading engine is not supportable if you change or replace any JAR file provided with the application.

The class path used by all of the trading engine JVMs, except the executive node, is specified by the "CYC_CP" environment variable initially set by the bin/environment script file and appended by the bin/startserver script. By default, this classpath contains the following:

Directory

Description

/classes

This directory is not created by the installer so you won’t see it unless you create it yourself. Classes in this directory are loaded first.

/jars

This directory contains all B2Bi trading engine specific JAR files. Any JAR in this directory is automatically added to the classpath of the B2Bi JVM.

/corelib

All third-party JAR class libraries are stored in here. Any JAR in this directory is automatically added to the classpath of the B2Bi JVM.

B2Bi uses its own class loader to load Java classes from the file system. At runtime, all class libraries in these directories are added to the classpath of the running node. The directories are scanned in the order noted in the preceding table. There is no relative order imposed on the JARs in any one directory. Any class files in an appropriately structured file system under one of the directories (that is, not in a JAR file) is added to the classpath as well.

Deploy your custom extensions to <install directory>/site/jars. The site/jars directory is included in the classpath before the jars directory. Also importantly, the site/jars directory is copied to the new installation directory when you install a new release of the trading engine and choose the upgrade option.

For your custom extensions, there is nothing preventing you from modifying the "CYC_CP" variable defined in the bin/environment script file. However, this makes the setup more difficult to migrate to new environments or version upgrades.

Related Links