Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorashi2017-10-11 05:47:09 -0400
committerashi2017-10-11 05:47:09 -0400
commit1212357315305f210050227d00fae5cc66d5d493 (patch)
tree1d0d877de064e096b8212ac4b1178edca512ce30 /target_explorer
parent582abf60995effca6e064a4b6eac7d2a195b02dc (diff)
downloadorg.eclipse.tcf-1212357315305f210050227d00fae5cc66d5d493.tar.gz
org.eclipse.tcf-1212357315305f210050227d00fae5cc66d5d493.tar.xz
org.eclipse.tcf-1212357315305f210050227d00fae5cc66d5d493.zip
Bug 525789 - provide parameter for setting recover connection times.
Change-Id: Iefbb0d80df35dca45f97d704c51e30c7b77f3616 Signed-off-by: ashi <Aijun.Shi@windriver.com>
Diffstat (limited to 'target_explorer')
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/steps/WaitForReadyStep.java29
1 files changed, 25 insertions, 4 deletions
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/steps/WaitForReadyStep.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/steps/WaitForReadyStep.java
index bba26ec89..bbac8e7a4 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/steps/WaitForReadyStep.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/src/org/eclipse/tcf/te/tcf/locator/steps/WaitForReadyStep.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2013, 2015 Wind River Systems, Inc. and others. All rights reserved.
+ * Copyright (c) 2013, 2015, 2017 Wind River Systems, Inc. and others. All rights reserved.
* This program and the accompanying materials are made available under the terms
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html
@@ -47,6 +47,7 @@ import org.eclipse.tcf.te.tcf.locator.utils.SimulatorUtils;
public class WaitForReadyStep extends AbstractPeerNodeStep {
public static final String PARAMETER_NO_TIMEOUT = "noTimeout"; //$NON-NLS-1$
+ public static final String PARAMETER_REPEAT_TIMES = "repeatTimes"; //$NON-NLS-1$
/**
* Constructor.
@@ -77,16 +78,36 @@ public class WaitForReadyStep extends AbstractPeerNodeStep {
catch (Exception e) {
}
}
- final boolean noTimeout = paramBool;
+ final boolean noTimeout;
+ final int repeatTimes;
+
+ String repeatTimesParam = System.getProperty(getClass().getSimpleName() + "_" + PARAMETER_REPEAT_TIMES); //$NON-NLS-1$
+ if (repeatTimesParam == null) repeatTimesParam = getParameters().get(PARAMETER_REPEAT_TIMES);
+ int repeatTimesInt = 0;
+ if (repeatTimesParam != null) {
+ try {
+ repeatTimesInt = Integer.parseInt(repeatTimesParam);
+ }
+ catch (Exception e) {
+ }
+ }
+ if (repeatTimesInt > 0) {
+ noTimeout = false;
+ repeatTimes = repeatTimesInt;
+ } else {
+ noTimeout = paramBool;
+ /* Default Value: 10 times (means reconnect try 10 times) */
+ repeatTimes = 10;
+ }
if (peerNode != null && !Boolean.getBoolean("WaitForReadyStep.skip")) { //$NON-NLS-1$
Protocol.invokeLater(new Runnable() {
final Runnable thisRunnable = this;
- // set repeat count to 1 if real target is used
+ // set repeat count to 'repeatTimes' if real target is used
int totalWork = getTotalWork(context, data);
SimulatorUtils.Result result = SimulatorUtils.getSimulatorService(getActivePeerModelContext(context, data, fullQualifiedId));
final boolean isSimulatorRunning = result != null;
- int refreshCount = isSimulatorRunning ? 0 : totalWork-1;
+ int refreshCount = isSimulatorRunning ? 0 : totalWork-repeatTimes-1;
final AtomicReference<Throwable> lastError = new AtomicReference<Throwable>();
@Override

Back to the top