Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--plugins/org.eclipse.tcf/src/org/eclipse/tcf/EventQueue.java8
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.core/src/org/eclipse/tcf/te/tcf/core/va/AbstractExternalValueAdd.java19
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/ScannerRunnable.java4
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/activator/UIPlugin.java12
4 files changed, 26 insertions, 17 deletions
diff --git a/plugins/org.eclipse.tcf/src/org/eclipse/tcf/EventQueue.java b/plugins/org.eclipse.tcf/src/org/eclipse/tcf/EventQueue.java
index 97c234f45..5a09b231f 100644
--- a/plugins/org.eclipse.tcf/src/org/eclipse/tcf/EventQueue.java
+++ b/plugins/org.eclipse.tcf/src/org/eclipse/tcf/EventQueue.java
@@ -12,7 +12,6 @@ package org.eclipse.tcf;
import java.util.LinkedList;
-import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.jobs.IJobChangeEvent;
import org.eclipse.core.runtime.jobs.IJobChangeListener;
import org.eclipse.core.runtime.jobs.Job;
@@ -103,12 +102,7 @@ class EventQueue implements IEventQueue, Runnable {
public synchronized void invokeLater(final Runnable r) {
assert r != null;
- if (shutdown) {
- // If not in debug mode, silently ignore this case to avoid
- // confusion and bad impression to the user.
- if (Platform.inDebugMode()) throw new IllegalStateException("TCF event dispatcher has shut down"); //$NON-NLS-1$
- return;
- }
+ if (shutdown) throw new IllegalStateException("TCF event dispatcher has shut down"); //$NON-NLS-1$
queue.add(r);
if (waiting) {
waiting = false;
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.core/src/org/eclipse/tcf/te/tcf/core/va/AbstractExternalValueAdd.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.core/src/org/eclipse/tcf/te/tcf/core/va/AbstractExternalValueAdd.java
index ba11107d1..a25594d9e 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.core/src/org/eclipse/tcf/te/tcf/core/va/AbstractExternalValueAdd.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.core/src/org/eclipse/tcf/te/tcf/core/va/AbstractExternalValueAdd.java
@@ -13,6 +13,7 @@ import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
+import java.util.Map.Entry;
import org.eclipse.core.runtime.Assert;
import org.eclipse.core.runtime.IPath;
@@ -23,12 +24,10 @@ import org.eclipse.tcf.protocol.IChannel;
import org.eclipse.tcf.protocol.IPeer;
import org.eclipse.tcf.protocol.JSON;
import org.eclipse.tcf.protocol.Protocol;
-import org.eclipse.tcf.te.core.async.AsyncCallbackCollector;
import org.eclipse.tcf.te.runtime.callback.Callback;
import org.eclipse.tcf.te.runtime.interfaces.callback.ICallback;
import org.eclipse.tcf.te.runtime.utils.net.IPAddressUtil;
import org.eclipse.tcf.te.tcf.core.activator.CoreBundleActivator;
-import org.eclipse.tcf.te.tcf.core.async.CallbackInvocationDelegate;
import org.eclipse.tcf.te.tcf.core.interfaces.tracing.ITraceIds;
import org.eclipse.tcf.te.tcf.core.nls.Messages;
import org.eclipse.tcf.te.tcf.core.peers.Peer;
@@ -364,13 +363,17 @@ public abstract class AbstractExternalValueAdd extends AbstractValueAdd {
Assert.isTrue(Protocol.isDispatchThread(), "Illegal Thread Access"); //$NON-NLS-1$
Assert.isNotNull(done);
- AsyncCallbackCollector collector = new AsyncCallbackCollector(done, new CallbackInvocationDelegate());
-
- for (String id : entries.keySet()) {
- ICallback callback = new AsyncCallbackCollector.SimpleCollectorCallback(collector);
- shutdown(id, callback);
+ // On shutdown all, we don't care about the alive state of the value-add.
+ // We force the value-add to shutdown if not yet gone by destroying the process.
+ for (Entry<String, ValueAddEntry> entry : entries.entrySet()) {
+ ValueAddEntry value = entry.getValue();
+ if (value.process != null) {
+ value.process.destroy();
+ }
}
+ // Clear all entries from the list
+ entries.clear();
- collector.initDone();
+ done.done(AbstractExternalValueAdd.this, Status.OK_STATUS);
}
}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/ScannerRunnable.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/ScannerRunnable.java
index 49525d84e..1b1e071c3 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/ScannerRunnable.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/ScannerRunnable.java
@@ -92,6 +92,10 @@ public class ScannerRunnable implements Runnable, IChannel.IChannelListener {
public void run() {
Assert.isTrue(Protocol.isDispatchThread(), "Illegal Thread Access"); //$NON-NLS-1$
+ // If the parent scanner is terminated, don't do anything
+ IScanner scanner = getParentScanner();
+ if (scanner != null && scanner.isTerminated()) return;
+
// If a scanner runnable already active for this peer node, there
// is no need to run another scan.
if (peerNode.getProperty("scanner.transient") != null) return; //$NON-NLS-1$
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/activator/UIPlugin.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/activator/UIPlugin.java
index e6cf6924d..61f27ee0d 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/activator/UIPlugin.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/activator/UIPlugin.java
@@ -18,6 +18,8 @@ import org.eclipse.jface.resource.ImageRegistry;
import org.eclipse.swt.graphics.Image;
import org.eclipse.tcf.protocol.Protocol;
import org.eclipse.tcf.te.tcf.core.Tcf;
+import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.ILocatorModel;
+import org.eclipse.tcf.te.tcf.locator.model.Model;
import org.eclipse.tcf.te.tcf.ui.internal.ImageConsts;
import org.eclipse.tcf.te.ui.jface.images.AbstractImageDescriptor;
import org.eclipse.ui.IWorkbench;
@@ -87,8 +89,14 @@ public class UIPlugin extends AbstractUIPlugin {
if (!proceedShutdown && !forced) break;
}
- // Close all channels now
- if (proceedShutdown || forced) Tcf.getChannelManager().closeAll(!Protocol.isDispatchThread());
+ if (proceedShutdown || forced) {
+ // Terminate the scanner
+ ILocatorModel model = Model.getModel(true);
+ if (model != null) model.getScanner().terminate();
+
+ // Close all channels now
+ Tcf.getChannelManager().closeAll(!Protocol.isDispatchThread());
+ }
return proceedShutdown;
}

Back to the top