Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkchong2012-04-10 21:46:34 +0000
committerkchong2012-04-10 21:46:34 +0000
commit8e4dd82ac4225b54bb514a6e70ea980c8ad11c97 (patch)
treedaebaf24c7518d438102ea945717d22421e0055c
parentff6869c646587237cfd20f736c700222337538cf (diff)
downloadwebtools.webservices-8e4dd82ac4225b54bb514a6e70ea980c8ad11c97.tar.gz
webtools.webservices-8e4dd82ac4225b54bb514a6e70ea980c8ad11c97.tar.xz
webtools.webservices-8e4dd82ac4225b54bb514a6e70ea980c8ad11c97.zip
[376346] Stability improvements to web services commands/operations
-rw-r--r--bundles/org.eclipse.jst.ws.axis.consumption.ui/META-INF/MANIFEST.MF2
-rw-r--r--bundles/org.eclipse.jst.ws.axis.consumption.ui/src/org/eclipse/jst/ws/internal/axis/consumption/ui/task/ClientCodeGenOperation.java67
-rw-r--r--bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/command/BUCodeGenOperation.java11
-rw-r--r--bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/command/TDCodeGenOperation.java98
-rw-r--r--bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/task/Skeleton2WSDLCommand.java6
-rw-r--r--bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/test/wssample/GSTCGenerateCommand.java12
-rw-r--r--bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/command/common/BuildProjectCommand.java32
7 files changed, 156 insertions, 72 deletions
diff --git a/bundles/org.eclipse.jst.ws.axis.consumption.ui/META-INF/MANIFEST.MF b/bundles/org.eclipse.jst.ws.axis.consumption.ui/META-INF/MANIFEST.MF
index bf3840268..7ef9e8108 100644
--- a/bundles/org.eclipse.jst.ws.axis.consumption.ui/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.jst.ws.axis.consumption.ui/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %PLUGIN_NAME
Bundle-SymbolicName: org.eclipse.jst.ws.axis.consumption.ui; singleton:=true
-Bundle-Version: 1.0.505.qualifier
+Bundle-Version: 1.0.600.qualifier
Bundle-Activator: org.eclipse.jst.ws.internal.axis.consumption.ui.plugin.WebServiceAxisConsumptionUIPlugin
Bundle-Vendor: %PLUGIN_PROVIDER
Bundle-Localization: plugin
diff --git a/bundles/org.eclipse.jst.ws.axis.consumption.ui/src/org/eclipse/jst/ws/internal/axis/consumption/ui/task/ClientCodeGenOperation.java b/bundles/org.eclipse.jst.ws.axis.consumption.ui/src/org/eclipse/jst/ws/internal/axis/consumption/ui/task/ClientCodeGenOperation.java
index f8dcdf1a5..d748a6d15 100644
--- a/bundles/org.eclipse.jst.ws.axis.consumption.ui/src/org/eclipse/jst/ws/internal/axis/consumption/ui/task/ClientCodeGenOperation.java
+++ b/bundles/org.eclipse.jst.ws.axis.consumption.ui/src/org/eclipse/jst/ws/internal/axis/consumption/ui/task/ClientCodeGenOperation.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2008 IBM Corporation and others.
+ * Copyright (c) 2006, 2012 IBM Corporation 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
@@ -15,6 +15,7 @@
* 20080603 235367 makandre@ca.ibm.com - Andrew Mak, "IWAB0014E Unexpected exception occurred" from ant task for web service client generation
* 20080626 229867 makandre@ca.ibm.com - Andrew Mak, Missing method in generated proxy class
* 20080709 240225 kathy@ca.ibm.com - Kathy Chan
+ * 20120409 376345 yenlu@ca.ibm.com, kchong@ca.ibm.com - Stability improvements to web services commands/operations
*******************************************************************************/
package org.eclipse.jst.ws.internal.axis.consumption.ui.task;
@@ -26,6 +27,8 @@ import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.jst.ws.internal.axis.consumption.core.command.WSDL2JavaCommand;
import org.eclipse.jst.ws.internal.axis.consumption.core.common.JavaWSDLParameter;
+import org.eclipse.jst.ws.internal.axis.consumption.ui.plugin.WebServiceAxisConsumptionUIPlugin;
+import org.eclipse.jst.ws.internal.consumption.command.common.BuildProjectCommand;
import org.eclipse.ui.actions.WorkspaceModifyOperation;
import org.eclipse.wst.common.environment.IEnvironment;
import org.eclipse.wst.common.frameworks.datamodel.AbstractDataModelOperation;
@@ -59,18 +62,57 @@ public class ClientCodeGenOperation extends AbstractDataModelOperation {
public IStatus execute(IProgressMonitor monitor, IAdaptable info) {
IEnvironment env = getEnvironment();
- ClientWSModifyOperation buOperation = new ClientWSModifyOperation(info, env);
+ ClientWSModifyOperation clientOperation = new ClientWSModifyOperation(info, env);
try {
- buOperation.execute(monitor);
+ clientOperation.run(monitor);
+
+ //project.build(IncrementalProjectBuilder.INCREMENTAL_BUILD, monitor);
+ BuildProjectCommand buildCommand = new BuildProjectCommand();
+ buildCommand.setProject(project);
+ buildCommand.setEnvironment(env);
+ buildCommand.setForceBuild(true);
+ buildCommand.execute(monitor, info);
+
+ GenProxyBeanOperation genProxyBeanOperation = new GenProxyBeanOperation(info, env);
+ genProxyBeanOperation.run(monitor);
+
}
- catch(CoreException ce){
- IStatus status = ce.getStatus();
+ catch(Exception e){
+ IStatus status = new Status(IStatus.ERROR, WebServiceAxisConsumptionUIPlugin.ID, e.getMessage(), e);
return status;
}
return Status.OK_STATUS;
}
+ private class GenProxyBeanOperation extends WorkspaceModifyOperation
+ {
+ private IAdaptable info = null;
+ private IEnvironment env = null;
+
+ protected GenProxyBeanOperation(IAdaptable adaptable, IEnvironment environment)
+ {
+ //super(project);
+ info = adaptable;
+ env = environment;
+ }
+
+ protected void execute(IProgressMonitor monitor) throws CoreException
+ {
+ // Stub2BeanCommand
+ stub2BeanCommand.setEnvironment(env);
+ stub2BeanCommand.setWebServicesParser(webServicesParser);
+ stub2BeanCommand.setOutputFolder(outputFolder);
+ stub2BeanCommand.setJavaWSDLParam(javaWSDLParam);
+ stub2BeanCommand.setClientProject(project);
+ IStatus status = stub2BeanCommand.execute(monitor, info);
+ if (status.getSeverity() == Status.ERROR) {
+ throw new CoreException(status);
+ }
+ proxyBean = stub2BeanCommand.getProxyBean();
+ proxyEndpoint = stub2BeanCommand.getProxyEndpoint();
+ }
+ }
private class ClientWSModifyOperation extends WorkspaceModifyOperation {
@@ -103,20 +145,7 @@ public class ClientCodeGenOperation extends AbstractDataModelOperation {
if (status.getSeverity() == Status.ERROR) {
throw new CoreException(status);
}
-
- // Stub2BeanCommand
- stub2BeanCommand.setEnvironment(env);
- stub2BeanCommand.setWebServicesParser(webServicesParser);
- stub2BeanCommand.setOutputFolder(outputFolder);
- stub2BeanCommand.setJavaWSDLParam(javaWSDLParam);
- stub2BeanCommand.setClientProject(project);
- status = stub2BeanCommand.execute(monitor, info);
- if (status.getSeverity() == Status.ERROR) {
- throw new CoreException(status);
- }
- proxyBean = stub2BeanCommand.getProxyBean();
- proxyEndpoint = stub2BeanCommand.getProxyEndpoint();
-
+
// RefreshProjectCommand
refreshProjectCommand.setEnvironment(env);
refreshProjectCommand.setProject(project);
diff --git a/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/command/BUCodeGenOperation.java b/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/command/BUCodeGenOperation.java
index 540bc93c5..6eb7894ec 100644
--- a/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/command/BUCodeGenOperation.java
+++ b/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/command/BUCodeGenOperation.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2010 IBM Corporation and others.
+ * Copyright (c) 2006, 2012 IBM Corporation 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
@@ -14,6 +14,7 @@
* 20060515 115225 sengpl@ca.ibm.com - Seng Phung-Lu
* 20060517 142327 kathy@ca.ibm.com - Kathy Chan
* 20100420 307152 kchong@ca.ibm.com - Keith Chong, Web Service deployment fails without web.xml
+ * 20120409 376345 yenlu@ca.ibm.com, kchong@ca.ibm.com - Stability improvements to web services commands/operations
*******************************************************************************/
package org.eclipse.jst.ws.internal.axis.creation.ui.command;
@@ -28,6 +29,7 @@ import org.eclipse.jst.ws.internal.axis.consumption.core.command.WSDL2JavaComman
import org.eclipse.jst.ws.internal.axis.consumption.core.common.JavaWSDLParameter;
import org.eclipse.jst.ws.internal.axis.consumption.ui.task.CopyAxisJarCommand;
import org.eclipse.jst.ws.internal.axis.consumption.ui.task.RefreshProjectCommand;
+import org.eclipse.jst.ws.internal.axis.creation.ui.plugin.WebServiceAxisCreationUIPlugin;
import org.eclipse.jst.ws.internal.axis.creation.ui.task.UpdateAxisWSDDFileTask;
import org.eclipse.ui.actions.WorkspaceModifyOperation;
import org.eclipse.wst.common.environment.IEnvironment;
@@ -83,10 +85,11 @@ public class BUCodeGenOperation extends AbstractDataModelOperation {
IEnvironment env = getEnvironment();
BottomUpWSModifyOperation buOperation = new BottomUpWSModifyOperation(info, env);
try {
- buOperation.execute(monitor);
+ buOperation.run(monitor);
}
- catch(CoreException ce){
- IStatus status = ce.getStatus();
+ catch (Exception e)
+ {
+ IStatus status = new Status(IStatus.ERROR, WebServiceAxisCreationUIPlugin.ID, e.getMessage(), e);
return status;
}
return Status.OK_STATUS;
diff --git a/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/command/TDCodeGenOperation.java b/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/command/TDCodeGenOperation.java
index 235a7e3e5..4eaa4329a 100644
--- a/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/command/TDCodeGenOperation.java
+++ b/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/command/TDCodeGenOperation.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2010 IBM Corporation and others.
+ * Copyright (c) 2006, 2012 IBM Corporation 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
@@ -14,6 +14,7 @@
* 20060517 142327 sengpl@ca.ibm.com - Seng Phung-Lu
* 20061004 159356 kathy@ca.ibm.com - Kathy Chan, Get correct module root URL based on server chosen
* 20100420 307152 kchong@ca.ibm.com - Keith Chong, Web Service deployment fails without web.xml
+ * 20120409 376345 yenlu@ca.ibm.com, kchong@ca.ibm.com - Stability improvements to web services commands/operations
*******************************************************************************/
package org.eclipse.jst.ws.internal.axis.creation.ui.command;
@@ -27,8 +28,10 @@ import org.eclipse.jst.ws.internal.axis.consumption.core.command.WSDL2JavaComman
import org.eclipse.jst.ws.internal.axis.consumption.core.common.JavaWSDLParameter;
import org.eclipse.jst.ws.internal.axis.consumption.ui.task.CopyAxisJarCommand;
import org.eclipse.jst.ws.internal.axis.consumption.ui.task.RefreshProjectCommand;
+import org.eclipse.jst.ws.internal.axis.creation.ui.plugin.WebServiceAxisCreationUIPlugin;
import org.eclipse.jst.ws.internal.axis.creation.ui.task.BackupSkelImplCommand;
import org.eclipse.jst.ws.internal.axis.creation.ui.task.Skeleton2WSDLCommand;
+import org.eclipse.jst.ws.internal.consumption.command.common.BuildProjectCommand;
import org.eclipse.ui.actions.WorkspaceModifyOperation;
import org.eclipse.wst.common.environment.IEnvironment;
import org.eclipse.wst.common.frameworks.datamodel.AbstractDataModelOperation;
@@ -91,16 +94,71 @@ public class TDCodeGenOperation extends AbstractDataModelOperation {
IEnvironment env = getEnvironment();
TopDownWSModifyOperation tdOperation = new TopDownWSModifyOperation(info, env);
try {
- tdOperation.execute(monitor);
+ tdOperation.run(monitor);
+
+ //serverProject.build(IncrementalProjectBuilder.INCREMENTAL_BUILD,monitor);
+ BuildProjectCommand buildCommand = new BuildProjectCommand();
+ buildCommand.setProject(serverProject);
+ buildCommand.setEnvironment(env);
+ buildCommand.setForceBuild(true);
+ buildCommand.execute(monitor, info);
+
+ GenSkeletonAndUpdateDDOperation genSkeletonAndUpdateDDOperation = new GenSkeletonAndUpdateDDOperation(info, env);
+ genSkeletonAndUpdateDDOperation.run(monitor);
}
- catch(CoreException ce){
- IStatus status = ce.getStatus();
+ catch(Exception e){
+ IStatus status = new Status(IStatus.ERROR, WebServiceAxisCreationUIPlugin.ID, e.getMessage(), e);
return status;
}
return Status.OK_STATUS;
}
-
+ private class GenSkeletonAndUpdateDDOperation extends WorkspaceModifyOperation
+ {
+ private IAdaptable info = null;
+ private IEnvironment env = null;
+
+ protected GenSkeletonAndUpdateDDOperation(IAdaptable adaptable, IEnvironment environment)
+ {
+ //super(serverProject);
+ info = adaptable;
+ env = environment;
+ }
+
+ @Override
+ protected void execute(IProgressMonitor monitor) throws CoreException
+ {
+ // Skeleton2WSDLCommand
+ skeleton2WSDLCommand.setEnvironment(env);
+ skeleton2WSDLCommand.setWebServicesParser(webServicesParser);
+ skeleton2WSDLCommand.setJavaWSDLParam(javaWSDLParam);
+ skeleton2WSDLCommand.setServerProject(serverProject);
+ skeleton2WSDLCommand.setServiceServerTypeID(serviceServerTypeID);
+ skeleton2WSDLCommand.setServiceExistingServer(serviceExistingServer);
+ IStatus status = skeleton2WSDLCommand.execute(monitor, info);
+ if (status.getSeverity() == Status.ERROR) {
+ throw new CoreException(status);
+ }
+ wsdlURI = skeleton2WSDLCommand.getWsdlURI();
+
+ // create the deployment descriptor if it doesn't exist
+ createDDCommand.setEnvironment(env);
+ createDDCommand.setServerProject(serverProject);
+ status = createDDCommand.execute(monitor, info);
+ if (status.getSeverity() == Status.ERROR) {
+ throw new CoreException(status);
+ }
+
+ // UpdateWebXMLCommand
+ updateWebXMLCommand.setEnvironment(env);
+ updateWebXMLCommand.setServerProject(serverProject);
+ status = updateWebXMLCommand.execute(monitor, info);
+ if (status.getSeverity() == Status.ERROR) {
+ throw new CoreException(status);
+ }
+
+ }
+ }
private class TopDownWSModifyOperation extends WorkspaceModifyOperation {
@@ -108,6 +166,7 @@ public class TDCodeGenOperation extends AbstractDataModelOperation {
private IEnvironment env = null;
protected TopDownWSModifyOperation(IAdaptable adaptable, IEnvironment environment){
+ //super(serverProject);
info = adaptable;
env = environment;
}
@@ -146,35 +205,6 @@ public class TDCodeGenOperation extends AbstractDataModelOperation {
}
javaWSDLParam = wsdl2JavaCommand.getJavaWSDLParam();
- // Skeleton2WSDLCommand
- skeleton2WSDLCommand.setEnvironment(env);
- skeleton2WSDLCommand.setWebServicesParser(webServicesParser);
- skeleton2WSDLCommand.setJavaWSDLParam(javaWSDLParam);
- skeleton2WSDLCommand.setServerProject(serverProject);
- skeleton2WSDLCommand.setServiceServerTypeID(serviceServerTypeID);
- skeleton2WSDLCommand.setServiceExistingServer(serviceExistingServer);
- status = skeleton2WSDLCommand.execute(monitor, info);
- if (status.getSeverity() == Status.ERROR) {
- throw new CoreException(status);
- }
- wsdlURI = skeleton2WSDLCommand.getWsdlURI();
-
- // create the deployment descriptor if it doesn't exist
- createDDCommand.setEnvironment(env);
- createDDCommand.setServerProject(serverProject);
- status = createDDCommand.execute(monitor, info);
- if (status.getSeverity() == Status.ERROR) {
- throw new CoreException(status);
- }
-
- // UpdateWebXMLCommand
- updateWebXMLCommand.setEnvironment(env);
- updateWebXMLCommand.setServerProject(serverProject);
- status = updateWebXMLCommand.execute(monitor, info);
- if (status.getSeverity() == Status.ERROR) {
- throw new CoreException(status);
- }
-
// RefreshProjectCommand
refreshProjectCommand.setEnvironment(env);
refreshProjectCommand.setProject(serverProject);
diff --git a/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/task/Skeleton2WSDLCommand.java b/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/task/Skeleton2WSDLCommand.java
index f8f6c412a..926a61ecb 100644
--- a/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/task/Skeleton2WSDLCommand.java
+++ b/bundles/org.eclipse.jst.ws.axis.creation.ui/src/org/eclipse/jst/ws/internal/axis/creation/ui/task/Skeleton2WSDLCommand.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
+ * Copyright (c) 2000, 2012 IBM Corporation 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
@@ -15,6 +15,7 @@
* 20070112 165721 makandre@ca.ibm.com - Andrew Mak, WSDL import cannot use relative import with to parent directories
* 20070125 171071 makandre@ca.ibm.com - Andrew Mak, Create public utility method for copying WSDL files
* 20070409 181635 makandre@ca.ibm.com - Andrew Mak, WSDLCopier utility should create target folder
+ * 20120409 376345 yenlu@ca.ibm.com, kchong@ca.ibm.com - Stability improvements to web services commands/operations
*******************************************************************************/
package org.eclipse.jst.ws.internal.axis.creation.ui.task;
@@ -33,6 +34,7 @@ import javax.wsdl.extensions.soap.SOAPAddress;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IFolder;
import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IWorkspace;
import org.eclipse.core.resources.IWorkspaceRoot;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.IAdaptable;
@@ -185,7 +187,7 @@ public class Skeleton2WSDLCommand extends AbstractDataModelOperation
copier.setTargetFolderURI(folder);
copier.setTargetFilename(filename);
- ResourceUtils.getWorkspace().run(copier, monitor);
+ ResourceUtils.getWorkspace().run(copier, serverProject, IWorkspace.AVOID_UPDATE, monitor);
String newPath = outputFile.getParent().getLocation().append(copier.getRelativePath()).toString();
javaWSDLParam.setOutputWsdlLocation(newPath);
diff --git a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/test/wssample/GSTCGenerateCommand.java b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/test/wssample/GSTCGenerateCommand.java
index e7d91d9aa..3ee6aecdc 100644
--- a/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/test/wssample/GSTCGenerateCommand.java
+++ b/bundles/org.eclipse.jst.ws.consumption.ui/src/org/eclipse/jst/ws/internal/consumption/ui/widgets/test/wssample/GSTCGenerateCommand.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005 IBM Corporation and others.
+ * Copyright (c) 2005, 2012 IBM Corporation 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
@@ -7,6 +7,9 @@
*
* Contributors:
* IBM Corporation - initial API and implementation
+ * yyyymmdd bug Email and other contact information
+ * -------- -------- -----------------------------------------------------------
+ * 20120409 376345 yenlu@ca.ibm.com, kchong@ca.ibm.com - Stability improvements to web services commands/operations
*******************************************************************************/
package org.eclipse.jst.ws.internal.consumption.ui.widgets.test.wssample;
@@ -23,6 +26,7 @@ import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Status;
import org.eclipse.jem.util.emf.workbench.ProjectUtilities;
import org.eclipse.jst.ws.internal.common.J2EEUtils;
+import org.eclipse.jst.ws.internal.consumption.command.common.BuildProjectCommand;
import org.eclipse.jst.ws.internal.consumption.sampleapp.codegen.InputFileGenerator;
import org.eclipse.jst.ws.internal.consumption.sampleapp.codegen.MethodFileGenerator;
import org.eclipse.jst.ws.internal.consumption.sampleapp.codegen.ResultFileGenerator;
@@ -66,7 +70,11 @@ public class GSTCGenerateCommand extends AbstractDataModelOperation
if (status.getSeverity() == Status.ERROR) return status;
status = generatePages(env);
if (status.getSeverity() == Status.ERROR) return status;
- return status;
+ BuildProjectCommand buildProjectCommand = new BuildProjectCommand();
+ buildProjectCommand.setEnvironment(env);
+ buildProjectCommand.setForceBuild(true);
+ buildProjectCommand.setProject(ResourcesPlugin.getWorkspace().getRoot().getProject(testInfo.getGenerationProject()));
+ return buildProjectCommand.execute(monitor, adaptable);
}
private void setJSPFolder(){
diff --git a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/command/common/BuildProjectCommand.java b/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/command/common/BuildProjectCommand.java
index de06d7aec..9c6f925ff 100644
--- a/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/command/common/BuildProjectCommand.java
+++ b/bundles/org.eclipse.jst.ws.consumption/src/org/eclipse/jst/ws/internal/consumption/command/common/BuildProjectCommand.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * Copyright (c) 2000, 2012 IBM Corporation 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
@@ -10,12 +10,16 @@
* yyyymmdd bug Email and other contact information
* -------- -------- -----------------------------------------------------------
* 20090311 250984 mahutch@ca.ibm.com - Mark Hutchinson, Use another mechanism to wait for build to be completed
+ * 20120409 376345 yenlu@ca.ibm.com, kchong@ca.ibm.com - Stability improvements to web services commands/operations
*******************************************************************************/
package org.eclipse.jst.ws.internal.consumption.command.common;
import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IWorkspaceRunnable;
import org.eclipse.core.resources.IncrementalProjectBuilder;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
@@ -44,22 +48,30 @@ public class BuildProjectCommand extends AbstractDataModelOperation
*/
public IStatus execute( IProgressMonitor monitor, IAdaptable adaptable )
{
- try
- {
+ try
+ {
+ ResourcesPlugin.getWorkspace().run(new BuildProjectOperation(),monitor);
+ }
+ catch (CoreException e)
+ {
+ return e.getStatus();
+ }
+ return Status.OK_STATUS;
+ }
+
+ private class BuildProjectOperation implements IWorkspaceRunnable
+ {
+ public void run(IProgressMonitor arg0) throws CoreException {
+
if (forceBuild_)
project_.build(IncrementalProjectBuilder.INCREMENTAL_BUILD, new NullProgressMonitor());
else if (validationManager == null)
project_.build(IncrementalProjectBuilder.INCREMENTAL_BUILD, new NullProgressMonitor());
else if (validationManager.getWorkspaceAutoBuildPreference())
project_.build(IncrementalProjectBuilder.INCREMENTAL_BUILD, new NullProgressMonitor());
- }
- catch (Exception e)
- {
- }
-
-
- return Status.OK_STATUS;
+ }
}
+
/**
* @param forceBuild The forceBuild to set.
*/

Back to the top