Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Watson2008-02-29 17:58:54 +0000
committerThomas Watson2008-02-29 17:58:54 +0000
commitbc43b3598486c78e52e023f1caef38b065928de6 (patch)
treeb081d0bc2cdf2c525456b43f46bb0a47d25b72d0 /bundles/org.eclipse.osgi/eclipseAdaptor
parent9766616b46a2288598e4f049971a02ae75453fb1 (diff)
downloadrt.equinox.framework-bc43b3598486c78e52e023f1caef38b065928de6.tar.gz
rt.equinox.framework-bc43b3598486c78e52e023f1caef38b065928de6.tar.xz
rt.equinox.framework-bc43b3598486c78e52e023f1caef38b065928de6.zip
Bug 128531 Set startlevel back to previous level when relaunched from console
Diffstat (limited to 'bundles/org.eclipse.osgi/eclipseAdaptor')
-rw-r--r--bundles/org.eclipse.osgi/eclipseAdaptor/src/org/eclipse/core/runtime/adaptor/EclipseStarter.java4
-rw-r--r--bundles/org.eclipse.osgi/eclipseAdaptor/src/org/eclipse/core/runtime/internal/adaptor/EclipseAdaptorHook.java14
-rw-r--r--bundles/org.eclipse.osgi/eclipseAdaptor/src/org/eclipse/core/runtime/internal/adaptor/EclipseAppLauncher.java5
3 files changed, 10 insertions, 13 deletions
diff --git a/bundles/org.eclipse.osgi/eclipseAdaptor/src/org/eclipse/core/runtime/adaptor/EclipseStarter.java b/bundles/org.eclipse.osgi/eclipseAdaptor/src/org/eclipse/core/runtime/adaptor/EclipseStarter.java
index a2f1a0e27..45a4fd4b0 100644
--- a/bundles/org.eclipse.osgi/eclipseAdaptor/src/org/eclipse/core/runtime/adaptor/EclipseStarter.java
+++ b/bundles/org.eclipse.osgi/eclipseAdaptor/src/org/eclipse/core/runtime/adaptor/EclipseStarter.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2003, 2007 IBM Corporation and others.
+ * Copyright (c) 2003, 2008 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -390,6 +390,8 @@ public class EclipseStarter {
splashStreamRegistration.unregister();
if (defaultMonitorRegistration != null)
defaultMonitorRegistration.unregister();
+ if (appLauncher != null)
+ appLauncher.shutdown();
appLauncherRegistration = null;
appLauncher = null;
splashStreamRegistration = null;
diff --git a/bundles/org.eclipse.osgi/eclipseAdaptor/src/org/eclipse/core/runtime/internal/adaptor/EclipseAdaptorHook.java b/bundles/org.eclipse.osgi/eclipseAdaptor/src/org/eclipse/core/runtime/internal/adaptor/EclipseAdaptorHook.java
index 6dce830d3..2acaef060 100644
--- a/bundles/org.eclipse.osgi/eclipseAdaptor/src/org/eclipse/core/runtime/internal/adaptor/EclipseAdaptorHook.java
+++ b/bundles/org.eclipse.osgi/eclipseAdaptor/src/org/eclipse/core/runtime/internal/adaptor/EclipseAdaptorHook.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005, 2006 IBM Corporation and others.
+ * Copyright (c) 2005, 2008 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -11,7 +11,7 @@
package org.eclipse.core.runtime.internal.adaptor;
-import java.io.*;
+import java.io.IOException;
import java.net.URLConnection;
import java.util.*;
import javax.xml.parsers.DocumentBuilderFactory;
@@ -30,7 +30,6 @@ import org.eclipse.osgi.internal.baseadaptor.AdaptorUtil;
import org.eclipse.osgi.service.datalocation.Location;
import org.eclipse.osgi.service.pluginconversion.PluginConverter;
import org.eclipse.osgi.service.resolver.PlatformAdmin;
-import org.eclipse.osgi.service.runnable.ApplicationLauncher;
import org.eclipse.osgi.service.urlconversion.URLConverter;
import org.osgi.framework.*;
@@ -142,14 +141,7 @@ public class EclipseAdaptorHook implements AdaptorHook, HookConfigurator {
}
public void frameworkStopping(BundleContext context) {
- // Shutdown the ApplicationLauncher service if it is available.
- ServiceReference launcherRef = context.getServiceReference(ApplicationLauncher.class.getName());
- if (launcherRef != null) {
- ApplicationLauncher launcher = (ApplicationLauncher) context.getService(launcherRef);
- // this will force a currently running application to stop.
- launcher.shutdown();
- context.ungetService(launcherRef);
- }
+ // do nothing
}
public void addProperties(Properties properties) {
diff --git a/bundles/org.eclipse.osgi/eclipseAdaptor/src/org/eclipse/core/runtime/internal/adaptor/EclipseAppLauncher.java b/bundles/org.eclipse.osgi/eclipseAdaptor/src/org/eclipse/core/runtime/internal/adaptor/EclipseAppLauncher.java
index c24aa5ae5..fd545a032 100644
--- a/bundles/org.eclipse.osgi/eclipseAdaptor/src/org/eclipse/core/runtime/internal/adaptor/EclipseAppLauncher.java
+++ b/bundles/org.eclipse.osgi/eclipseAdaptor/src/org/eclipse/core/runtime/internal/adaptor/EclipseAppLauncher.java
@@ -15,6 +15,7 @@ import java.lang.reflect.Method;
import java.util.Map;
import org.eclipse.core.runtime.adaptor.EclipseStarter;
import org.eclipse.osgi.framework.adaptor.FrameworkAdaptor;
+import org.eclipse.osgi.framework.internal.core.Constants;
import org.eclipse.osgi.framework.internal.core.FrameworkProperties;
import org.eclipse.osgi.framework.log.FrameworkLog;
import org.eclipse.osgi.framework.log.FrameworkLogEntry;
@@ -72,6 +73,7 @@ public class EclipseAppLauncher implements ApplicationLauncher {
if (failOnNoDefault && runnable == null)
throw new IllegalStateException(EclipseAdaptorMsg.ECLIPSE_STARTUP_ERROR_NO_APPLICATION);
Object result = null;
+ boolean doRelaunch;
do {
try {
result = runApplication(defaultContext);
@@ -81,7 +83,8 @@ public class EclipseAppLauncher implements ApplicationLauncher {
if (log != null)
log.log(new FrameworkLogEntry(FrameworkAdaptor.FRAMEWORK_SYMBOLICNAME, FrameworkLogEntry.ERROR, 0, EclipseAdaptorMsg.ECLIPSE_STARTUP_APP_ERROR, 1, e, null));
}
- } while (relaunch && (context.getBundle().getState() & Bundle.ACTIVE) != 0);
+ doRelaunch = (relaunch && (context.getBundle().getState() & Bundle.ACTIVE) != 0) || FrameworkProperties.getProperty(Constants.PROP_OSGI_RELAUNCH) != null;
+ } while (doRelaunch);
return result;
}

Back to the top