How To Use a FeatureEntryPoint class as my Application EntryPoint

An Application can require the use of advanced features, for example the FeatureEntryPoint.stop() method, in order to communicate with a Kernel. To use such features, you must create a class implementing the ej.kf.FeatureEntryPoint interface. The creation of a Feature class is done as follows:

  • Create a new Application project, as described in Create a Project.

  • Add the KF module in the dependencies block of the build.gradle.kts file of the project:

dependencies {
  implementation("ej.api:kf:1.7.0")
}
  • Create the Java class of the Feature EntryPoint in the src/main/java folder, for example:

package com.mycompany;

import ej.kf.FeatureEntryPoint;

public class MyFeature implements FeatureEntryPoint {
    @Override
    public void start() {
      System.out.println("Feature MyFeature started!");
    }

    @Override
    public void stop() {
      System.out.println("Feature MyFeature stopped!");
    }
}
  • Define the property applicationEntryPoint in the microej configuration block of the build.gradle.kts file. It must be set to the Full Qualified Name of the Feature class, for example:

    microej {
      applicationEntryPoint = "com.mycompany.MyFeature"
    }