addProject(project,!opt.isSync(),opt.isVerify());
System.out.println("Project returned");
return project;
}
public Project createProject(final CreateOptions opt) {
JobRunnable runnable=new JobRunnable("Local: create Project"){
public Object run() throws Exception{
return createProjectAsync(opt);
}
};
if (opt.isSync()){
Job job=new Job(SessionFactory.getInstance().getJobQueue(),"createProject","Creating project...",false);
job.addRunnable(runnable);
job.addSync();
SessionFactory.getInstance().schedule(job);
try {
Project project=(Project)job.waitResult();
System.out.println("Project returned end lock");
return project;
} catch (Exception e) {//Forward exception + Alert
e.printStackTrace();
return null;
}
}else{
try {
return (Project)runnable.run();
} catch (Exception e) {
e.printStackTrace();
return null;
}
}