Process
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
- 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 the compilation fails and the command-line option
-dci
is 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
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 the command line.
Once KBeans have been instantiated, KBean methods are executed in the order in which 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 other KBeans
from the same or other projects.