Examples of IJobManager


Examples of org.eclipse.core.runtime.jobs.IJobManager

            }
        }

        if (resource instanceof IProject) {
            // Ignore all the jobs from SVN.
            IJobManager jobManager = Job.getJobManager();
            Job currentJob = jobManager.currentJob();
            if (currentJob != null) {
                String jobName = currentJob.getName();
                if (jobNames.contains(jobName)) {
                    setPostponeSending(true);
                }
View Full Code Here

Examples of org.eclipse.core.runtime.jobs.IJobManager

 
  // TODO build stuff should go elsewhere
  public static void waitForBuild(IProgressMonitor monitor) {
    SubMonitor subMonitor = SubMonitor.convert(monitor, 100);
   
    IJobManager jobManager = Job.getJobManager();
   
    // we need to ensure that the build has completed:
    // for some strange reason join-thread gets interrupted
    // once in a while (at least on windows).
    boolean buildHasntFinishedYet = true;
    while(buildHasntFinishedYet && !subMonitor.isCanceled()) {
      subMonitor.setWorkRemaining(100);
      try {
        jobManager.join(ResourcesPlugin.FAMILY_AUTO_BUILD, subMonitor.newChild(50));
        jobManager.join(ResourcesPlugin.FAMILY_MANUAL_BUILD, subMonitor.newChild(50));
       
        buildHasntFinishedYet = false;
      } catch (InterruptedException e) {
        buildHasntFinishedYet = true; //
      }
View Full Code Here

Examples of org.eclipse.core.runtime.jobs.IJobManager

   *      org.eclipse.core.runtime.jobs.ISchedulingRule)
   */
  public void runInUI(final IRunnableContext context,
      final IRunnableWithProgress runnable, final ISchedulingRule rule)
      throws InvocationTargetException, InterruptedException {
    final IJobManager manager = Job.getJobManager();
    final InvocationTargetException[] exception = new InvocationTargetException[1];
    final InterruptedException[] canceled = new InterruptedException[1];
    BusyIndicator.showWhile(Display.getDefault(), new Runnable() {
      public void run() {
        try {
          manager.beginRule(rule,
              ((Workbench) PlatformUI.getWorkbench())
                  .isStarting() ? new NullProgressMonitor()
                  : getEventLoopMonitor());
          context.run(false, false, runnable);
        } catch (InvocationTargetException e) {
          exception[0] = e;
        } catch (InterruptedException e) {
          canceled[0] = e;
        } catch (OperationCanceledException e) {
          canceled[0] = new InterruptedException(e.getMessage());
        } finally {
          manager.endRule(rule);
        }
      }

      /**
       * Get a progress monitor that forwards to an event loop monitor.
View Full Code Here

Examples of org.eclipse.core.runtime.jobs.IJobManager

   * Blocks until all builders have completed their work. If an
   * {@link InterruptedException} occurs while waiting for completion, the
   * exception is silently caught and blocking is resumed.
   */
  public void waitForBuild() {
    IJobManager jobManager = Job.getJobManager();
   
    // we need to ensure that the build has completed:
    // for some strange reason join-thread gets interrupted
    // once in a while (at least on windows).
    boolean buildHasntFinishedYet = true;
    while(buildHasntFinishedYet) {
      try {
        jobManager.join(ResourcesPlugin.FAMILY_AUTO_BUILD, null);
        jobManager.join(ResourcesPlugin.FAMILY_MANUAL_BUILD, null);
       
        buildHasntFinishedYet = false;
      } catch (InterruptedException e) {
        buildHasntFinishedYet = true; //
      }
View Full Code Here

Examples of org.eclipse.core.runtime.jobs.IJobManager

      listener.eogeneratorStarted();
    }
    try {
      boolean commitSuicide = false;

      IJobManager jobManager = Job.getJobManager();
      Job[] jobs = jobManager.find(null);
      if (jobs != null) {
        for (Job job : jobs) {
          if (job != this && job instanceof EOGenerateWorkspaceJob && ((EOGenerateWorkspaceJob) job).isFile(_eogenFile)) {
            EOGenerateWorkspaceJob otherJob = (EOGenerateWorkspaceJob) job;
            if (otherJob.creationDate() > _creationDate) {
View Full Code Here

Examples of org.eclipse.core.runtime.jobs.IJobManager

        /* (non-Javadoc)
         * @see org.eclipse.ui.progress.UIJob#runInUIThread(org.eclipse.core.runtime.IProgressMonitor)
         */
        public IStatus runInUIThread(IProgressMonitor monitor) {
            IJobManager jobManager = Job.getJobManager();
            try {
                jobManager.join(console, monitor);
            } catch (OperationCanceledException e1) {
                return Status.CANCEL_STATUS;
            } catch (InterruptedException e1) {
                return Status.CANCEL_STATUS;
            }
View Full Code Here

Examples of org.eclipse.core.runtime.jobs.IJobManager

        assertTrue(!project.exists());
        project.create(monitor);
        project.open(monitor);
        project.refreshLocal(IResource.DEPTH_INFINITE, monitor);
        IJobManager jobManager = Job.getJobManager();
        jobManager.resume();
        final PythonNature nature = (PythonNature) PythonNature.addNature(project, null, null, null, null, null, null);
        assertTrue(nature != null);

        //Let's give it some time to run the jobs that restore the nature
        goToIdleLoopUntilCondition(new ICallback<Boolean, Object>() {
View Full Code Here

Examples of org.eclipse.core.runtime.jobs.IJobManager

   * org.eclipse.php.internal.core.codeassist.PHPSelectionEngine.select
   * org.eclipse.php.internal.core.codeassist.PHPCompletionEngine.complete
   */
  public static void waitOnBuild()
  {
    IJobManager manager = Job.getJobManager();
    Job[] jobs = manager.find(ResourcesPlugin.FAMILY_AUTO_BUILD);

    if(jobs != null && jobs.length > 0){
      // force the jobs that are holding us up to execute.
      for (Job job : jobs){
        job.wakeUp();
      }

      int tries = 0;
      while(tries < 10 && jobs != null && jobs.length > 0){
        try{
          Thread.sleep(100);
        }catch(Exception ignore){
        }
        jobs = manager.find(ResourcesPlugin.FAMILY_AUTO_BUILD);
        tries++;
      }
    }
  }
View Full Code Here

Examples of org.eclipse.core.runtime.jobs.IJobManager

      // headless
      if (EclimApplication.isEnabled()){
        logger.info("Waiting on running jobs before starting eclimd...");
        long timeout = System.currentTimeMillis() + (30 * 1000);
        IJobManager manager = Job.getJobManager();
        while(System.currentTimeMillis() < timeout &&
          jobsRunning(manager))
        {
          try{
            Thread.sleep(1000);
View Full Code Here

Examples of org.eclipse.core.runtime.jobs.IJobManager

   */
  public Object execute(CommandLine commandLine)
    throws Exception
  {
    Object family = getFamily(commandLine.getValue(Options.FAMILY_OPTION));
    IJobManager manager = Job.getJobManager();
    Job[] jobs = manager.find(family);

    ArrayList<HashMap<String,String>> results =
      new ArrayList<HashMap<String,String>>();

    for (Job job : jobs){
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.