Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUwe Stieber2014-07-28 05:28:57 -0400
committerUwe Stieber2014-07-28 05:28:57 -0400
commit6f9b8bac254e4b2220295d10d60e105cf367931f (patch)
treea956ccd09477c9adccb147adf8d810ad2693e938
parent7f5303b5c89506a5947abea577cf78527d63f09f (diff)
downloadorg.eclipse.tcf-6f9b8bac254e4b2220295d10d60e105cf367931f.tar.gz
org.eclipse.tcf-6f9b8bac254e4b2220295d10d60e105cf367931f.tar.xz
org.eclipse.tcf-6f9b8bac254e4b2220295d10d60e105cf367931f.zip
Target Explorer: Remember running channel open jobs only for shared channels
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.core/src/org/eclipse/tcf/te/tcf/core/internal/channelmanager/ChannelManager.java26
1 files changed, 14 insertions, 12 deletions
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.core/src/org/eclipse/tcf/te/tcf/core/internal/channelmanager/ChannelManager.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.core/src/org/eclipse/tcf/te/tcf/core/internal/channelmanager/ChannelManager.java
index 8764c8380..e02d7c675 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.core/src/org/eclipse/tcf/te/tcf/core/internal/channelmanager/ChannelManager.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.core/src/org/eclipse/tcf/te/tcf/core/internal/channelmanager/ChannelManager.java
@@ -179,7 +179,7 @@ public class ChannelManager extends PlatformObject implements IChannelManager {
// Channel not available -> open a new one
if (channel == null) {
// Check if there is a pending "open channel" stepper job
- StepperJob job = pendingOpenChannel.get(id);
+ StepperJob job = !forceNew ? pendingOpenChannel.get(id) : null;
if (job == null) {
// No pending "open channel" stepper job -> schedule one and initiate opening the channel
if (CoreBundleActivator.getTraceHandler().isSlotEnabled(0, ITraceIds.TRACE_CHANNEL_MANAGER)) {
@@ -210,8 +210,8 @@ public class ChannelManager extends PlatformObject implements IChannelManager {
0, ITraceIds.TRACE_CHANNEL_MANAGER, IStatus.INFO, ChannelManager.this);
}
- // Job is done -> remove it from the list of pending jobs
- pendingOpenChannel.remove(id);
+ // Job is done -> remove it from the list of pending jobs (shared channels only)
+ if (!finForceNew) pendingOpenChannel.remove(id);
// Invoke the primary "open channel" done callback
internalDone.doneOpenChannel(error, null);
@@ -235,8 +235,8 @@ public class ChannelManager extends PlatformObject implements IChannelManager {
if (finForceNew) forcedChannels.add(channel);
if (finForceNew) forcedChannelFlags.put(channel, flags);
- // Job is done -> remove it from the list of pending jobs
- pendingOpenChannel.remove(id);
+ // Job is done -> remove it from the list of pending jobs (shared channels only)
+ if (!finForceNew) pendingOpenChannel.remove(id);
if (CoreBundleActivator.getTraceHandler().isSlotEnabled(0, ITraceIds.TRACE_CHANNEL_MANAGER)) {
CoreBundleActivator.getTraceHandler().trace(NLS.bind(Messages.ChannelManager_openChannel_success_message, id),
@@ -246,11 +246,13 @@ public class ChannelManager extends PlatformObject implements IChannelManager {
// Invoke the primary "open channel" done callback
internalDone.doneOpenChannel(null, channel);
- // Invoke pending callback's
- List<DoneOpenChannel> pending = pendingDones.remove(id);
- if (pending != null && !pending.isEmpty()) {
- for (DoneOpenChannel d : pending) {
- d.doneOpenChannel(null, channel);
+ // Invoke pending callback's (shared channels only)
+ if (!finForceNew) {
+ List<DoneOpenChannel> pending = pendingDones.remove(id);
+ if (pending != null && !pending.isEmpty()) {
+ for (DoneOpenChannel d : pending) {
+ d.doneOpenChannel(null, channel);
+ }
}
}
}
@@ -274,8 +276,8 @@ public class ChannelManager extends PlatformObject implements IChannelManager {
job.schedule();
}
- // Remember the "open channel" stepper job until finished
- if (job != null) {
+ // Remember the "open channel" stepper job until finished (shared channels only)
+ if (job != null && !forceNew) {
pendingOpenChannel.put(id, job);
}
} else {

Back to the top