Author: rob.stryker(a)jboss.com
Date: 2010-11-24 05:43:54 -0500 (Wed, 24 Nov 2010)
New Revision: 26874
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/context/RegisterServerContext.java
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/server/RegistrationHelper.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/DataSourceXmlDeployer.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamProjectWizard.java
Log:
JBIDE-7701 - registering the ds-xml and the seam project must be chained to be properly
executed in the right order.
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/context/RegisterServerContext.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/context/RegisterServerContext.java 2010-11-24
09:45:50 UTC (rev 26873)
+++
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/context/RegisterServerContext.java 2010-11-24
10:43:54 UTC (rev 26874)
@@ -161,7 +161,7 @@
}
@SuppressWarnings("restriction")
- public String getErrorMessage() {
+ public String getErrorMessage() {
if(runtimeName == null || runtimeName.length() == 0) return
WebUIMessages.RUNTIME_IS_REQUIRED;
if(runtime == null) return WebUIMessages.SPECIFIED_RUNTIME_DOESNOT_EXIST;
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/server/RegistrationHelper.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/server/RegistrationHelper.java 2010-11-24
09:45:50 UTC (rev 26873)
+++
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/server/RegistrationHelper.java 2010-11-24
10:43:54 UTC (rev 26874)
@@ -204,10 +204,13 @@
}
public static void runRegisterInServerJob(IProject p, IServer[] servers, String
contextRoot) {
- RegisterServerJob job = new RegisterServerJob(p, servers, contextRoot);
- job.schedule(100);
+ getRegisterInServerJob(p, servers, contextRoot).schedule(100);
}
+ public static RegisterServerJob getRegisterInServerJob(IProject p, IServer[] servers,
String contextRoot) {
+ return new RegisterServerJob(p, servers, contextRoot);
+ }
+
// registerInJob
private static class RegisterServerJob extends Job {
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/DataSourceXmlDeployer.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/DataSourceXmlDeployer.java 2010-11-24
09:45:50 UTC (rev 26873)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/DataSourceXmlDeployer.java 2010-11-24
10:43:54 UTC (rev 26874)
@@ -10,8 +10,6 @@
******************************************************************************/
package org.jboss.tools.seam.internal.core.project.facet;
-import java.util.ArrayList;
-
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
@@ -21,11 +19,10 @@
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.wst.server.core.IModule;
import org.eclipse.wst.server.core.IServer;
import org.eclipse.wst.server.core.IServerWorkingCopy;
-import org.eclipse.wst.server.core.IServer.IOperationListener;
+import org.eclipse.wst.server.core.internal.ChainedJob;
import org.jboss.ide.eclipse.as.core.modules.SingleDeployableFactory;
import org.jboss.ide.eclipse.as.core.server.internal.DeployableServerBehavior;
import org.jboss.tools.seam.core.SeamCoreMessages;
@@ -38,12 +35,12 @@
* @author eskimo
*
*/
-public class DataSourceXmlDeployer extends Job {
+public class DataSourceXmlDeployer extends ChainedJob {
IProject project = null;
IServer s = null;
IPath deploy = null;
public DataSourceXmlDeployer(IProject project, IServer s, IPath deploy) {
- super(SeamCoreMessages.DATA_SOURCE_XML_DEPLOYER_DEPLOYING_DATASOURCE_TO_SERVER);
+ super(SeamCoreMessages.DATA_SOURCE_XML_DEPLOYER_DEPLOYING_DATASOURCE_TO_SERVER, s);
this.project = project;
// is must be user since ds.xml has the same behaviour for EAR
// deployment. It should run after ear project created and imported into
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamProjectWizard.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamProjectWizard.java 2010-11-24
09:45:50 UTC (rev 26873)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamProjectWizard.java 2010-11-24
10:43:54 UTC (rev 26874)
@@ -28,9 +28,11 @@
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Preferences;
+import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.jdt.core.IClasspathContainer;
import org.eclipse.jdt.core.IClasspathEntry;
import org.eclipse.jdt.core.IJavaProject;
@@ -60,19 +62,20 @@
import org.eclipse.wst.common.frameworks.internal.datamodel.ui.DataModelSynchHelper;
import org.eclipse.wst.common.project.facet.core.FacetedProjectFramework;
import org.eclipse.wst.common.project.facet.core.IFacetedProject;
+import org.eclipse.wst.common.project.facet.core.IFacetedProject.Action;
import org.eclipse.wst.common.project.facet.core.IFacetedProjectTemplate;
import org.eclipse.wst.common.project.facet.core.IFacetedProjectWorkingCopy;
import org.eclipse.wst.common.project.facet.core.IPreset;
import org.eclipse.wst.common.project.facet.core.IProjectFacet;
import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
-import org.eclipse.wst.common.project.facet.core.IFacetedProject.Action;
import org.eclipse.wst.common.project.facet.core.events.IFacetedProjectEvent;
import org.eclipse.wst.common.project.facet.core.events.IFacetedProjectListener;
import org.eclipse.wst.common.project.facet.core.runtime.IRuntime;
import org.eclipse.wst.server.core.IServer;
import org.eclipse.wst.server.core.IServerLifecycleListener;
import org.eclipse.wst.server.core.ServerCore;
+import org.eclipse.wst.server.core.internal.ChainedJob;
import org.eclipse.wst.server.ui.ServerUIUtil;
import org.jboss.ide.eclipse.as.core.server.internal.JBossServer;
import org.jboss.tools.jst.web.server.RegistrationHelper;
@@ -321,7 +324,6 @@
IFacetedProjectWorkingCopy fpwc = getFacetedProjectWorkingCopy();
IProjectFacet jpaFacet = ProjectFacetsManager.getProjectFacet("jpt.jpa");
IProjectFacetVersion pfv = fpwc.getProjectFacetVersion(jpaFacet);
-
if (isEAR && pfv != null){
//remove jpa facet from <project>
// and add it to <project>-ejb with the same model
@@ -420,15 +422,15 @@
}
}
- RegistrationHelper.runRegisterInServerJob(warProject, server);
-
IPath filePath = new Path("resources").append(warProject.getName() +
"-ds.xml");
-
+ ChainedJob dsJob = null;
if (deployAsEar) {
- new DataSourceXmlDeployer(earProject, server, filePath).schedule();
+ dsJob = new DataSourceXmlDeployer(earProject, server, filePath);
} else {
- new DataSourceXmlDeployer(warProject, server, filePath).schedule();
- }
+ dsJob = new DataSourceXmlDeployer(warProject, server, filePath);
+ }
+ dsJob.setNextJob(RegistrationHelper.getRegisterInServerJob(warProject, new
IServer[]{server}, null));
+ dsJob.schedule();
}
}