Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUwe Stieber2014-07-16 08:26:56 -0400
committerUwe Stieber2014-07-16 08:26:56 -0400
commite41d57be00d0df2968232c983db785a15d056731 (patch)
tree5ba510aaffed0b32731aae36dbabd11fc0297aae
parente9bac50ab79f58592d0d318543892caa7037f1d2 (diff)
downloadorg.eclipse.tcf-e41d57be00d0df2968232c983db785a15d056731.tar.gz
org.eclipse.tcf-e41d57be00d0df2968232c983db785a15d056731.tar.xz
org.eclipse.tcf-e41d57be00d0df2968232c983db785a15d056731.zip
Target Explorer: Fix close channel step group
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/src/org/eclipse/tcf/te/runtime/stepper/stepper/Stepper.java8
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.core/plugin.xml6
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.core/src/org/eclipse/tcf/te/tcf/core/internal/channelmanager/ChannelManager2.java10
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.core/src/org/eclipse/tcf/te/tcf/core/internal/channelmanager/steps/CloseChannelStep.java14
4 files changed, 20 insertions, 18 deletions
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/src/org/eclipse/tcf/te/runtime/stepper/stepper/Stepper.java b/target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/src/org/eclipse/tcf/te/runtime/stepper/stepper/Stepper.java
index 71ea2dab5..c30e50f59 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/src/org/eclipse/tcf/te/runtime/stepper/stepper/Stepper.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.runtime.stepper/src/org/eclipse/tcf/te/runtime/stepper/stepper/Stepper.java
@@ -472,10 +472,10 @@ public class Stepper implements IStepper {
throw new CoreException(StatusHelper.getStatus(new OperationCanceledException()));
}
- CoreBundleActivator
- .getTraceHandler()
- .trace("Stepper#executeStepGroup: step group: '" + stepGroup.getLabel() + "'", //$NON-NLS-1$ //$NON-NLS-2$
- 0, ITraceIds.TRACE_STEPPING, IStatus.WARNING, this);
+ CoreBundleActivator.getTraceHandler().trace("Stepper#executeStepGroup: step group: '" //$NON-NLS-1$
+ + (stepGroup.getLabel() != null && !"".equals(stepGroup.getLabel().trim()) ? stepGroup.getLabel() : stepGroup.getId()) //$NON-NLS-1$
+ + "'", //$NON-NLS-1$
+ 0, ITraceIds.TRACE_STEPPING, IStatus.WARNING, this);
// Resolve the steps to execute
IStepGroupable[] groupables = stepGroup.getSteps(getContext());
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.core/plugin.xml b/target_explorer/plugins/org.eclipse.tcf.te.tcf.core/plugin.xml
index f4f218167..51feeedc9 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.core/plugin.xml
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.core/plugin.xml
@@ -37,12 +37,14 @@
id="org.eclipse.tcf.te.tcf.core.openChannelStep"
class="org.eclipse.tcf.te.tcf.core.steps.OpenChannelStep"
label="%OpenChannelStep.name"/>
+
<step
id="org.eclipse.tcf.te.tcf.core.closeChannelStep"
class="org.eclipse.tcf.te.tcf.core.steps.CloseChannelStep"
label="%CloseChannelStep.name">
<requires id="org.eclipse.tcf.te.tcf.core.openChannelStep"/>
</step>
+
<step
id="org.eclipse.tcf.te.tcf.core.shutDownStep"
class="org.eclipse.tcf.te.tcf.core.steps.ShutDownStep"
@@ -52,18 +54,22 @@
id="org.eclipse.tcf.te.tcf.core.channelmanager.launchValueAddStep"
class="org.eclipse.tcf.te.tcf.core.internal.channelmanager.steps.LaunchValueAddStep"
label="%LaunchValueAddStep.name"/>
+
<step
id="org.eclipse.tcf.te.tcf.core.channelmanager.chainPeerStep"
class="org.eclipse.tcf.te.tcf.core.internal.channelmanager.steps.ChainPeerStep"
label="%ChainPeerStep.name"/>
+
<step
id="org.eclipse.tcf.te.tcf.core.channelmanager.applyPathMapsStep"
class="org.eclipse.tcf.te.tcf.core.internal.channelmanager.steps.ApplyPathMapsStep"
label="%ApplyPatMapsStep.name"/>
+
<step
id="org.eclipse.tcf.te.tcf.core.channelmanager.closeChannelStep"
class="org.eclipse.tcf.te.tcf.core.internal.channelmanager.steps.CloseChannelStep"
label="%CloseChannelStep.name"/>
+
<step
id="org.eclipse.tcf.te.tcf.core.channelmanager.shutdownValueAddStep"
class="org.eclipse.tcf.te.tcf.core.internal.channelmanager.steps.ShutdownValueAddStep"
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.core/src/org/eclipse/tcf/te/tcf/core/internal/channelmanager/ChannelManager2.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.core/src/org/eclipse/tcf/te/tcf/core/internal/channelmanager/ChannelManager2.java
index a8d578cc3..279b44894 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.core/src/org/eclipse/tcf/te/tcf/core/internal/channelmanager/ChannelManager2.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.core/src/org/eclipse/tcf/te/tcf/core/internal/channelmanager/ChannelManager2.java
@@ -30,6 +30,7 @@ import org.eclipse.tcf.te.runtime.callback.Callback;
import org.eclipse.tcf.te.runtime.interfaces.callback.ICallback;
import org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer;
import org.eclipse.tcf.te.runtime.properties.PropertiesContainer;
+import org.eclipse.tcf.te.runtime.stepper.interfaces.IStepAttributes;
import org.eclipse.tcf.te.runtime.stepper.interfaces.IStepContext;
import org.eclipse.tcf.te.runtime.stepper.interfaces.IStepperOperationService;
import org.eclipse.tcf.te.runtime.stepper.job.StepperJob;
@@ -182,8 +183,11 @@ public class ChannelManager2 extends PlatformObject implements IChannelManager {
// Create the data properties container passed to the "open channel" steps
final IPropertiesContainer data = new PropertiesContainer();
+ // Set the flags to be passed to the "open channel" steps
data.setProperty(IChannelManager.FLAG_NO_VALUE_ADD, noValueAdd);
data.setProperty(IChannelManager.FLAG_NO_PATH_MAP, noPathMap);
+ // No recent action history persistence
+ data.setProperty(IStepAttributes.PROP_SKIP_LAST_RUN_HISTORY, true);
// Create the callback to be invoked once the "open channel" stepper job is completed
final ICallback callback = new Callback() {
@@ -322,9 +326,9 @@ public class ChannelManager2 extends PlatformObject implements IChannelManager {
IChannel channel = channels.get(id);
if (channel != null && !(channel.getState() == IChannel.STATE_OPEN || channel.getState() == IChannel.STATE_OPENING)) {
// Channel is not in open state -> drop the instance
- channel = null;
channels.remove(id);
refCounters.remove(channel);
+ channel = null;
}
return channel;
@@ -388,6 +392,10 @@ public class ChannelManager2 extends PlatformObject implements IChannelManager {
// Create the data properties container passed to the "close channel" steps
final IPropertiesContainer data = new PropertiesContainer();
+ // Set the channel to close
+ data.setProperty(ITcfStepAttributes.ATTR_CHANNEL, channel);
+ // No recent action history persistence
+ data.setProperty(IStepAttributes.PROP_SKIP_LAST_RUN_HISTORY, true);
// Create the callback to be invoked once the "close channel" stepper job is completed
final ICallback callback = new Callback() {
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.core/src/org/eclipse/tcf/te/tcf/core/internal/channelmanager/steps/CloseChannelStep.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.core/src/org/eclipse/tcf/te/tcf/core/internal/channelmanager/steps/CloseChannelStep.java
index d688256e6..99191b206 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.core/src/org/eclipse/tcf/te/tcf/core/internal/channelmanager/steps/CloseChannelStep.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.core/src/org/eclipse/tcf/te/tcf/core/internal/channelmanager/steps/CloseChannelStep.java
@@ -12,7 +12,6 @@ package org.eclipse.tcf.te.tcf.core.internal.channelmanager.steps;
import org.eclipse.core.runtime.Assert;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.tcf.protocol.IChannel;
import org.eclipse.tcf.protocol.Protocol;
@@ -21,7 +20,6 @@ import org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer;
import org.eclipse.tcf.te.runtime.stepper.StepperAttributeUtil;
import org.eclipse.tcf.te.runtime.stepper.interfaces.IFullQualifiedId;
import org.eclipse.tcf.te.runtime.stepper.interfaces.IStepContext;
-import org.eclipse.tcf.te.tcf.core.activator.CoreBundleActivator;
import org.eclipse.tcf.te.tcf.core.interfaces.steps.ITcfStepAttributes;
import org.eclipse.tcf.te.tcf.core.steps.AbstractPeerStep;
@@ -35,15 +33,6 @@ public class CloseChannelStep extends AbstractPeerStep {
*/
@Override
public void validateExecute(IStepContext context, IPropertiesContainer data, IFullQualifiedId fullQualifiedId, IProgressMonitor monitor) throws CoreException {
- Assert.isNotNull(context);
- Assert.isNotNull(data);
- Assert.isNotNull(fullQualifiedId);
- Assert.isNotNull(monitor);
-
- IChannel channel = (IChannel)StepperAttributeUtil.getProperty(ITcfStepAttributes.ATTR_CHANNEL, fullQualifiedId, data);
- if (channel == null) {
- throw new CoreException(new Status(IStatus.ERROR, CoreBundleActivator.getUniqueIdentifier(), "Channel to target not available.")); //$NON-NLS-1$
- }
}
/* (non-Javadoc)
@@ -58,12 +47,11 @@ public class CloseChannelStep extends AbstractPeerStep {
Assert.isNotNull(callback);
final IChannel channel = (IChannel)StepperAttributeUtil.getProperty(ITcfStepAttributes.ATTR_CHANNEL, fullQualifiedId, data);
- Assert.isNotNull(channel);
Runnable runnable = new Runnable() {
@Override
public void run() {
- if (channel.getState() != IChannel.STATE_CLOSED) channel.close();
+ if (channel != null && channel.getState() != IChannel.STATE_CLOSED) channel.close();
callback(data, fullQualifiedId, callback, Status.OK_STATUS, null);
}
};

Back to the top