X-Git-Url: http://git.argeo.org/?a=blobdiff_plain;f=base%2Fruntime%2Forg.argeo.eclipse.ui%2Fsrc%2Fmain%2Fjava%2Forg%2Fargeo%2Feclipse%2Fspring%2FApplicationContextTracker.java;h=070c70826b3c46ef9fe6e91422f4a8d9795204f9;hb=dede1b96fcc760d72229569259cea81bfe367f55;hp=527f45ee2bd7dc15586b552712c0c322f5fd0bbf;hpb=45a95c74c39b7158dc2e47c208b1ad72abbcf8a7;p=lgpl%2Fargeo-commons.git diff --git a/base/runtime/org.argeo.eclipse.ui/src/main/java/org/argeo/eclipse/spring/ApplicationContextTracker.java b/base/runtime/org.argeo.eclipse.ui/src/main/java/org/argeo/eclipse/spring/ApplicationContextTracker.java index 527f45ee2..070c70826 100644 --- a/base/runtime/org.argeo.eclipse.ui/src/main/java/org/argeo/eclipse/spring/ApplicationContextTracker.java +++ b/base/runtime/org.argeo.eclipse.ui/src/main/java/org/argeo/eclipse/spring/ApplicationContextTracker.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2007-2012 Mathieu Baudier + * Copyright (C) 2007-2012 Argeo GmbH * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -107,20 +107,32 @@ class ApplicationContextTracker { return getApplicationContext(contributorBundle); } - static ApplicationContext getApplicationContext(Bundle contributorBundle) { + static ApplicationContext getApplicationContext( + final Bundle contributorBundle) { if (log.isTraceEnabled()) log.trace("Get application context for bundle " + contributorBundle); // Start if not yet started (also if in STARTING state, may be lazy) if (contributorBundle.getState() != Bundle.ACTIVE) { + if (log.isTraceEnabled()) + log.trace("Starting bundle: " + + contributorBundle.getSymbolicName()); + // Thread startBundle = new Thread("Start bundle " + // + contributorBundle.getSymbolicName()) { + // public void run() { try { - if (log.isTraceEnabled()) - log.trace("Starting bundle: " - + contributorBundle.getSymbolicName()); contributorBundle.start(); } catch (BundleException e) { - e.printStackTrace(); + log.error("Cannot start bundle " + contributorBundle, e); } + // } + // }; + // startBundle.start(); + // try { + // startBundle.join(10 * 1000l); + // } catch (InterruptedException e) { + // // silent + // } } final ApplicationContextTracker applicationContextTracker = new ApplicationContextTracker(