Package com.projity.job

Examples of com.projity.job.JobRunnable


    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;
      }
    }
View Full Code Here


        recover=false;
      }
    }else recover=false;

    if (job==null) job=session.getLoadProjectJob(opt);
    job.addSwingRunnable(new JobRunnable("Local: addProject"){
      public Object run() throws Exception{
        Project project=(Project)getPreviousResult();
        if (!recover){
          if (project!=null) addProject(project,false,true);
          if (opt.getId()>0) removeLoadingProject(opt.getId());
View Full Code Here

    opt.setSubproject(true);
    opt.setId(id);
    Job job=session.getLoadProjectJob(opt);
    subprojectTask.setFetching(true);

    job.addSwingRunnable(new JobRunnable("Local: insertProject"){
      public Object run() throws Exception{
        try {
          Project subproject = (Project)getPreviousResult();

          //add assignments in the outline, paste uses only assignments present in the nodeModel
View Full Code Here

    }
    if (job==null) job=closeProjectJob;
    else job.addJob(closeProjectJob);


    job.addRunnable(new JobRunnable("Local: closeProjects"){
      public Object run() throws Exception{
        Iterator i = toRemove.iterator();
        while (i.hasNext()) {
          Node node = (Node)i.next();
          Project p = (Project)node.getImpl();
View Full Code Here

TOP

Related Classes of com.projity.job.JobRunnable

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.