Examples of ISchedulingRule


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

   * Adds a new scheduling rule to the stack of rules for this thread. Throws
   * a runtime exception if the new rule is not compatible with the base
   * scheduling rule for this thread.
   */
  void push(final ISchedulingRule rule) {
    final ISchedulingRule baseRule = getRule();
    if (++top >= ruleStack.length) {
      ISchedulingRule[] newStack = new ISchedulingRule[ruleStack.length * 2];
      System.arraycopy(ruleStack, 0, newStack, 0, ruleStack.length);
      ruleStack = newStack;
    }
    ruleStack[top] = rule;
    if (JobManager.DEBUG_BEGIN_END)
      lastPush = (RuntimeException) new RuntimeException().fillInStackTrace();
    //check for containment last because we don't want to fail again on endRule
    if (baseRule != null && rule != null && !baseRule.contains(rule))
      illegalPush(rule, baseRule);
  }
View Full Code Here

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

  private void endThreadJob(ThreadJob threadJob, boolean resume) {
    Thread currentThread = Thread.currentThread();
    //clean up when last rule scope exits
    threadJobs.remove(currentThread);
    ISchedulingRule rule = threadJob.getRule();
    if (resume && rule != null)
      suspendedRules.remove(rule);
    //if this job had a rule, then we are essentially releasing a lock
    //note it is safe to do this even if the acquire was aborted
    if (threadJob.acquireRule) {
View Full Code Here

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

      // ensure that a scheduling rule is used so that the project description is not modified by another thread while we update it
      // see https://bugs.eclipse.org/bugs/show_bug.cgi?id=214981
      // also ensure that if no change (checkIdentify block returned above) we don't reach here
      // see https://bugs.eclipse.org/bugs/show_bug.cgi?id=241751
      IWorkspace workspace = projectResource.getWorkspace();
      ISchedulingRule rule = workspace.getRuleFactory().modifyRule(projectResource); // scheduling rule for modifying the project
      IWorkspaceRunnable runnable = new IWorkspaceRunnable() {
        public void run(IProgressMonitor monitor) throws CoreException {
          IProjectDescription description = projectResource.getDescription();
          description.setDynamicReferences(requiredProjectArray);
          projectResource.setDescription(description, IResource.AVOID_NATURE_CONFIG, null);
View Full Code Here

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

    if (length == 1)
      return getSchedulingRule(this.elementsToProcess[0]);
    ISchedulingRule[] rules = new ISchedulingRule[length];
    int index = 0;
    for (int i = 0; i < length; i++) {
      ISchedulingRule rule = getSchedulingRule(this.elementsToProcess[i]);
      if (rule != null) {
        rules[index++] = rule;
      }
    }
    if (index != length)
View Full Code Here

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

      }
    } else {
      destResource = ((IContainer) destContainer).getFolder(new Path(newName));
    }
    IResourceRuleFactory factory = ResourcesPlugin.getWorkspace().getRuleFactory();
    ISchedulingRule rule;
    if (isMove()) {
      rule = factory.moveRule(sourceResource, destResource);
    } else {
      rule = factory.copyRule(sourceResource, destResource);
    }
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());
        class IvyClosedProjectJob extends WorkspaceJob {

            public IvyClosedProjectJob() {
                super("IvyClosedProjectJob");
            }
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());
        class IvyOpenProjectJob extends WorkspaceJob {

            public IvyOpenProjectJob() {
                super("IvyOpenProjectJob");
View Full Code Here

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

          }
        }
      }
    });

    ISchedulingRule rule = ResourcesPlugin.getWorkspace().getRuleFactory()
        .buildRule();
    job.setRule(rule);
    job.schedule();

    return true;
View Full Code Here

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

        return (IFile[]) files.toArray(new IFile[files.size()]);
    }

    public void run() {
        IWorkspace workspace = ResourcesPlugin.getWorkspace();
        ISchedulingRule rule = workspace.getRuleFactory().modifyRule(workspace.getRoot());
        try {
            Platform.getJobManager().beginRule(rule, null);
            if (validateResources((FileSearchQuery) fPage.getInput().getQuery())) {
                ReplaceDialog2 dialog = new ReplaceDialog2(fSite.getShell(), fElements, fPage);
                dialog.open();
View Full Code Here

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

    }

    private void run(ReplaceOperation operation, IResource resource) throws InvocationTargetException,
            InterruptedException {
        IResourceRuleFactory ruleFactory = ResourcesPlugin.getWorkspace().getRuleFactory();
        ISchedulingRule rule = ruleFactory.modifyRule(resource);

        PlatformUI.getWorkbench().getProgressService().runInUI(this, operation, rule);
    }
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.