Jeka follows a specific process before invoking KBean methods :
- Parse command line and set arguments specified as -Dxxx=yyy as system properties.
- Set [project dir] = current working dir
- Augment the current classloader with jar files found in [project dir]/jeka/boot
- Augment the current classloader with resolved coordinates mentionned in command line as @group:name:version
- Parse source files contained in project dir/jeka/def
@JkInjectProjectannotations. For each :
- Set [project dir] to value declared in annotation
- Process steps 3, 4, 5, 6 for the injected project
- Augment the current classloader with dependencies declared in source files
- Compile files in [project dir]/def/jeka and augment current classloader with compiled files
- If the compilation fails and the command-line option
-dciis present, ignore it.
- Scan classloader classpath to find KBeans and associate each KBean referenced in the command line.
- Identify the default KBean if available. The default KBean is the first class found
in [project dir]/jeka/def extending
- Instantiate the default KBean. Instantiate means :
- Invoke no-arg constructor
- Inject KBean properties mentioned in command line
- Instantiate other KBean, if not yet done by order they appear in the command line.
Once KBeans have been instantiated, KBean methods are executed in the order in which they appear in the command line.
There is only one KBean instance by KBean class and by project.
JkRuntime is the KBean container for a given project. Each KBean instance
belongs to a
JkRuntime, you can access other KBeans
from the same or other projects.