Process
Jeka follows a specific process before invoking KBean methods :
- Parse command line and set system properties.
- Set working dir as [project dir]
- Augment the current classloader with jar files found in [project dir]/jeka/boot
- Parses source files contained in project dir/jeka/def
- Detect
@JkInjectProject
annotations. 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
- Detect
- Compile files in [project dir]/def/jeka and augment current classloader with compiled files
- If compilation fail and command-line option
-dci
is present, ignore it. - Scan classloader classpath to find KBeans and associate each KBean referenced in command line
- Identify the default KBean if any. The default KBean is the first class found
in [project dir]/jeka/def extending
JkBean
. - 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 command line.
Once KBeans have been instantiated, KBean methods are executed in order they appear in the command line.
Info
There is only one KBean instance by KBean class and by project.
Info
JkRuntime
is the KBean container for a given project. Each KBean instance
belongs to a JkRuntime
. From JkRuntime
, you can access to other KBeans
and injected projects.