- frameworkStartLevel.setStartLevel(activeStartLevel, (FrameworkEvent event) -> {
- if (OsgiBootUtils.isDebug())
- OsgiBootUtils.debug("Framework event: " + event);
- int initialStartLevel = frameworkStartLevel.getInitialBundleStartLevel();
- int startLevel = frameworkStartLevel.getStartLevel();
- OsgiBootUtils.debug("Framework start level: " + startLevel + " (initial: " + initialStartLevel + ")");
+
+ if (OsgiBootUtils.isDebug())
+ OsgiBootUtils.debug("About to set framework start level to " + activeStartLevel + " ...");
+
+ // Start the framework asynchronously
+ ForkJoinPool.commonPool().execute(() -> {
+ frameworkStartLevel.setStartLevel(activeStartLevel, (FrameworkEvent event) -> {
+ if (OsgiBootUtils.isDebug())
+ OsgiBootUtils.debug("Framework event: " + event);
+ int initialStartLevel = frameworkStartLevel.getInitialBundleStartLevel();
+ int startLevel = frameworkStartLevel.getStartLevel();
+ if (OsgiBootUtils.isDebug())
+ OsgiBootUtils
+ .debug("Framework start level: " + startLevel + " (initial: " + initialStartLevel + ")");
+ });