Author: xcoulon
Date: 2011-11-28 12:14:32 -0500 (Mon, 28 Nov 2011)
New Revision: 36708
Modified:
trunk/openshift/plugins/org.jboss.tools.openshift.express.client/org.jboss.tools.openshift.express.client-2.3.0-SNAPSHOT.jar
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationWizardModel.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/NewApplicationWizardPage.java
Log:
Resolved JBIDE-9929 Check if the newly created DNS entry actually starts responding a few
times before giving control back to user
https://issues.jboss.org/browse/JBIDE-9929
Modified:
trunk/openshift/plugins/org.jboss.tools.openshift.express.client/org.jboss.tools.openshift.express.client-2.3.0-SNAPSHOT.jar
===================================================================
(Binary files differ)
Modified:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationWizardModel.java
===================================================================
---
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationWizardModel.java 2011-11-28
16:58:13 UTC (rev 36707)
+++
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ApplicationWizardModel.java 2011-11-28
17:14:32 UTC (rev 36708)
@@ -10,6 +10,8 @@
******************************************************************************/
package org.jboss.tools.openshift.express.internal.ui.wizard;
+import java.net.MalformedURLException;
+
import org.jboss.tools.common.ui.databinding.ObservableUIPojo;
import org.jboss.tools.openshift.express.client.IApplication;
import org.jboss.tools.openshift.express.client.ICartridge;
@@ -23,6 +25,12 @@
public static final String PROPERTY_APPLICATION = "application";
+ /**
+ * Timeout in seconds when trying to contact an application after it had
+ * been created.
+ */
+ private static final int APP_CREATION_TIMEOUT = 10;
+
private IUser user;
private IApplication application;
private String name;
@@ -40,7 +48,7 @@
public IUser getUser() {
return user;
}
-
+
public String getName() {
return name;
}
@@ -48,14 +56,20 @@
public String setName(String name) {
return this.name = name;
}
-
+
public void setCartridge(ICartridge cartridge) {
this.cartridge = cartridge;
}
public void createApplication() throws OpenShiftException {
IApplication application = createApplication(name, cartridge);
- setApplication(application);
+ final boolean isApplicationAvailable =
application.waitForAccessible(APP_CREATION_TIMEOUT * 1000);
+ if (isApplicationAvailable) {
+ setApplication(application);
+ } else {
+ throw new OpenShiftException("The URL {0} did not respond within {1}s after the
application creation.",
+ application.getApplicationUrl(), APP_CREATION_TIMEOUT);
+ }
}
public void setApplication(IApplication application) {
@@ -65,11 +79,11 @@
public IApplication getApplication() {
return application;
}
-
+
public IApplication createApplication(String name, ICartridge cartridge) throws
OpenShiftException {
return getUser().createApplication(name, cartridge);
}
-
+
public boolean hasApplication(String name) throws OpenShiftException {
return user.hasApplication(name);
}
Modified:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/NewApplicationWizardPage.java
===================================================================
---
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/NewApplicationWizardPage.java 2011-11-28
16:58:13 UTC (rev 36707)
+++
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/NewApplicationWizardPage.java 2011-11-28
17:14:32 UTC (rev 36708)
@@ -174,7 +174,7 @@
return Status.OK_STATUS;
} catch (OpenShiftException e) {
applicationCreated.offer(false);
- return OpenShiftUIActivator.createErrorStatus("Could not create application
\"{0}\"", e,
+ return OpenShiftUIActivator.createErrorStatus("Could not create application
\"{0}\"", (Throwable)e,
wizardModel.getName());
}
}