@Override public Object run(Object context) { if (handleTracker == null) return getResult(); // app has ended, return the result EclipseAppHandle anyThreadedDefaultApp = (EclipseAppHandle) handleTracker.getService(); if (anyThreadedDefaultApp != null) // We now need to actual launch the application; this will run the application on another thread. AnyThreadAppLauncher.launchEclipseApplication(anyThreadedDefaultApp); try { while (waitOnRunning()) { EclipseAppHandle mainHandle = getMainHandle(); if (mainHandle != null) { // while we were waiting for the default application to end someone asked for a main threaded app to launch // note that we cannot hold the this lock while launching a main threaded application try { mainHandle.run(null); } catch (Throwable e) { String message = NLS.bind(Messages.application_error_starting, mainHandle.getInstanceId()); Activator.log(new FrameworkLogEntry(Activator.PI_APP, FrameworkLogEntry.WARNING, 0, message, 0, e, null)); } unsetMainHandle(mainHandle); } } } finally { handleTracker.close(); } return getResult(); }
curDefaultApplicationListener.launch(appHandle); else if (curMissingAppLauncher != null) curMissingAppLauncher.launch(appHandle); appLauncher = (ApplicationLauncher) launcherTracker.getService(); if (defaultAppListener == null) defaultAppListener = new DefaultApplicationListener(appHandle); curDefaultApplicationListener = defaultAppListener; if (appLauncher == null) {
@Override synchronized public void removedService(ServiceReference reference, Object service) { running = false; // only wait for 5 seconds; this may timeout if forcing an application to quit takes too long // this should never timeout if the application exited normally. result = ((EclipseAppHandle) service).waitForResult(5000); EclipseAppHandle mainHandle = getMainHandle(); if (mainHandle != null) // default application has quit; now force the main threaded application to quit try { mainHandle.destroy(); } catch (Throwable t) { String message = NLS.bind(Messages.application_error_stopping, mainHandle.getInstanceId()); Activator.log(new FrameworkLogEntry(Activator.PI_APP, FrameworkLogEntry.WARNING, 0, message, 0, t, null)); } this.notify(); }
curDefaultApplicationListener.launch(appHandle); else if (curMissingAppLauncher != null) curMissingAppLauncher.launch(appHandle); appLauncher = (ApplicationLauncher) launcherTracker.getService(); if (defaultAppListener == null) defaultAppListener = new DefaultApplicationListener(appHandle); curDefaultApplicationListener = defaultAppListener; if (appLauncher == null) {
synchronized public void removedService(ServiceReference reference, Object service) { running = false; // only wait for 5 seconds; this may timeout if forcing an application to quit takes too long // this should never timeout if the application exited normally. result = ((EclipseAppHandle) service).waitForResult(5000); EclipseAppHandle mainHandle = getMainHandle(); if (mainHandle != null) // default application has quit; now force the main threaded application to quit try { mainHandle.destroy(); } catch (Throwable t) { String message = NLS.bind(Messages.application_error_stopping, mainHandle.getInstanceId()); Activator.log(new FrameworkLogEntry(Activator.PI_APP, FrameworkLogEntry.WARNING, 0, message, 0, t, null)); } this.notify(); }
public Object run(Object context) { if (handleTracker == null) return getResult(); // app has ended, return the result EclipseAppHandle anyThreadedDefaultApp = (EclipseAppHandle) handleTracker.getService(); if (anyThreadedDefaultApp != null) // We now need to actual launch the application; this will run the application on another thread. AnyThreadAppLauncher.launchEclipseApplication(anyThreadedDefaultApp); try { while (waitOnRunning()) { EclipseAppHandle mainHandle = getMainHandle(); if (mainHandle != null) { // while we were waiting for the default application to end someone asked for a main threaded app to launch // note that we cannot hold the this lock while launching a main threaded application try { mainHandle.run(null); } catch (Throwable e) { String message = NLS.bind(Messages.application_error_starting, mainHandle.getInstanceId()); Activator.log(new FrameworkLogEntry(Activator.PI_APP, FrameworkLogEntry.WARNING, 0, message, 0, e, null)); } unsetMainHandle(mainHandle); } } } finally { handleTracker.close(); } return getResult(); }
curDefaultApplicationListener.launch(appHandle); else if (curMissingAppLauncher != null) curMissingAppLauncher.launch(appHandle); appLauncher = (ApplicationLauncher) launcherTracker.getService(); if (defaultAppListener == null) defaultAppListener = new DefaultApplicationListener(appHandle); curDefaultApplicationListener = defaultAppListener; if (appLauncher == null) {
synchronized public void removedService(ServiceReference reference, Object service) { running = false; // only wait for 5 seconds; this may timeout if forcing an application to quit takes too long // this should never timeout if the application exited normally. result = ((EclipseAppHandle) service).waitForResult(5000); EclipseAppHandle mainHandle = getMainHandle(); if (mainHandle != null) // default application has quit; now force the main threaded application to quit try { mainHandle.destroy(); } catch (Throwable t) { String message = NLS.bind(Messages.application_error_stopping, mainHandle.getInstanceId()); Activator.log(new FrameworkLogEntry(Activator.PI_APP, FrameworkLogEntry.WARNING, 0, message, 0, t, null)); } this.notify(); }
public Object run(Object context) { if (handleTracker == null) return getResult(); // app has ended, return the result EclipseAppHandle anyThreadedDefaultApp = (EclipseAppHandle) handleTracker.getService(); if (anyThreadedDefaultApp != null) // We now need to actual launch the application; this will run the application on another thread. AnyThreadAppLauncher.launchEclipseApplication(anyThreadedDefaultApp); try { while (waitOnRunning()) { EclipseAppHandle mainHandle = getMainHandle(); if (mainHandle != null) { // while we were waiting for the default application to end someone asked for a main threaded app to launch // note that we cannot hold the this lock while launching a main threaded application try { mainHandle.run(null); } catch (Throwable e) { String message = NLS.bind(Messages.application_error_starting, mainHandle.getInstanceId()); Activator.log(new FrameworkLogEntry(Activator.PI_APP, FrameworkLogEntry.WARNING, 0, message, 0, e, null)); } unsetMainHandle(mainHandle); } } } finally { handleTracker.close(); } return getResult(); }