1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-03 15:15:25 +02:00

[231126] [dstore] status monitor needs to reset WaitThreshold on nudge

This commit is contained in:
David McKnight 2008-05-08 13:21:04 +00:00
parent 38da2bc7c5
commit 6111d56772
3 changed files with 14 additions and 4 deletions

View file

@ -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)
{

View file

@ -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)
{

View file

@ -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;
}
}
}