Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPablo Torregrosa Paez2016-05-10 09:29:55 +0000
committerPablo Torregrosa Paez2016-05-10 09:29:55 +0000
commit46e1ca204904d252667c551b38adb8e2dd9e75ff (patch)
tree8ce794c11e2d52f43cfe31352da6818df42eafa6
parent2bec4cd50fd3e46c3675736c4d3eddaba5d4335f (diff)
downloadorg.eclipse.tcf-46e1ca204904d252667c551b38adb8e2dd9e75ff.tar.gz
org.eclipse.tcf-46e1ca204904d252667c551b38adb8e2dd9e75ff.tar.xz
org.eclipse.tcf-46e1ca204904d252667c551b38adb8e2dd9e75ff.zip
Target Explorer: On Disconnect, do not check if valueadd is responsive
Change-Id: I78843aa29fb3044a88f45bd35557329a5c058157 Signed-off-by: Pablo Torregrosa Paez <pablo.torregrosa@windriver.com>
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.core/src/org/eclipse/tcf/te/tcf/core/va/AbstractExternalValueAdd.java69
1 files changed, 39 insertions, 30 deletions
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 87569c2c7..09beccfda 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
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2012 - 2014 Wind River Systems, Inc. and others. All rights reserved.
+ * Copyright (c) 2012 - 2016 Wind River Systems, Inc. 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 http://www.eclipse.org/legal/epl-v10.html
@@ -106,6 +106,10 @@ public abstract class AbstractExternalValueAdd extends AbstractValueAdd {
*/
@Override
public void isAlive(final String id, final ICallback done) {
+ isAlive(id, done, true);
+ }
+
+ public void isAlive(final String id, final ICallback done, boolean testResponsive) {
Assert.isTrue(Protocol.isDispatchThread(), "Illegal Thread Access"); //$NON-NLS-1$
Assert.isNotNull(id);
Assert.isNotNull(done);
@@ -155,36 +159,41 @@ public abstract class AbstractExternalValueAdd extends AbstractValueAdd {
// If the process is still running, try to open a channel
if (!exited) {
- final ValueAddEntry finEntry = entry;
- final IChannel channel = entry.peer.openChannel();
- channel.addChannelListener(new IChannel.IChannelListener() {
-
- @Override
- public void onChannelOpened() {
- // Remove ourself as channel listener
- channel.removeChannelListener(this);
- // Close the channel, it is not longer needed
- channel.close();
- // Invoke the callback
- done.setResult(Boolean.TRUE);
- done.done(AbstractExternalValueAdd.this, Status.OK_STATUS);
- }
+ if (testResponsive) {
+ final ValueAddEntry finEntry = entry;
+ final IChannel channel = entry.peer.openChannel();
+ channel.addChannelListener(new IChannel.IChannelListener() {
+
+ @Override
+ public void onChannelOpened() {
+ // Remove ourself as channel listener
+ channel.removeChannelListener(this);
+ // Close the channel, it is not longer needed
+ channel.close();
+ // Invoke the callback
+ done.setResult(Boolean.TRUE);
+ done.done(AbstractExternalValueAdd.this, Status.OK_STATUS);
+ }
- @Override
- public void onChannelClosed(Throwable error) {
- // Remove ourself as channel listener
- channel.removeChannelListener(this);
- // External value-add is not longer alive, clean up
- entries.remove(id);
- finEntry.dispose();
- // Invoke the callback
- done.done(AbstractExternalValueAdd.this, Status.OK_STATUS);
- }
+ @Override
+ public void onChannelClosed(Throwable error) {
+ // Remove ourself as channel listener
+ channel.removeChannelListener(this);
+ // External value-add is not longer alive, clean up
+ entries.remove(id);
+ finEntry.dispose();
+ // Invoke the callback
+ done.done(AbstractExternalValueAdd.this, Status.OK_STATUS);
+ }
- @Override
- public void congestionLevel(int level) {
- }
- });
+ @Override
+ public void congestionLevel(int level) {
+ }
+ });
+ } else {
+ done.setResult(Boolean.TRUE);
+ done.done(AbstractExternalValueAdd.this, Status.OK_STATUS);
+ }
} else {
done.done(AbstractExternalValueAdd.this, Status.OK_STATUS);
}
@@ -471,7 +480,7 @@ public abstract class AbstractExternalValueAdd extends AbstractValueAdd {
}
done.done(AbstractExternalValueAdd.this, Status.OK_STATUS);
}
- });
+ }, false);
} else {
done.done(AbstractExternalValueAdd.this, Status.OK_STATUS);
}

Back to the top