Bootstrapping the Java API

System Configuration

Creation of the BEL Framework SystemConfiguration can be done using one of the following constructors:

  1. SystemConfiguration.createSystemConfiguration()
    • The no-arg method uses the BELFRAMEWORK_HOME environment variable to setup the system configuration. The BEL compiler uses this variant; the environment variable is configured in the platform setenv script.
  2. SystemConfiguration.createSystemConfiguration(java.io.File)
    • The file-based method uses a java.io.File to setup the system configuration. The BEL Framework tools use this variant with the -s option.
  3. SystemConfiguration.createSystemConfiguration(java.util.Map)
    • The map-based method uses a java.util.Map to setup the system configuration. This is the preferred method of programmatically configuring the BEL Framework for use.

Variable Expansion

There are a set of variables that will automatically be expanded in the system configuration when they are seen. These variables can be used in any value of a name-value pair.

{tmp}
Expanded to the system temporary directory.
{home}
Expanded to the user’s home directory.
{name}
Expanded to the user’s name.
{dir}
Expanded to the current working directory.
{belframework_home}
Expanded to the BELFRAMEWORK_HOME environment variable.

Programmatic Configuration

This is the simplest method of configuring the BEL Framework SystemConfiguration when using the Java API. The SystemConfiguration class exposes a variety of static fields that define the components of the framework’s configuration. See the belframework.cfg examples available in the config directory of the BEL Framework.

Example:

Map<String, String> map = new HashMap<String, String>();
map.put(SystemConfiguration.KAMSTORE_URL_DESC, "jdbc:mysql://localhost:3306");
map.put(SystemConfiguration.FRAMEWORK_WORKING_AREA_DESC, "{tmp}/bel_framework");
// map.put(SystemConfiguration...
SystemConfiguration syscfg = SystemConfiguration.createSystemConfiguration(map);