Author: adietish
Date: 2012-05-25 15:09:56 -0400 (Fri, 25 May 2012)
New Revision: 41437
Modified:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/job/AbstractDelegatingMonitorJob.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/job/CreateApplicationJob.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/job/WaitForApplicationJob.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/OpenShiftExpressApplicationWizard.java
Log:
[JBIDE-11314] added error dialog to report that operation timeouted
Modified:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/job/AbstractDelegatingMonitorJob.java
===================================================================
---
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/job/AbstractDelegatingMonitorJob.java 2012-05-25
18:01:49 UTC (rev 41436)
+++
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/job/AbstractDelegatingMonitorJob.java 2012-05-25
19:09:56 UTC (rev 41437)
@@ -20,6 +20,8 @@
*/
public abstract class AbstractDelegatingMonitorJob extends Job {
+ public static final int TIMEOUTED_CANCELLED = 1;
+
protected DelegatingProgressMonitor delegatingMonitor;
public AbstractDelegatingMonitorJob(String name) {
Modified:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/job/CreateApplicationJob.java
===================================================================
---
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/job/CreateApplicationJob.java 2012-05-25
18:01:49 UTC (rev 41436)
+++
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/job/CreateApplicationJob.java 2012-05-25
19:09:56 UTC (rev 41437)
@@ -37,8 +37,6 @@
*/
public class CreateApplicationJob extends AbstractDelegatingMonitorJob {
- public static final int TIMEOUTED_CANCELLED = 1;
-
private UserDelegate user;
private String name;
private ICartridge cartridge;
Modified:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/job/WaitForApplicationJob.java
===================================================================
---
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/job/WaitForApplicationJob.java 2012-05-25
18:01:49 UTC (rev 41436)
+++
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/job/WaitForApplicationJob.java 2012-05-25
19:09:56 UTC (rev 41437)
@@ -32,9 +32,8 @@
*/
public class WaitForApplicationJob extends AbstractDelegatingMonitorJob {
- public static final int TIMEOUTED_CANCELLED = 1;
-
- private static final int APP_REACHABLE_TIMEOUT = 180 * 1000;
+ private static final int APP_REACHABLE_TIMEOUT = 1 * 60 * 1000;
+
private IApplication application;
private Shell shell;
Modified:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/OpenShiftExpressApplicationWizard.java
===================================================================
---
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/OpenShiftExpressApplicationWizard.java 2012-05-25
18:01:49 UTC (rev 41436)
+++
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/OpenShiftExpressApplicationWizard.java 2012-05-25
19:09:56 UTC (rev 41437)
@@ -145,26 +145,19 @@
if (!useExistingApp) {
IStatus status = createApplication();
- if (JobUtils.isCancel(status)
- && CreateApplicationJob.TIMEOUTED_CANCELLED == status.getCode()) {
- getContainer().getShell().close();
- } else if (!JobUtils.isOk(status)) {
- safeRefreshUser();
+ if(!processStatus("Creating the application", status)) {
return false;
}
-
+
status = waitForApplication(wizardModel.getApplication());
- if (JobUtils.isCancel(status)
- && WaitForApplicationJob.TIMEOUTED_CANCELLED == status.getCode()) {
- getContainer().getShell().close();
- } else if (!JobUtils.isOk(status)) {
- safeRefreshUser();
+ if(!processStatus("Waiting to become reachable", status)) {
return false;
}
-
+
if (!addRemoveCartridges(
- getWizardModel().getApplication(),
getWizardModel().getSelectedEmbeddableCartridges())) {
- return false;
+ getWizardModel().getApplication(),
+ getWizardModel().getSelectedEmbeddableCartridges())) {
+ return false;
}
}
@@ -176,6 +169,26 @@
return useExistingApp;
}
+ private boolean processStatus(String operation, IStatus status) {
+ if (JobUtils.isCancel(status)) {
+ if (AbstractDelegatingMonitorJob.TIMEOUTED_CANCELLED == status.getCode()) {
+ getContainer().getShell().close();
+ } else {
+ new ErrorDialog(getShell(),
+ NLS.bind("{0} was cancelled", operation),
+ NLS.bind("{0} timeouted and was canceled", operation),
+ status,
+ IStatus.ERROR | IStatus.WARNING | IStatus.CANCEL | IStatus.INFO)
+ .open();
+ return true;
+ }
+ } else if (!JobUtils.isOk(status)) {
+ safeRefreshUser();
+ return false;
+ }
+ return true;
+ }
+
private IStatus waitForApplication(IApplication application) {
try {
AbstractDelegatingMonitorJob job = new WaitForApplicationJob(application,
getShell());
Show replies by date