Commented experiment with starting bundle in separate thread.
authorMathieu Baudier <mbaudier@argeo.org>
Tue, 4 Dec 2012 15:38:51 +0000 (15:38 +0000)
committerMathieu Baudier <mbaudier@argeo.org>
Tue, 4 Dec 2012 15:38:51 +0000 (15:38 +0000)
git-svn-id: https://svn.argeo.org/commons/trunk@5893 4cfe0d0a-d680-48aa-b62c-e0a02a3f76cc

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