Author: rob.stryker(a)jboss.com
Date: 2011-01-05 15:39:26 -0500 (Wed, 05 Jan 2011)
New Revision: 27924
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.integration/src/org/jboss/tools/deltacloud/integration/rse/util/RSEUtils.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.integration/src/org/jboss/tools/deltacloud/integration/wizard/CreateRSEFromInstanceJob.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.integration/src/org/jboss/tools/deltacloud/integration/wizard/RSEandASWizardPage.java
Log:
JBIDE-7889 delay and wait for ssh port to come up
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.integration/src/org/jboss/tools/deltacloud/integration/rse/util/RSEUtils.java
===================================================================
---
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.integration/src/org/jboss/tools/deltacloud/integration/rse/util/RSEUtils.java 2011-01-05
20:30:14 UTC (rev 27923)
+++
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.integration/src/org/jboss/tools/deltacloud/integration/rse/util/RSEUtils.java 2011-01-05
20:39:26 UTC (rev 27924)
@@ -96,6 +96,38 @@
return services[0];
}
+ public static IStatus connect(IConnectorService service, IProgressMonitor monitor)
throws Exception {
+ monitor.worked(1);
+ service.connect(monitor);
+ monitor.done();
+ return Status.OK_STATUS;
+ }
+
+ public static IStatus connect(IConnectorService service, int timeout, IProgressMonitor
monitor) {
+ monitor.beginTask("Connecting to remote server", timeout);
+ monitor.setTaskName("Connecting to remote server");
+ IStatus status = null;
+ int count = 0;
+ while( status == null && count < timeout) {
+ try {
+ status = connect(service, monitor);
+ monitor.done();
+ return status;
+ } catch(Exception e) {
+ System.out.println("Exception " + e.getMessage() + " at timeout "
+ count);
+ count += 1000;
+ monitor.worked(1000);
+ try {
+ Thread.sleep(1000);
+ } catch(InterruptedException ie) {
+ }
+ }
+ }
+ monitor.done();
+ return status;
+ }
+
+
public static Job connect(String connectionName, final IConnectorService service)
throws Exception {
// TODO: internationalize strings
@@ -107,11 +139,9 @@
@Override
protected IStatus run(IProgressMonitor monitor) {
try {
- monitor.worked(1);
- service.connect(monitor);
- monitor.done();
- return Status.OK_STATUS;
- } catch (Exception e) {
+ return connect(service, monitor);
+ } catch(Exception e) {
+ e.printStackTrace();
// odd behavior: service reports connection failure even if things seem to work
(view opens up with connection in it)
// ignore errors since things work
//
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.integration/src/org/jboss/tools/deltacloud/integration/wizard/CreateRSEFromInstanceJob.java
===================================================================
---
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.integration/src/org/jboss/tools/deltacloud/integration/wizard/CreateRSEFromInstanceJob.java 2011-01-05
20:30:14 UTC (rev 27923)
+++
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.integration/src/org/jboss/tools/deltacloud/integration/wizard/CreateRSEFromInstanceJob.java 2011-01-05
20:39:26 UTC (rev 27924)
@@ -13,11 +13,13 @@
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.SubProgressMonitor;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.core.runtime.preferences.InstanceScope;
import org.eclipse.osgi.util.NLS;
import org.eclipse.rse.core.model.IHost;
import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.internal.progress.ProgressManagerUtil;
import org.jboss.tools.deltacloud.core.DeltaCloudInstance;
import org.jboss.tools.deltacloud.core.job.AbstractInstanceJob;
import org.jboss.tools.deltacloud.integration.Messages;
@@ -45,6 +47,7 @@
String hostname = RSEUtils.createHostName(instance);
if (hostname != null && hostname.length() > 0 && isAutoconnect()) {
try {
+ monitor.beginTask("Create RSE Server", 100);
String connectionName = RSEUtils.createConnectionName(instance);
IHost host = RSEUtils.createHost(connectionName,
RSEUtils.createHostName(instance),
@@ -53,7 +56,10 @@
if( nextJob2 != null && nextJob2 instanceof CreateServerFromRSEJob) {
((CreateServerFromRSEJob)nextJob2).setHost(host);
}
- RSEUtils.connect(connectionName, RSEUtils.getConnectorService(host));
+ monitor.worked(10);
+
+ SubProgressMonitor submon = new SubProgressMonitor(monitor, 90);
+ RSEUtils.connect(RSEUtils.getConnectorService(host), 90000, submon);
} catch (Exception e) {
return ErrorUtils.handleError(Messages.ERROR,
NLS.bind(Messages.COULD_NOT_LAUNCH_RSE_EXPLORER2, instance.getName()),
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.integration/src/org/jboss/tools/deltacloud/integration/wizard/RSEandASWizardPage.java
===================================================================
---
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.integration/src/org/jboss/tools/deltacloud/integration/wizard/RSEandASWizardPage.java 2011-01-05
20:30:14 UTC (rev 27923)
+++
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.integration/src/org/jboss/tools/deltacloud/integration/wizard/RSEandASWizardPage.java 2011-01-05
20:39:26 UTC (rev 27924)
@@ -216,9 +216,10 @@
private void refreshServerWidgets() {
boolean enabled = createServer.getSelection();
- boolean enabled2 = false;
serverDetailsGroup.setEnabled(enabled);
autoScanCheck.setEnabled(enabled);
+ autoLocalRuntimeLabel.setEnabled(enabled);
+ autoLocalRuntimeCombo.setEnabled(enabled);
remoteDetailsLoc.setEnabled(enabled);
hardCodeServerDetails.setEnabled(enabled);
serverHomeText.setEnabled(enabled);
Show replies by date