Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUwe Stieber2014-08-07 11:50:24 +0000
committerUwe Stieber2014-08-07 11:50:24 +0000
commit0be23e485e9aaa7c784e3ab469775537fc668d33 (patch)
treeb83382c95b58e1f1e7ceb9d19d5c8dfb82a057c2
parentc9b91b3fabe2c89688b349350b27d18ae10e1999 (diff)
downloadorg.eclipse.tcf-0be23e485e9aaa7c784e3ab469775537fc668d33.tar.gz
org.eclipse.tcf-0be23e485e9aaa7c784e3ab469775537fc668d33.tar.xz
org.eclipse.tcf-0be23e485e9aaa7c784e3ab469775537fc668d33.zip
Target Explorer: Fix if opening a private channel fails, the "open channel" step group rollback can shutdown the value-add, reseting all open channels (unexpected connection lost)
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.core/src/org/eclipse/tcf/te/tcf/core/internal/channelmanager/steps/LaunchValueAddStep.java13
1 files changed, 10 insertions, 3 deletions
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.core/src/org/eclipse/tcf/te/tcf/core/internal/channelmanager/steps/LaunchValueAddStep.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.core/src/org/eclipse/tcf/te/tcf/core/internal/channelmanager/steps/LaunchValueAddStep.java
index 0f6c707a1..65b2d074a 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.core/src/org/eclipse/tcf/te/tcf/core/internal/channelmanager/steps/LaunchValueAddStep.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.core/src/org/eclipse/tcf/te/tcf/core/internal/channelmanager/steps/LaunchValueAddStep.java
@@ -32,6 +32,7 @@ import org.eclipse.tcf.te.tcf.core.va.interfaces.IValueAdd;
* LaunchValueAddStep
*/
public class LaunchValueAddStep extends AbstractPeerStep {
+ private static final String POSTFIX_KEEP_ALIVE = ".keepalive"; //$NON-NLS-1$
/* (non-Javadoc)
* @see org.eclipse.tcf.te.runtime.stepper.interfaces.IStep#validateExecute(org.eclipse.tcf.te.runtime.stepper.interfaces.IStepContext, org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer, org.eclipse.tcf.te.runtime.stepper.interfaces.IFullQualifiedId, org.eclipse.core.runtime.IProgressMonitor)
@@ -74,9 +75,14 @@ public class LaunchValueAddStep extends AbstractPeerStep {
boolean alive = ((Boolean)getResult()).booleanValue();
if (!alive) {
+ // Value-add not running -> launch it now
valueAdd.launch(peerId, callback);
- }
- else {
+ } else {
+ // Value-add had been alive -> no value add shutdown to be executed
+ // in a possible roll back. Otherwise the value-add might be killed
+ // for other open channels.
+ StepperAttributeUtil.setProperty(valueAdd.getId() + POSTFIX_KEEP_ALIVE, fullQualifiedId, data, true);
+ // Invoke the callback
callback(data, fullQualifiedId, callback, Status.OK_STATUS, null);
}
}
@@ -99,8 +105,9 @@ public class LaunchValueAddStep extends AbstractPeerStep {
final IValueAdd valueAdd = (IValueAdd)StepperAttributeUtil.getProperty(ITcfStepAttributes.ATTR_VALUE_ADD, fullQualifiedId, data);
final String peerId = getActivePeerContext(context, data, fullQualifiedId).getID();
final boolean useValueAdds = !StepperAttributeUtil.getBooleanProperty(IChannelManager.FLAG_NO_VALUE_ADD, fullQualifiedId, data);
+ final boolean keepalive = StepperAttributeUtil.getBooleanProperty(valueAdd.getId() + POSTFIX_KEEP_ALIVE, fullQualifiedId, data);
- if (useValueAdds) {
+ if (useValueAdds && !keepalive) {
Runnable runnable = new Runnable() {
@SuppressWarnings("synthetic-access")
@Override

Back to the top