Installation

The devel.one framework can be used in two ways:

  • Stand-Alone devel.one runs alone as a program and loads apps as a plug-in.
  • Embedded An existing program loads and initializes the devel.one library.
  • The class CKernel can be simply instantiated using a JAR file in the classpath. After that all functions are also available in other programs.
  • The main method of the kernel can be called. Devel.one then starts as
  independent program, loads its configuration files as well as the plug-ins.
Your own application can then start as a plug-in at StartUp. Alternatively, you can also create an app that can be started at startup or at a later time.

Program-Arguments

Each devel.one instance needs at least its own directory, where it expects the configuration files. In addition, files are created in this directory by the program, e.g. a H2 database with the persistent configuration and runtime variables. The directory and various other settings are passed as program arguments.

The format of the program arguments:

path/key=value

Example:

kernel/ConfigDir=config/

In this case kernel is the PATH (could also look like a Windows registry path, e.g. a/b/c/d), ConfigDir is the KEY and config/ is the configuration VALUE.

Stand-Alone

The main method of the kernel is called. Devel.one then starts as a stand-alone program, loads its configuration files as well as the plug-ins. Your own application is loaded as a plug-in at StartUp.

In stand-alone mode, much-needed configuration values are passed as program arguments. All other arguments can be passed in a configuration file.

Command Line

A typical call to a devel.one standalone instance looks something like this:

// -cp lib/*                                        The ClassPath, which also contains the D1Kernel.jar.
// -Dlogback.configurationFile=config/logback.xml   A VM argument for configuring the LOGBACK logging system.
// de.softdevel.d1.kernel.impl.CKernel              Here is the main method to start.
// kernel/ConfigDir=001/config/                     A program argument: Directory of configuration files
// kernel/PluginDir=common/plugins/                 A program argument: Directory of plugins to load

java -cp lib/* -Dlogback.configurationFile=config/logback.xml de.softdevel.d1.kernel.impl.CKernel kernel/ConfigDir=config/ kernel/PluginDir=common/plugins/ kernel/RecordDbFile=common/recorddb.xml

Embedded

The devel.one kernel can be started simply by creating an instance of the class with new. The configuration arguments are given as parameters:

final Collection<IDatapoolRecord> args = new ArrayList<>();
args.add(new CDatapoolRecord("kernel", "ConfigDir", "c:\test", "Path of Configuration Files", true));

IKernel kernel = new CKernel(args);

Only one kernel can be initialized in the program.

The main program arguments

  • The Configuration Directory:

    There is a configuration directory for each devel.one NODE to be started.
    It is best to create a directory in the HOME directory, such as: c:/user/michael/node001 or ~/node001
    Each NODE requires its own directory, because it persists data in a H2 database file.
    In addition, the configuration file datapool.xml is expected in this directory.

    The directory is passed as a program argument.

    Example:

    kernel/ConfigDir=c:\user\michael\node001
    
    kernel/ConfigDir is the configuration key.
    c:\user\michael\node001 Is the value to be specified here.
    The configuration files that are optionally included in the directory are described below.
  • Directory for Internal LOG Files:

    Example:

    kernel/LogDir=c:\user\michael\node001\log
    
    This directory is used for internal LOGs as for the GateKeeper.
    The LOGBACK Logging System uses its own configuration file whose path can be specified via the VM argument.
  • The Plug-In Directory:

    Example:

    kernel/PluginDir=c:\user\michael\d1\plugins
    

    The plug-in directory can be shared by all NODES.

There are a lot of other configuration keys, which are listed below.

List of the most common program arguments

Path + Key Variable type meanings Example
kernel/NODEID UUID NODE-ID 06708aeb-ec9b-456d-829e-30c5cfdd6503
kernel/LICENSE UUID License-ID 06708aeb-ec9b-456d-829e-30c5cfdd6503
kernel/NAME String Name of the NODE Node001
kernel/VENDOR String Vendor of the NODE softdevel GmbH
kernel/DESCRIPTION String Description of the NODE NODE for UI
kernel/DebugEnvelope Boolean Message Debug Info in stream true
kernel/LogDir String Log Dir for GateKeeper ./log
kernel/ConfigDir String Path of configuration files .
kernel/PluginDir String Path of Plug-ins ../plugins
kernel/DumpDatapool Boolean True: Dump of configuration False
kernel/MaximumSavedEarlyLogs Integer Number of stored LOG texts 10000
kernel/EnablePrintingEnvironment Boolean True: Print Environment True
namespaces/XXX/OwnDatapool Boolean True: Datapool for namespace XXX True

The Configuration File

The name of the configuration file is always datapool.xml.
It is expected in the NODE-specific configuration directory.

Example:

<?xml version="1.0"?>
<datapool>
    <record path="kernel">
        <recordentry key="NODEID" value="06708aeb-ec9b-456d-829e-30c5cfdd6503" description="The node ID." />
        <recordentry key="LICENSE" value="06708aeb-ec9b-456d-829e-30c5cfdd6503" description="The license key." />
        <recordentry key="NAME" value="Node001" description="The name of the node." />
        <recordentry key="VENDOR" value="softdevel GmbH" description="The vendor of this node." />
        <recordentry key="DESCRIPTION" value="Node 001" description="The description for this node." />
    </record>
</datapool>

The format is the same as the program arguments: path/key=value. The values will be stored into the data pool. This is a service that persists the values in an SQL database. The values can be read and written by apps through method calls or by messages. The data pool also supports the Observer pattern. Apps can be registered at the data pool as an observer and receive e.g. a message when a value should change.

The readonly attribute ensures that the value can not be changed as long as the program is running.

If a value is already in the database, it is overwritten by the configuration. If it is not to be overwritten, the attribute force = false must be used.

The description element is optional.

The order when importing configuration values

  • The kernel looks for the program argument kernel/ConfigDir to find the configuration file.
    The value is the configuration directory of the instance where the database file is stored.
  • All values of the configuration file are now imported.

  • The program arguments are now entered.
    If a program argument already exists, it is only entered if the attribute force = true is set.
    Because the default value is true, it means that force=false does NOT overwrite an existing value in the database.