Examples of ISchedulingRule


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

    }
  }

  public IStatus validateInJob(final IValidationContext helper, final IReporter reporter) throws ValidationException {
    Job currentJob = Job.getJobManager().currentJob();
    ISchedulingRule rule = null;
    if (currentJob != null) {
      rule = currentJob.getRule();
    }
    IWorkspaceRunnable validationRunnable = new IWorkspaceRunnable() {
      public void run(IProgressMonitor monitor) throws CoreException {
View Full Code Here

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

        result.setDependsOn(resources);
        fDependsOn.clear();
      }
    };
    Job currentJob = Job.getJobManager().currentJob();
    ISchedulingRule rule = null;
    if (currentJob != null) {
      rule = currentJob.getRule();
    }
    try {
      JavaCore.run(validationRunnable, rule, new NullProgressMonitor());
View Full Code Here

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

    IStatus status = Status.OK_STATUS;
    FindRegions findRegions = new FindRegions(this.fDocument, this.fRegionText, this.fRegionType);
    try {
      // BUG158846 - deadlock if lock up entire workspace, so only lock
      // up the file we are searching on
      ISchedulingRule markerRule = ResourcesPlugin.getWorkspace().getRuleFactory().markerRule(getFile());
      ResourcesPlugin.getWorkspace().run(findRegions, markerRule, IWorkspace.AVOID_UPDATE, monitor);
    } catch (CoreException e) {
      status = new Status(IStatus.ERROR, SSEUIPlugin.ID, IStatus.OK, "", null); //$NON-NLS-1$
    }
    return status;
View Full Code Here

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

    };

    IResourceRuleFactory ruleFactory = ResourcesPlugin.getWorkspace()
        .getRuleFactory();

    ISchedulingRule rule = ruleFactory.buildRule();
    job.setRule(rule);
    job.schedule();
  }
View Full Code Here

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

    IStatus status = Status.OK_STATUS;
    FindRegions findRegions = new FindRegions(this.fDocument, this.fRegionText, this.fRegionType);
    try {
      // BUG158846 - deadlock if lock up entire workspace, so only lock
      // up the file we are searching on
      ISchedulingRule markerRule = ResourcesPlugin.getWorkspace().getRuleFactory().markerRule(getFile());
      ResourcesPlugin.getWorkspace().run(findRegions, markerRule, IWorkspace.AVOID_UPDATE, null);
    } catch (CoreException e) {
      status = new Status(IStatus.ERROR, SSEUIPlugin.ID, IStatus.OK, "", null); //$NON-NLS-1$
    }
    return status;
View Full Code Here

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

                    && returnCode != Window.OK) {
                return;
            }
        }

        ISchedulingRule schedulingRule = ResourcesPlugin.getWorkspace()
                .getRoot();
        PtolemySortMembersOperation operation = new PtolemySortMembersOperation(
                compilationUnit, null, false);
        try {
            BusyIndicatorRunnableContext context = new BusyIndicatorRunnableContext();
View Full Code Here

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

        // to perform fresh resolve

        // Let's try to be nice and use the workspace method to schedule resolves in
        // dependent projects after the close operation has finished.
        IResourceRuleFactory ruleFactory = ResourcesPlugin.getWorkspace().getRuleFactory();
        ISchedulingRule modifyRule = ruleFactory.modifyRule(javaProject.getCorrespondingResource());
        List affectedContainers = getAffectedContainers(javaProject.getPath());
        IvyMultiResolveJob multiResolveJob = new IvyMultiResolveJob(affectedContainers);
        multiResolveJob.setRule(modifyRule);
        multiResolveJob.schedule();
View Full Code Here

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

        }

        // Let's try to be nice and use the workspace method to schedule resolves in
        // dependent projects after the open operation has finished.
        IResourceRuleFactory ruleFactory = ResourcesPlugin.getWorkspace().getRuleFactory();
        ISchedulingRule modifyRule = ruleFactory.modifyRule(ResourcesPlugin.getWorkspace()
                .getRoot());
        List allContainers = getAllContainersExcludingProjects(projects);
        IvyMultiResolveJob multiResolveJob = new IvyMultiResolveJob(allContainers);
        multiResolveJob.setRule(modifyRule);
        multiResolveJob.schedule();
View Full Code Here

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

  /**
   * Get the thread(s) that own the lock this thread is waiting for.
   */
  private Thread[] blockingThreads(Thread current) {
    //find the lock this thread is waiting for
    ISchedulingRule lock = (ISchedulingRule) getWaitingLock(current);
    return getThreadsOwningLock(lock);
  }
View Full Code Here

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

    int NUM_PASSES = 2;
    conflicting.add(lock);
    graph[threadIndex][lockIndex]++;
    for (int i = 0; i < NUM_PASSES; i++) {
      for (int k = 0; k < conflicting.size(); k++) {
        ISchedulingRule current = (ISchedulingRule) conflicting.get(k);
        for (int j = 0; j < locks.size(); j++) {
          ISchedulingRule possible = (ISchedulingRule) locks.get(j);
          if (current.isConflicting(possible) && !conflicting.contains(possible)) {
            conflicting.add(possible);
            graph[threadIndex][j]++;
          }
        }
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.