Kernel APIs
Kernel API files (kernel.api) specify among all types owned by the Kernel which ones must be used by
Features, and for those types which members (methods, static fields and instance fields) are allowed to be accessed by
Features. When a type is not declared in a Kernel API, the Kernel and each Feature can have their own version of that type,
but if a type is declared in a Kernel API file only the Kernel version will be used by the Kernel and all the Features.
For more details, refer to Class Spaces.
Kernel API Definition
By default, when building a Kernel, no types are exposed as API for Features. The Kernel developer defines the set of APIs in Kernel API files, whose format is specified in Kernel API Definition.
A Kernel API file must be named kernel.api and placed at the root of one or more paths of the Application classpath (for example, the src/main/resources folder of an application or a library project).
Ready-to-use Kernel API files for the most common libraries, and an SDK tool that generates them, are described in Writing Kernel APIs.
Writing Kernel APIs
This section lists different ways to help to write kernel.api files.
Default Kernel APIs Derivation
MicroEJ Corp. provides predefined kernel API files for the most common libraries provided by a Kernel. These files are packaged as MicroEJ modules in the Developer Repository under the com/microej/kernelapi organisation.
The packaged file kernel.api can be extracted from the JAR file and edited
in order to keep only desired types, methods and fields.
Kernel API Generator
MicroEJ Kernel API Generator is a tool that helps to generate a kernel.api file based on a
Java classpath.
Kernel API Generator Schematic
Refer to the Kernel API Generator documentation to run the tool.
