summaryrefslogtreecommitdiffstats
path: root/sandbox/rfeng/eclipse-workspace/src
diff options
context:
space:
mode:
Diffstat (limited to 'sandbox/rfeng/eclipse-workspace/src')
-rw-r--r--sandbox/rfeng/eclipse-workspace/src/main/java/org/apache/tuscany/eclipse/workspace/WorkspaceConfigurator.java28
1 files changed, 4 insertions, 24 deletions
diff --git a/sandbox/rfeng/eclipse-workspace/src/main/java/org/apache/tuscany/eclipse/workspace/WorkspaceConfigurator.java b/sandbox/rfeng/eclipse-workspace/src/main/java/org/apache/tuscany/eclipse/workspace/WorkspaceConfigurator.java
index fcdd484939..14f94a582f 100644
--- a/sandbox/rfeng/eclipse-workspace/src/main/java/org/apache/tuscany/eclipse/workspace/WorkspaceConfigurator.java
+++ b/sandbox/rfeng/eclipse-workspace/src/main/java/org/apache/tuscany/eclipse/workspace/WorkspaceConfigurator.java
@@ -44,9 +44,6 @@ import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.jobs.IJobChangeEvent;
-import org.eclipse.core.runtime.jobs.IJobChangeListener;
-import org.eclipse.core.runtime.jobs.JobChangeAdapter;
import org.eclipse.equinox.app.IApplication;
import org.eclipse.equinox.app.IApplicationContext;
import org.eclipse.jdt.core.JavaCore;
@@ -68,23 +65,17 @@ public class WorkspaceConfigurator implements IApplication {
private static final String M2_REPO = "M2_REPO";
private IWorkspace workspace;
- private final Object lock = new Object();
public Object start(final IApplicationContext appcontext) throws Exception {
IProgressMonitor monitor = createMonitor();
final String[] args = (String[])appcontext.getArguments().get(IApplicationContext.APPLICATION_ARGS);
setM2REPOClassPathVariable(args, monitor);
- setTargetPlatform(args);
-
- // Wait for the target platform job is done
- synchronized (lock) {
- lock.wait();
- }
+ setTargetPlatform(args, monitor);
configureWorkspace(args, monitor);
return EXIT_OK;
}
- private void setTargetPlatform(String args[]) throws FileNotFoundException, CoreException,
+ private void setTargetPlatform(String args[], IProgressMonitor monitor) throws FileNotFoundException, CoreException,
ParserConfigurationException, SAXException, IOException {
String targetFile = getOptionValue(args, TARGET_DEFINITION);
if (targetFile == null) {
@@ -101,19 +92,8 @@ public class WorkspaceConfigurator implements IApplication {
} finally {
is.close();
}
- IJobChangeListener jobListener = new JobChangeAdapter() {
-
- @Override
- public void done(IJobChangeEvent event) {
- super.done(event);
- synchronized (lock) {
- print("Target platform is configured: " + event.getResult());
- lock.notifyAll();
- }
- }
-
- };
- LoadTargetDefinitionJob.load(th.getTargetDefinition(), jobListener);
+ LoadTargetDefinitionJob job = new LoadTargetDefinitionJob(th.getTargetDefinition());
+ job.runInWorkspace(monitor);
}
private IProgressMonitor createMonitor() {