Skip to content

Commit 0811b2c

Browse files
committed
Updated Bootstrap.java to better handle launch targets, we know split the setting up and launching in two spots, to allow more room for early services from boostrap to do their things... such as LoggerProviders
1 parent b905e46 commit 0811b2c

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

src/main/java/org/mangorage/bootstrap/Bootstrap.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,11 @@ public static void main(String[] args) throws Throwable {
8080
LOGGER.info("Launching target: " + launchTarget);
8181

8282
try {
83-
final var launchLayer = launchTargetMap.get(launchTarget).launch(moduleLayer, parent, args);
83+
final var target = launchTargetMap.get(launchTarget);
84+
final var launchLayer = target.setup(moduleLayer, parent, args);
8485
if (launchLayer != null) {
8586
DefaultLoggerFactory.load(launchLayer); // Load the providers this layer has!
87+
target.launch(launchLayer, args);
8688
}
8789
} catch (Throwable t) {
8890
LOGGER.error("Error during launch target execution: " + launchTarget, t);

src/main/java/org/mangorage/bootstrap/api/launch/ILaunchTarget.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,11 @@ public interface ILaunchTarget {
44
String getId();
55

66
/**
7+
* Set up the module layer and everything!
8+
*
79
* @return The ModuleLayer that was created!
810
*/
9-
ModuleLayer launch(ModuleLayer bootstrapLayer, ModuleLayer parent, String[] args) throws Throwable;
11+
ModuleLayer setup(ModuleLayer bootstrapLayer, ModuleLayer parent, String[] args) throws Throwable;
12+
13+
void launch(ModuleLayer moduleLayer, String[] args);
1014
}

0 commit comments

Comments
 (0)