Skip to main content
summaryrefslogtreecommitdiffstats
blob: 19f51cfd22584f5ae474a6678672a6dc7404b5ab (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
/*******************************************************************************
 * Copyright (c) 2004, 2008 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License 2.0
 * which accompanies this distribution, and is available at
 * https://www.eclipse.org/legal/epl-2.0/
 *
 * SPDX-License-Identifier: EPL-2.0
 *
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/
package org.eclipse.wst.command.internal.env.common;

import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.Status;
import org.eclipse.wst.common.frameworks.datamodel.AbstractDataModelOperation;

/**
 * @deprecated We should not depend on the auto build to build projects, since auto build might be off.
 * Try using BuildBeanCommand or BuildProjectCommand to build the project instead. Also, the join() call 
 * can lead to deadlock in some situations.
 * @see org.eclipse.jst.ws.internal.consumption.command.common.BuildBeanCommand
 * @see org.eclipse.jst.ws.internal.consumption.command.common.BuildProjectCommand
*/ 
public class WaitForAutoBuildCommand extends AbstractDataModelOperation
{
  public IStatus execute( IProgressMonitor montitor, IAdaptable adaptable ) 
  {
  	IStatus status = Status.OK_STATUS;
  	
	try 
	{
	  Platform.getJobManager().join(ResourcesPlugin.FAMILY_AUTO_BUILD, null);
	} 
	catch( InterruptedException exc ) 
	{
	  // UISynchronizer.syncExec seems to interrupt the UI tread when the autobuilder is done.  Not sure, why.
	  // I'm assuming here that the autobuilder has actually completed its stuff.	
	}
		
	return status;
  }
}

Back to the top