KF

Definitions

Feature Definition Files

A Feature is a group of types, resources and [BON] immutables objects defined using two files that shall be in Application classpath:

Feature definition file properties

Key

Usage

Description

entryPoint

Mandatory

The fully qualified name of the class that implements ej.kf.FeatureEntryPoint

immutables

Optional

Semicolon separated list of paths to [BON] immutable files owned by the Feature. [BON] immutable file is defined by a / separated path relative to application classpath

resources

Optional

Semicolon separated list of resource names owned by the Feature. Resource name is defined by Class.getResourceAsStream(String)

requiredTypes

Optional

Comma separated list of fully qualified names of required types. (Types that may be dynamically loaded using Class.forName()).

types

Optional

Comma separated list of fully qualified names of types owned by the Feature. A wildcard is allowed as terminal character to embed all types starting with the given qualified name (a.b.C,x.y.*)

version

Mandatory

String version, that can retrieved using ej.kf.Module.getVersion()

Kernel Definition Files

Kernel definition files are mandatory if one or more Feature definition file is loaded and are named kernel.kf and kernel.cert. kernel.kf must only define the version key. All types, resources and immutables are automatically owned by the Kernel if not explicitly set to be owned by a Feature.

Kernel API Files

Kernel API file definition is explained here: Kernel API.

Access Error Codes

When an instruction is executed that will break a [KF] specification insulation semantic rule, a java.lang.IllegalAccessError is thrown, with an error code composed of two parts: [source][errorKind].

Error codes: source

Character

Description

A

Error thrown when accessing an array

I

Error thrown when calling a method

F

Error thrown when accessing an instance field

M

Error thrown when entering a synchronized block or method

P

Error thrown when passing a parameter to a method call

R

Error thrown when returning from a method call

S

Error thrown when accessing a static field

Error codes: kind

Id

Description

1

An object owned by a Feature is being assigned to an object owned by the Kernel, but the current context is not owned by the Kernel

2

An object owned by a Feature is being assigned to an object owned by another Feature

3

An object owned by a Feature is being accessed from a context owned by another Feature

4

A synchronize on an object owned by the Kernel is executed in a method owned by a Feature

5

A call to a feature code occurs while owning a Kernel monitor

Feature Installation and Loading Error Codes

When an error occurs during the installation of a Feature via the Kernel.install(InputStream) method, or during the loading of installed Features at bootstrap, the system may throw an ej.kf.InvalidFormatException.

This exception carries a specific error code, which can be retrieved by calling the getMessage() method on the InvalidFormatException instance. The returned message will follow the format: code=<id>, where id corresponds the specific error encountered.

Error codes ranging from 150 to 180, thrown during Feature installation, typically indicate an invalid or corrupted Feature file. This corruption may occur during the file transfer process.

Other possible causes for this exception include errors returned by the LLKERNEL abstraction layer, or issues with a stored Feature, such as corruption or incompatibility.

Feature Installation Error Codes Related to LLKERNEL Implementation

Id

Description

51

The LLKERNEL_impl_copyToROM() function returned an error.

52

The maximum number of installed Features is reached.

54

The address returned by the last call to LLKERNEL_impl_getFeatureAddressRAM() or LLKERNEL_impl_getFeatureAddressROM() does not match the alignment constraint.

55

The address returned by the last call to LLKERNEL_impl_getFeatureAddressROM() overlaps with a previously returned address.

56

The address returned by the last call to LLKERNEL_impl_getFeatureAddressRAM() overlaps with a previously returned address.

58

The .fo file cannot be installed on this Kernel because it contains a code chunk section with a size greater than this Kernel code chunk size.

59

The LLKERNEL_IMPL_allocateFeature() function returned 0. The Feature cannot be allocated in memory.

Installed Feature Loading Error Codes

Id

Description

53

The installed Feature content has been corrupted (CRC check error).

57

The address returned by the last call to LLKERNEL_impl_getFeatureAddressRAM() is not the same than the one returned when the Feature has been installed.

60

The LLKERNEL_IMPL_getFeatureHandle() function returned 0. The handle for an installed Feature could not be retrieved as expected.