From 6111d5677285fd72ae4c272cfce13f0c61c52646 Mon Sep 17 00:00:00 2001 From: David McKnight Date: Thu, 8 May 2008 13:21:04 +0000 Subject: [PATCH] [231126] [dstore] status monitor needs to reset WaitThreshold on nudge --- .../rse/connectorservice/dstore/util/StatusMonitor.java | 8 ++++++-- .../rse/services/dstore/util/DStoreStatusMonitor.java | 5 ++++- .../rse/services/dstore/util/DownloadListener.java | 5 ++++- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/rse/plugins/org.eclipse.rse.connectorservice.dstore/src/org/eclipse/rse/connectorservice/dstore/util/StatusMonitor.java b/rse/plugins/org.eclipse.rse.connectorservice.dstore/src/org/eclipse/rse/connectorservice/dstore/util/StatusMonitor.java index 62d926de47c..10d6c013e4e 100644 --- a/rse/plugins/org.eclipse.rse.connectorservice.dstore/src/org/eclipse/rse/connectorservice/dstore/util/StatusMonitor.java +++ b/rse/plugins/org.eclipse.rse.connectorservice.dstore/src/org/eclipse/rse/connectorservice/dstore/util/StatusMonitor.java @@ -14,7 +14,8 @@ * Contributors: * Martin Oberhuber (Wind River) - [168870] refactor org.eclipse.rse.core package of the UI plugin * David McKnight (IBM) - [225902] [dstore] use C_NOTIFICATION command to wake up the server - * David McKnight (IBM) - [229947] [dstore] [dstore] interruption to Thread.sleep() should not stop waitForUpdate() + * David McKnight (IBM) - [229947] [dstore] interruption to Thread.sleep() should not stop waitForUpdate() + * David McKnight (IBM) - [231126] [dstore] status monitor needs to reset WaitThreshold on nudge *******************************************************************************/ package org.eclipse.rse.connectorservice.dstore.util; @@ -286,7 +287,8 @@ public class StatusMonitor implements IDomainListener, ICommunicationsListener Display display = Display.getCurrent(); // Prevent infinite looping by introducing a threshold for wait - int WaitThreshold = 50; //default. sleep(100ms) for 600 times + final int initialWaitThreshold = 50; + int WaitThreshold = initialWaitThreshold; if ( wait > 0 ) WaitThreshold = wait*10; // 1 second means 10 sleep(100ms) else if ( wait == -1 ) // force a diagnostic @@ -341,6 +343,7 @@ public class StatusMonitor implements IDomainListener, ICommunicationsListener return status; // returning the undone status object nudges++; + WaitThreshold = initialWaitThreshold; } else if (_networkDown) { @@ -395,6 +398,7 @@ public class StatusMonitor implements IDomainListener, ICommunicationsListener return status; // returning the undone status object nudges++; + WaitThreshold = initialWaitThreshold; } else if (_networkDown) { diff --git a/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/services/dstore/util/DStoreStatusMonitor.java b/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/services/dstore/util/DStoreStatusMonitor.java index 84e5cf4a5ab..24f135ad42a 100644 --- a/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/services/dstore/util/DStoreStatusMonitor.java +++ b/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/services/dstore/util/DStoreStatusMonitor.java @@ -17,6 +17,7 @@ * David McKnight (IBM) - [197480] eliminating UI dependencies * David McKnight (IBM) - [209593] [api] check for existing query to avoid duplicates * David McKnight (IBM) - [225902] [dstore] use C_NOTIFICATION command to wake up the server + * David McKnight (IBM) - [231126] [dstore] status monitor needs to reset WaitThreshold on nudge *******************************************************************************/ package org.eclipse.rse.services.dstore.util; @@ -254,7 +255,8 @@ public class DStoreStatusMonitor implements IDomainListener // Prevent infinite looping by introducing a threshold for wait - int WaitThreshold = 50; //default. sleep(100ms) for 60 times + final int initialWaitThreshold = 50; + int WaitThreshold = initialWaitThreshold; if ( wait > 0 ) WaitThreshold = wait*10; // 1 second means 10 sleep(100ms) else if ( wait == -1 ) // force a diagnostic @@ -296,6 +298,7 @@ public class DStoreStatusMonitor implements IDomainListener return status; // returning the undone status object nudges++; + WaitThreshold = initialWaitThreshold; } else if (_networkDown) { diff --git a/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/services/dstore/util/DownloadListener.java b/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/services/dstore/util/DownloadListener.java index 8f8e4c4d22c..ca42c0a566c 100644 --- a/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/services/dstore/util/DownloadListener.java +++ b/rse/plugins/org.eclipse.rse.services.dstore/src/org/eclipse/rse/services/dstore/util/DownloadListener.java @@ -18,6 +18,7 @@ * Martin Oberhuber (Wind River) - [219952] Use MessageFormat for download progress message * David McKnight (IBM) - [222448] [dstore] update DownloadListener to handle timeouts and nudge * David McKnight (IBM) - [225902] [dstore] use C_NOTIFICATION command to wake up the server + * David McKnight (IBM) - [231126] [dstore] status monitor needs to reset WaitThreshold on nudge ********************************************************************************/ package org.eclipse.rse.services.dstore.util; @@ -234,7 +235,8 @@ public class DownloadListener implements IDomainListener public DataElement waitForUpdate(int wait) throws InterruptedException { // Prevent infinite looping by introducing a threshold for wait - int WaitThreshold = 50; //default. sleep(100ms) for 150 times + final int initialWaitTheshold = 50; + int WaitThreshold = initialWaitTheshold; if (wait > 0) WaitThreshold = wait * 10; // 1 second means 10 sleep(100ms) @@ -275,6 +277,7 @@ public class DownloadListener implements IDomainListener { // try to wake up the server wakeupServer(_status); + WaitThreshold = initialWaitTheshold; } } }