Commented experiment with starting bundle in separate thread.
[lgpl/argeo-commons.git] / base / runtime / org.argeo.eclipse.ui / src / main / java / org / argeo / eclipse / spring / ApplicationContextTracker.java
index c31b9ddedd73d39e9d0a6ceb9f50c1b94c45deb7..070c70826b3c46ef9fe6e91422f4a8d9795204f9 100644 (file)
@@ -107,20 +107,32 @@ class ApplicationContextTracker {
                return getApplicationContext(contributorBundle);\r
        }\r
 \r
-       static ApplicationContext getApplicationContext(Bundle contributorBundle) {\r
+       static ApplicationContext getApplicationContext(\r
+                       final Bundle contributorBundle) {\r
                if (log.isTraceEnabled())\r
                        log.trace("Get application context for bundle " + contributorBundle);\r
 \r
                // Start if not yet started (also if in STARTING state, may be lazy)\r
                if (contributorBundle.getState() != Bundle.ACTIVE) {\r
+                       if (log.isTraceEnabled())\r
+                               log.trace("Starting bundle: "\r
+                                               + contributorBundle.getSymbolicName());\r
+                       // Thread startBundle = new Thread("Start bundle "\r
+                       // + contributorBundle.getSymbolicName()) {\r
+                       // public void run() {\r
                        try {\r
-                               if (log.isTraceEnabled())\r
-                                       log.trace("Starting bundle: "\r
-                                                       + contributorBundle.getSymbolicName());\r
                                contributorBundle.start();\r
                        } catch (BundleException e) {\r
-                               e.printStackTrace();\r
+                               log.error("Cannot start bundle " + contributorBundle, e);\r
                        }\r
+                       // }\r
+                       // };\r
+                       // startBundle.start();\r
+                       // try {\r
+                       // startBundle.join(10 * 1000l);\r
+                       // } catch (InterruptedException e) {\r
+                       // // silent\r
+                       // }\r
                }\r
 \r
                final ApplicationContextTracker applicationContextTracker = new ApplicationContextTracker(\r