You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@brooklyn.apache.org by GitBox <gi...@apache.org> on 2020/11/24 16:14:58 UTC

[GitHub] [brooklyn-server] duncangrant commented on a change in pull request #1126: Option to delay catalog initialization / rebind until after required OSGi services are available

duncangrant commented on a change in pull request #1126:
URL: https://github.com/apache/brooklyn-server/pull/1126#discussion_r529699668



##########
File path: karaf/init/src/main/java/org/apache/brooklyn/launcher/osgi/OsgiLauncherImpl.java
##########
@@ -108,21 +136,178 @@ public void initOsgi() {
         }
     }
 
+    Thread fallbackThread = null;
     @Override
     public void startOsgi() {
+        final Bundle bundle = FrameworkUtil.getBundle(this.getClass());
+
+        Framework f = (Framework) bundle.getBundleContext().getBundle(0);
+        int startLevel = f.adapt(FrameworkStartLevel.class).getStartLevel();
+
+        if (areServiceDependenciesReady(bundle, bundle + " bundle activation")) {
+            LOG.debug("Starting OSGi catalog/rebind (no service dependencies or all already satisfied, on bundle activation)");
+            doStartOsgiAfterBundlesRefreshed();
+
+        } else {
+            ServiceListener sl[] = { null };

Review comment:
       Very minor but not the standard java way.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org