diff options
Diffstat (limited to 'target_explorer/plugins/org.eclipse.tcf.te.tcf.core/src/org/eclipse/tcf/te/tcf/core/internal')
2 files changed, 10 insertions, 14 deletions
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); } }; |